freebsd-dev/sys/boot/i386/libi386
Peter Wemm 99cbd70f0b The read-ahead code from r298230 made it likely the boot code would read
beyond the end of disk. r298900 added code to prevent this.  Some BIOSes
cause significant delays if asked to read past end-of-disk.

We never trusted the BIOS to accurately report the sectorsize of disks
before and this set of changes.  Unfortuately they interact badly with
the infamous >2TB wraparound bugs.  We have a number of relatively-recent
machines in the FreeBSD.org cluster where the BIOS reports 3TB disks as 1TB.

With pre-r298900 they work just fine.  After r298900 they stop working if
the boot environment attempts to access anything outside the first 1TB on
the disk.  'ZFS: I/O error, all block copies unavailable' etc.  It affects
both UFS and ZFS if they try to boot from large volumes.

This change replaces the blind trust of the BIOS end-of-disk reporting
with a read-ahead clip to prevent reads crossing the of end-of-disk
boundary.  Since 2^32 (2TB) size reporting truncation is not uncommon,
the clipping is done on 2TB aliases of the reported end-of-disk.
ie: a 3TB disk reported as 1TB has readahead clipped at 1TB, 3TB, 5TB, ...
as one of them is likely to be the real end-of-disk.

This should make the loader on these broken machines behave the same as
traditional pre-r298900 loader behavior, without disabling read-ahead.

PR:		212139
Discussed with:	tsoome, allanjude
2016-08-28 20:39:33 +00:00
..
amd64_tramp.S sys/boot: spelling fixes in comments. 2016-04-30 00:26:38 +00:00
biosacpi.c Deprecate using hints.acpi.0.rsdp to communicate the RSDP to the 2016-04-14 04:59:51 +00:00
bioscd.c Fix several instances where the boot loader ignored pager_output 2016-05-18 05:59:05 +00:00
biosdisk.c The read-ahead code from r298230 made it likely the boot code would read 2016-08-28 20:39:33 +00:00
biosmem.c A new implementation of the loader block cache 2016-04-18 23:09:22 +00:00
biospci.c Add support for calling pcibios routines from the 2014-09-10 21:07:00 +00:00
biospnp.c
biossmap.c
bootinfo32.c
bootinfo64.c loader: fix the size of MODINFOMD_MODULEP 2015-01-20 12:28:24 +00:00
bootinfo.c howto_names: unify declaration 2014-03-11 10:13:06 +00:00
comconsole.c Add support for serial and null console to UEFI boot loader. 2014-09-12 17:32:28 +00:00
devicename.c Quiesce some clang warnings while we're here doing stuff. 2013-01-14 15:05:22 +00:00
elf32_freebsd.c
elf64_freebsd.c loader: implement multiboot support for Xen Dom0 2015-01-15 16:27:20 +00:00
i386_copy.c
i386_module.c
libi386.h pxeboot: make the tftp loader use the option root-path directive 2015-12-16 17:13:09 +00:00
Makefile Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally. 2016-03-26 03:46:12 +00:00
Makefile.depend DIRDEPS_BUILD: Update dependencies. 2016-03-21 18:02:26 +00:00
multiboot_tramp.S loader: implement multiboot support for Xen Dom0 2015-01-15 16:27:20 +00:00
multiboot.c multiboot: fix error codes 2015-04-01 10:10:20 +00:00
multiboot.h loader: implement multiboot support for Xen Dom0 2015-01-15 16:27:20 +00:00
nullconsole.c
pread.c
pxe.c A new implementation of the loader block cache 2016-04-18 23:09:22 +00:00
pxe.h sys/boot: spelling fixes in comments. 2016-04-30 00:26:38 +00:00
pxetramp.s
smbios.c Add kernel environment variables under smbios.system for the following 2016-08-10 18:23:23 +00:00
smbios.h SMBIOS support for EFI. 2015-04-06 06:55:47 +00:00
spinconsole.c Make this compile when TERM_EMU is not defined. 2014-12-22 19:10:11 +00:00
time.c
vidconsole.c