]> xenbits.xensource.com Git - seabios.git/commit
Add LBA 64bit support for reads beyond 2TB.
authorMax Tottenham <mtottenh@akamai.com>
Thu, 25 Jan 2024 15:00:50 +0000 (10:00 -0500)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 26 Jan 2024 14:59:34 +0000 (15:59 +0100)
commit82faf1d5c8b25375b9029f2d6668135e62455a8c
treeb272a5171b796d9e34a793be56611b3afc41ac16
parent3f082f38bf0050270dc65abf256f7014f6c0c4a8
Add LBA 64bit support for reads beyond 2TB.

When booting from a >2TB drive/filesystem, it's possible what the
kernel/bootloader may be updated and written out at an LBA address
beyond what is normally accessible by the READ(10) SCSI commands.
If this happens to the kernel grub will fail to boot the kernel
as it will call into the BIOS with an LBA address >2TB, and the
BIOS will return an error. Per the SCSI spec, >2TB drives should
return 0XFFFFFFFF, and a READ CAPACITY(16) command should be issued
to determine the full size of the drive, READ(16) commands can then
be used in order to read data at LBA addresses beyond 2TB (64 bit
LBA addresses)

Signed-off-by: Max Tottenham <mtottenh@akamai.com>
Message-ID: <20240125150050.3775834-2-mtottenh@akamai.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
src/hw/blockcmd.c
src/hw/blockcmd.h