From 393296de19650e1400ca265914cfdeb313725363 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 5 Aug 2022 11:42:14 +0200 Subject: [PATCH 1/4] 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 5447de2619050a0a4d 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 Reviewed-by: Eric Farman Signed-off-by: Thomas Huth --- pc-bios/s390-ccw/virtio-blkdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pc-bios/s390-ccw/virtio-blkdev.c b/pc-bios/s390-ccw/virtio-blkdev.c index 8271c47296..794f99b42c 100644 --- a/pc-bios/s390-ccw/virtio-blkdev.c +++ b/pc-bios/s390-ccw/virtio-blkdev.c @@ -173,7 +173,7 @@ int virtio_get_block_size(void) switch (vdev->senseid.cu_model) { case VIRTIO_ID_BLOCK: - return vdev->config.blk.blk_size << vdev->config.blk.physical_block_exp; + return vdev->config.blk.blk_size; case VIRTIO_ID_SCSI: return vdev->scsi_block_size; } From c3dd58ba6e0123806ef45e447eeee881203cd6ec Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Sun, 7 Aug 2022 18:22:35 +0200 Subject: [PATCH 2/4] pc-bios/s390-ccw: Update the s390-ccw.img with the block size fix The new binary now gets the block size of virtio-blk devices right. Signed-off-by: Thomas Huth --- pc-bios/s390-ccw.img | Bin 42608 -> 42608 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/pc-bios/s390-ccw.img b/pc-bios/s390-ccw.img index 39f9680a0ef1c57f8a0bac9e12ff77ce15150d37..554fcbd1b7af8ea5f8f0d887fba98d52b7a8611d 100644 GIT binary patch delta 4206 zcmYjU3s}@u7XP0SU+3Px>7>kb zQr7$*C&~KTA|1S(4PI&K8Q(5AS6}mX)t<#oXKo(f`Of_vm@In<%5lH!dC@9HZ1Zi@ z4_FF~*Ck2uA+_O4j0#B_Uu*bs#8z;9nHA1PwIpS(#cF%4XC_J9%+yNbSU$n9%YG}! zZ&a#VB@(A~V7|ix-x|WB-fgp!q8V)>a#jq~Y!8e@e z!+5;ooC(JB7E~bLiF`gsJ>EiH?~UB35W4hMGCxv zy^1#>8JD`>hR^XikLQ(I%F(He0;m4KxR`Ky0bcW%={<#$n5|!7vFPh924-ErXFO9O z5}Q1IVIA)C3gMMfx$=I(6 z56U>gD})CI8QWvAmooSiOKviA6XVWb_dq(}YOk5#k5|2NWy*&b?!5>0;R){&2tj|J z0GNSeeX`&aT>WPKEweT?>@vVVn816T{;w{pST&CYIN&5aFPqxls*cNVe(5n1JQcEgL0M z3ngQBMU;amMi)t+_; zEi&ZkPkw>>uASLtKgmvb?w0Hv`q|^lSf`o{d+{GCCDh;rl`3j7$LE<$GBXb7`Pfuy zow<|(k&BM*gXA?B6!b6f#qOXnGA|4I1=j?BL-b#G_aup3D)7{vou)#oY4V%6H@FJc zZdB|1lO9t-vTf9Q1`>1V3a8_OW$FUBiCffh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<=`gnrx6Y}F-~SV-pa^}L*7R2=W<`eyl)uu zwG*m_v3ZmIzaok07uI$%?jRh}3C(#*@v-4do?M6va4~-zmJD@4lNO&07R%jhbTC-y zO;`hZafz*LU;*iV;}>Iit>JpXZIRoi2q}~rD%BzRud5XjW(DR$tCtkob=R61RLE?% zEqzI#-97kUga6HBt>+T-j*G;{cu--oSO;Z=2_YQmmYRd*k``Gyw3e%%BB(aR@Q5q0 zyU^R6gZbWS{Hlmz=?eIwFv~HK@b%^3Qj~yqVn&fxNHDi3PW%L$i!>n@SgYJv96lhtF49&#aD!Km5tK%G7S$}PRgzqsJ-$TtbM8u zosgBb%D>0={wb3Fd=|baZIr(@)c+gIEXxu54SUO|)<8!2R=1*@7V~_Y;h%EhR{0va zWb1eKLruj>`O%^NA?T}EA9p9U?Jb#BU`z8~`Xpz7Hg4`mNI(tg>dYX2UNPN{R>I@I6PrZCH-Mo6q& z?4#tTV*7+4WhpA{aK2jiGB)Erq;Y|#rq#K9W9#4k8kr8fz925Xx7Q7+*22{3FUX6B z`s3i@^lIS-g)=_G?>mQQ4u~o6&u6~Gx5wma#CAjC%u+XT&+tlZuXE`6KJxu!E@v1&F>En?o^$Br zD8rVzJXzQmw#(dNIcGHPmL$K&^oD9nL}-V{E{u<1VC6Is1C^^XBNt*4SK`C4nx2Q& zhoQuWer_6th{Vs+a}y0mS2?K-=XVAQG239;rMJURj%|AroQZ Date: Tue, 2 Aug 2022 13:36:06 +0300 Subject: [PATCH 3/4] tests/avocado: fix replay-linux test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Last line of the test is missing by accident. This patch fixes the script. Signed-off-by: Pavel Dovgalyuk Message-Id: <165943656662.362178.2086588841425038338.stgit@pasha-ThinkPad-X280> Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Thomas Huth --- tests/avocado/replay_linux.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/avocado/replay_linux.py b/tests/avocado/replay_linux.py index 40e4f6908e..e1f9981a34 100644 --- a/tests/avocado/replay_linux.py +++ b/tests/avocado/replay_linux.py @@ -189,3 +189,4 @@ class ReplayLinuxAarch64(ReplayLinux): self.run_rr(shift=3, args=(*self.get_common_args(), + "-machine", "virt,gic-version=3")) From 407634970dc5dba9330c360cfdc4e69e7aea3b37 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 2 Aug 2022 14:31:01 +0200 Subject: [PATCH 4/4] tests/qemu-iotests/264: Allow up to 5s for the BLOCK_JOB_CANCEL event to arrive It is possible to hit the assertTrue(delta_t < 2.0) on very loaded systems. Increase the value to 5.0 to ease the situation a little bit. Message-Id: <20220802123101.430757-1-thuth@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Thomas Huth --- tests/qemu-iotests/264 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/264 b/tests/qemu-iotests/264 index bc431d1a19..289381e315 100755 --- a/tests/qemu-iotests/264 +++ b/tests/qemu-iotests/264 @@ -101,7 +101,7 @@ class TestNbdReconnect(iotests.QMPTestCase): start_t = time.time() self.vm.event_wait('BLOCK_JOB_CANCELLED') delta_t = time.time() - start_t - self.assertTrue(delta_t < 2.0) + self.assertTrue(delta_t < 5.0) def test_mirror_cancel(self): # Mirror speed limit doesn't work well enough, it seems that mirror