From: Thomas Huth <thuth@redhat.com>
To: qemu-s390x@nongnu.org, Eric Farman <farman@linux.ibm.com>
Cc: qemu-devel@nongnu.org,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>
Subject: [PATCH v2 07/12] pc-bios/s390-ccw/virtio: Read device config after feature negotiation
Date: Mon, 4 Jul 2022 13:18:58 +0200 [thread overview]
Message-ID: <20220704111903.62400-8-thuth@redhat.com> (raw)
In-Reply-To: <20220704111903.62400-1-thuth@redhat.com>
Feature negotiation should be done first, since some fields in the
config area can depend on the negotiated features and thus should
rather be read afterwards.
While we're at it, also adjust the error message here a little bit
(the code is nowadays used for non-block virtio devices, too).
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
pc-bios/s390-ccw/virtio.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index 4e85a2eb82..d8c2b52710 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -262,10 +262,6 @@ void virtio_setup_ccw(VDev *vdev)
rc = run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false);
IPL_assert(rc == 0, "Could not write DRIVER status to host");
- IPL_assert(
- run_ccw(vdev, CCW_CMD_READ_CONF, &vdev->config, cfg_size, false) == 0,
- "Could not get block device configuration");
-
/* Feature negotiation */
for (i = 0; i < ARRAY_SIZE(vdev->guest_features); i++) {
feats.features = 0;
@@ -278,6 +274,9 @@ void virtio_setup_ccw(VDev *vdev)
IPL_assert(rc == 0, "Could not set features bits");
}
+ rc = run_ccw(vdev, CCW_CMD_READ_CONF, &vdev->config, cfg_size, false);
+ IPL_assert(rc == 0, "Could not get virtio device configuration");
+
for (i = 0; i < vdev->nr_vqs; i++) {
VqInfo info = {
.queue = (unsigned long long) ring_area + (i * VIRTIO_RING_SIZE),
--
2.31.1
next prev parent reply other threads:[~2022-07-04 11:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 11:18 [PATCH v2 00/12] s390-ccw bios fixes and clean-ups Thomas Huth
2022-07-04 11:18 ` [PATCH v2 01/12] pc-bios/s390-ccw: Add a proper prototype for main() Thomas Huth
2022-07-04 11:18 ` [PATCH v2 02/12] pc-bios/s390-ccw/virtio: Introduce a macro for the DASD block size Thomas Huth
2022-07-04 11:47 ` Cornelia Huck
2022-07-04 11:18 ` [PATCH v2 03/12] pc-bios/s390-ccw/bootmap: Improve the guessing logic in zipl_load_vblk() Thomas Huth
2022-07-04 11:18 ` [PATCH v2 04/12] pc-bios/s390-ccw/virtio-blkdev: Simplify/fix virtio_ipl_disk_is_valid() Thomas Huth
2022-07-04 11:18 ` [PATCH v2 05/12] pc-bios/s390-ccw/virtio-blkdev: Remove virtio_assume_scsi() Thomas Huth
2022-07-04 11:18 ` [PATCH v2 06/12] pc-bios/s390-ccw/virtio: Set missing status bits while initializing Thomas Huth
2022-07-04 11:18 ` Thomas Huth [this message]
2022-07-04 11:18 ` [PATCH v2 08/12] pc-bios/s390-ccw/virtio: Beautify the code for reading virtqueue configuration Thomas Huth
2022-07-04 11:19 ` [PATCH v2 09/12] pc-bios/s390-ccw: Split virtio-scsi code from virtio_blk_setup_device() Thomas Huth
2022-07-04 11:19 ` [PATCH v2 10/12] pc-bios/s390-ccw/virtio-blkdev: Request the right feature bits Thomas Huth
2022-07-04 11:19 ` [PATCH v2 11/12] pc-bios/s390-ccw/virtio: Remove "extern" keyword from prototypes Thomas Huth
2022-07-04 11:19 ` [PATCH v2 12/12] pc-bios/s390-ccw/netboot.mak: Ignore Clang's warnings about GNU extensions Thomas Huth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220704111903.62400-8-thuth@redhat.com \
--to=thuth@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=farman@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).