fbb94cc706
- kvm-virtio-iommu-Add-bypass-mode-support-to-assigned-dev.patch [bz#2100106] - kvm-virtio-iommu-Use-recursive-lock-to-avoid-deadlock.patch [bz#2100106] - kvm-virtio-iommu-Add-an-assert-check-in-translate-routin.patch [bz#2100106] - kvm-virtio-iommu-Fix-the-partial-copy-of-probe-request.patch [bz#2100106] - kvm-virtio-iommu-Fix-migration-regression.patch [bz#2100106] - kvm-pc-bios-s390-ccw-virtio-Introduce-a-macro-for-the-DA.patch [bz#2098077] - kvm-pc-bios-s390-ccw-bootmap-Improve-the-guessing-logic-.patch [bz#2098077] - kvm-pc-bios-s390-ccw-virtio-blkdev-Simplify-fix-virtio_i.patch [bz#2098077] - kvm-pc-bios-s390-ccw-virtio-blkdev-Remove-virtio_assume_.patch [bz#2098077] - kvm-pc-bios-s390-ccw-virtio-Set-missing-status-bits-whil.patch [bz#2098077] - kvm-pc-bios-s390-ccw-virtio-Read-device-config-after-fea.patch [bz#2098077] - kvm-pc-bios-s390-ccw-virtio-Beautify-the-code-for-readin.patch [bz#2098077] - kvm-pc-bios-s390-ccw-Split-virtio-scsi-code-from-virtio_.patch [bz#2098077] - kvm-pc-bios-s390-ccw-virtio-blkdev-Request-the-right-fea.patch [bz#2098077] - kvm-pc-bios-s390-ccw-netboot.mak-Ignore-Clang-s-warnings.patch [bz#2098077] - kvm-hw-block-fdc-Prevent-end-of-track-overrun-CVE-2021-3.patch [bz#1951522] - kvm-tests-qtest-fdc-test-Add-a-regression-test-for-CVE-2.patch [bz#1951522] - Resolves: bz#2100106 (Fix virtio-iommu/vfio bypass) - Resolves: bz#2098077 (virtio-blk: Can't boot fresh installation from used virtio-blk dasd disk under certain conditions) - Resolves: bz#1951522 (CVE-2021-3507 qemu-kvm: QEMU: fdc: heap buffer overflow in DMA read data transfers [rhel-9.0])
94 lines
3.6 KiB
Diff
94 lines
3.6 KiB
Diff
From 303fb3ddcdbbd1373c5b1aa28e03f90507e217f3 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Huth <thuth@redhat.com>
|
|
Date: Fri, 8 Jul 2022 20:49:01 +0200
|
|
Subject: [PATCH 10/17] pc-bios/s390-ccw/virtio: Set missing status bits while
|
|
initializing
|
|
|
|
RH-Author: Thomas Huth <thuth@redhat.com>
|
|
RH-MergeRequest: 106: pc-bios/s390-ccw: Fix boot from disks with 4k sectors that do not have the typical DASD geometry
|
|
RH-Commit: [5/10] 4bc44d9adae055fb60b79d04a2f08535b4d38d2b (thuth/qemu-kvm-cs9)
|
|
RH-Bugzilla: 2098077
|
|
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
RH-Acked-by: David Hildenbrand <david@redhat.com>
|
|
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
|
|
|
|
Bugzilla: http://bugzilla.redhat.com/2098077
|
|
|
|
commit 175aa06a152ef6b58ba9b2e47a1296b024dea70c
|
|
Author: Thomas Huth <thuth@redhat.com>
|
|
Date: Mon Jul 4 13:18:57 2022 +0200
|
|
|
|
pc-bios/s390-ccw/virtio: Set missing status bits while initializing
|
|
|
|
According chapter "3.1.1 Driver Requirements: Device Initialization"
|
|
of the Virtio specification (v1.1), a driver for a device has to set
|
|
the ACKNOWLEDGE and DRIVER bits in the status field after resetting
|
|
the device. The s390-ccw bios skipped these steps so far and seems
|
|
like QEMU never cared. Anyway, it's better to follow the spec, so
|
|
let's set these bits now in the right spots, too.
|
|
|
|
Message-Id: <20220704111903.62400-7-thuth@redhat.com>
|
|
Acked-by: Christian Borntraeger <borntraeger@linux.ibm.com>
|
|
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
|
|
Reviewed-by: Eric Farman <farman@linux.ibm.com>
|
|
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
|
|
|
Signed-off-by: Thomas Huth <thuth@redhat.com>
|
|
---
|
|
pc-bios/s390-ccw/virtio.c | 18 ++++++++++++++----
|
|
1 file changed, 14 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
|
|
index 5d2c6e3381..4e85a2eb82 100644
|
|
--- a/pc-bios/s390-ccw/virtio.c
|
|
+++ b/pc-bios/s390-ccw/virtio.c
|
|
@@ -220,7 +220,7 @@ int virtio_run(VDev *vdev, int vqid, VirtioCmd *cmd)
|
|
void virtio_setup_ccw(VDev *vdev)
|
|
{
|
|
int i, rc, cfg_size = 0;
|
|
- unsigned char status = VIRTIO_CONFIG_S_DRIVER_OK;
|
|
+ uint8_t status;
|
|
struct VirtioFeatureDesc {
|
|
uint32_t features;
|
|
uint8_t index;
|
|
@@ -234,6 +234,10 @@ void virtio_setup_ccw(VDev *vdev)
|
|
|
|
run_ccw(vdev, CCW_CMD_VDEV_RESET, NULL, 0, false);
|
|
|
|
+ status = VIRTIO_CONFIG_S_ACKNOWLEDGE;
|
|
+ rc = run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false);
|
|
+ IPL_assert(rc == 0, "Could not write ACKNOWLEDGE status to host");
|
|
+
|
|
switch (vdev->senseid.cu_model) {
|
|
case VIRTIO_ID_NET:
|
|
vdev->nr_vqs = 2;
|
|
@@ -253,6 +257,11 @@ void virtio_setup_ccw(VDev *vdev)
|
|
default:
|
|
panic("Unsupported virtio device\n");
|
|
}
|
|
+
|
|
+ status |= VIRTIO_CONFIG_S_DRIVER;
|
|
+ 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");
|
|
@@ -291,9 +300,10 @@ void virtio_setup_ccw(VDev *vdev)
|
|
run_ccw(vdev, CCW_CMD_SET_VQ, &info, sizeof(info), false) == 0,
|
|
"Cannot set VQ info");
|
|
}
|
|
- IPL_assert(
|
|
- run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false) == 0,
|
|
- "Could not write status to host");
|
|
+
|
|
+ status |= VIRTIO_CONFIG_S_DRIVER_OK;
|
|
+ rc = run_ccw(vdev, CCW_CMD_WRITE_STATUS, &status, sizeof(status), false);
|
|
+ IPL_assert(rc == 0, "Could not write DRIVER_OK status to host");
|
|
}
|
|
|
|
bool virtio_is_supported(SubChannelId schid)
|
|
--
|
|
2.31.1
|
|
|