thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-pc-bios-s390-ccw-virtio-Read-device-config-after-fea.patch

0727d3
From a60940fb7ef026f3aa968e77389efa51ea648ddf Mon Sep 17 00:00:00 2001
0727d3
From: Thomas Huth <thuth@redhat.com>
0727d3
Date: Fri, 8 Jul 2022 12:29:50 +0200
0727d3
Subject: [PATCH 34/37] pc-bios/s390-ccw/virtio: Read device config after
0727d3
 feature negotiation
0727d3
0727d3
RH-Author: Thomas Huth <thuth@redhat.com>
0727d3
RH-MergeRequest: 198: pc-bios/s390-ccw: Fix boot from disks with 4k sectors that do not have the typical DASD geometry
0727d3
RH-Commit: [6/9] 99ed8765d614207db19ded75d62c65171674d982
0727d3
RH-Bugzilla: 2098076
0727d3
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
0727d3
RH-Acked-by: David Hildenbrand <david@redhat.com>
0727d3
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
0727d3
0727d3
Bugzilla: http://bugzilla.redhat.com/2098076
0727d3
0727d3
commit aa5c69ce99411c4886bcd051f288afc02b6d968d
0727d3
Author: Thomas Huth <thuth@redhat.com>
0727d3
Date:   Mon Jul 4 13:18:58 2022 +0200
0727d3
0727d3
    pc-bios/s390-ccw/virtio: Read device config after feature negotiation
0727d3
0727d3
    Feature negotiation should be done first, since some fields in the
0727d3
    config area can depend on the negotiated features and thus should
0727d3
    rather be read afterwards.
0727d3
0727d3
    While we're at it, also adjust the error message here a little bit
0727d3
    (the code is nowadays used for non-block virtio devices, too).
0727d3
0727d3
    Message-Id: <20220704111903.62400-8-thuth@redhat.com>
0727d3
    Reviewed-by: Eric Farman <farman@linux.ibm.com>
0727d3
    Reviewed-by: Cornelia Huck <cohuck@redhat.com>
0727d3
    Signed-off-by: Thomas Huth <thuth@redhat.com>
0727d3
0727d3
Signed-off-by: Thomas Huth <thuth@redhat.com>
0727d3
---
0727d3
 pc-bios/s390-ccw/virtio.c | 7 +++----
0727d3
 1 file changed, 3 insertions(+), 4 deletions(-)
0727d3
0727d3
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
0727d3
index 4e85a2eb82..d8c2b52710 100644
0727d3
--- a/pc-bios/s390-ccw/virtio.c
0727d3
+++ b/pc-bios/s390-ccw/virtio.c
0727d3
@@ -262,10 +262,6 @@ void virtio_setup_ccw(VDev *vdev)
0727d3
     rc = run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false);
0727d3
     IPL_assert(rc == 0, "Could not write DRIVER status to host");
0727d3
 
0727d3
-    IPL_assert(
0727d3
-        run_ccw(vdev, CCW_CMD_READ_CONF, &vdev->config, cfg_size, false) == 0,
0727d3
-       "Could not get block device configuration");
0727d3
-
0727d3
     /* Feature negotiation */
0727d3
     for (i = 0; i < ARRAY_SIZE(vdev->guest_features); i++) {
0727d3
         feats.features = 0;
0727d3
@@ -278,6 +274,9 @@ void virtio_setup_ccw(VDev *vdev)
0727d3
         IPL_assert(rc == 0, "Could not set features bits");
0727d3
     }
0727d3
 
0727d3
+    rc = run_ccw(vdev, CCW_CMD_READ_CONF, &vdev->config, cfg_size, false);
0727d3
+    IPL_assert(rc == 0, "Could not get virtio device configuration");
0727d3
+
0727d3
     for (i = 0; i < vdev->nr_vqs; i++) {
0727d3
         VqInfo info = {
0727d3
             .queue = (unsigned long long) ring_area + (i * VIRTIO_RING_SIZE),
0727d3
-- 
0727d3
2.35.3
0727d3