qemu-e2k/pc-bios/s390-ccw
Thomas Huth 393296de19 pc-bios/s390-ccw: Fix booting with logical block size < physical block size
For accessing single blocks during boot, it's the logical block size that
matters. (Physical block sizes are rather interesting e.g. for creating
file systems with the correct alignment for speed reasons etc.).
So the s390-ccw bios has to use the logical block size for calculating
sector numbers during the boot phase, the "physical_block_exp" shift
value must not be taken into account. This change fixes the boot process
when the guest hast been installed on a disk where the logical block size
differs from the physical one, e.g. if the guest has been installed
like this:

 qemu-system-s390x -nographic -accel kvm -m 2G \
  -drive if=none,id=d1,file=fedora.iso,format=raw,media=cdrom \
  -device virtio-scsi -device scsi-cd,drive=d1 \
  -drive if=none,id=d2,file=test.qcow2,format=qcow2
  -device virtio-blk,drive=d2,physical_block_size=4096,logical_block_size=512

Linux correctly uses the logical block size of 512 for the installation,
but the s390-ccw bios tries to boot from a disk with 4096 block size so
far, as long as this patch has not been applied yet (well, it used to work
by accident in the past due to the virtio_assume_scsi() hack that used to
enforce 512 byte sectors on all virtio-block disks, but that hack has been
well removed in commit 5447de2619 to fix other scenarios).

Fixes: 5447de2619 ("pc-bios/s390-ccw/virtio-blkdev: Remove virtio_assume_scsi()")
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2112303
Message-Id: <20220805094214.285223-1-thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2022-08-07 12:54:12 +02:00
..
bootmap.c pc-bios/s390-ccw/bootmap: Improve the guessing logic in zipl_load_vblk() 2022-07-06 18:33:53 +02:00
bootmap.h
bswap.h
cio.c
cio.h
dasd-ipl.c
dasd-ipl.h
helper.h
iplb.h
jump2ipl.c
libc.c
libc.h
main.c pc-bios/s390-ccw: Split virtio-scsi code from virtio_blk_setup_device() 2022-07-06 18:35:10 +02:00
Makefile pc-bios/s390-ccw: add -Wno-array-bounds 2022-07-13 16:58:58 +02:00
menu.c
netboot.mak * fuzzing fixes (Alexander) 2022-07-12 14:12:15 +01:00
netmain.c
s390-arch.h
s390-ccw.h pc-bios/s390-ccw: Add a proper prototype for main() 2022-07-06 18:33:26 +02:00
s390-time.h
sclp.c
sclp.h
scsi.h
start.S
virtio-blkdev.c pc-bios/s390-ccw: Fix booting with logical block size < physical block size 2022-08-07 12:54:12 +02:00
virtio-net.c
virtio-scsi.c misc: fix commonly doubled up words 2022-08-01 11:58:02 +02:00
virtio-scsi.h pc-bios/s390-ccw: Split virtio-scsi code from virtio_blk_setup_device() 2022-07-06 18:35:10 +02:00
virtio.c pc-bios/s390-ccw/virtio: Beautify the code for reading virtqueue configuration 2022-07-06 18:35:00 +02:00
virtio.h pc-bios/s390-ccw/virtio: Remove "extern" keyword from prototypes 2022-07-06 18:35:27 +02:00