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

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