Skip to contentSkip to conversation

pc, virtio: fixes

GIT PULL Applied Michael S. Tsirkin 2 participants 5 messages Jul 2, 2018 – Jul 3, 2018

lore
Share & tools
lore
#0 lore raw

The following changes since commit 00928a421d47f49691cace1207481b7aad31b1f1:

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180626' into staging (2018-06-26 18:23:49 +0100)

are available in the Git repository at:

git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to 5d9c9ea22ab4f3b3ee497523e34b6f4d3281f62d:

virtio-rng: process pending requests on DRIVER_OK (2018-06-28 04:46:16 +0300)

----------------------------------------------------------------
pc, virtio: fixes

A couple of fixes to amd iommu, and a fix to virtio iommu.

----------------------------------------------------------------
Jan Kiszka (2):
hw/i386: Fix IVHD entry length for AMD IOMMU hw/i386: Fix AMDVI GATS and HATS encodings

Pankaj Gupta (1):
virtio-rng: process pending requests on DRIVER_OK

 hw/i386/amd_iommu.h    |  4 ++--
 hw/i386/acpi-build.c   |  2 +-
 hw/virtio/virtio-rng.c | 14 ++++++++++++++
 3 files changed, 17 insertions(+), 3 deletions(-)
#1 lore raw

[Qemu-devel] [PULL 1/3] hw/i386: Fix IVHD entry length for AMD IOMMU

From: Jan Kiszka <[email protected]>

Counting from the IVHD ID field to the all-devices entry, we have 28 bytes, not 36.

---
 hw/i386/acpi-build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/i386/acpi-build.c +1 -1
index 9bc6d97ea1..fff1059a31 100644
@@ -2537,7 +2537,7 @@ build_amd_iommu(GArray *table_data, BIOSLinker *linker)
                              (1UL << 7),  /* PPRSup       */
                              1);
     /* IVHD length */
-    build_append_int_noprefix(table_data, 0x24, 2);
+    build_append_int_noprefix(table_data, 28, 2);
     /* DeviceID */
     build_append_int_noprefix(table_data, s->devid, 2);
     /* Capability offset */
Signature · 1 line
MST
#2 lore raw

[Qemu-devel] [PULL 2/3] hw/i386: Fix AMDVI GATS and HATS encodings

In reply to Michael S. Tsirkin

From: Jan Kiszka <[email protected]>

We support up to 6 levels, but those are encoded as 10b according to the AMD IOMMU spec (chapter 3.3.1, Extended Feature Register).

---
 hw/i386/amd_iommu.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
hw/i386/amd_iommu.h +2 -2
index aeef802364..874030582d 100644
@@ -165,8 +165,8 @@
 #define AMDVI_DTE_UPPER_QUAD_RESERVED  0x08f0000000000000
 
 /* AMDVI paging mode */
-#define AMDVI_GATS_MODE                 (6ULL <<  12)
-#define AMDVI_HATS_MODE                 (6ULL <<  10)
+#define AMDVI_GATS_MODE                 (2ULL <<  12)
+#define AMDVI_HATS_MODE                 (2ULL <<  10)
 
 /* IOTLB */
 #define AMDVI_IOTLB_MAX_SIZE 1024
Signature · 1 line
MST
#3 lore raw

[Qemu-devel] [PULL 3/3] virtio-rng: process pending requests on DRIVER_OK

In reply to Michael S. Tsirkin

From: Pankaj Gupta <[email protected]>

virtio-rng device causes old guest kernels(2.6.32) to hang on latest qemu. The driver attempts to read from the virtio-rng device too early in it's initialization. Qemu detects guest is not ready and returns, resulting in hang.

To fix handle pending requests when guest is running and driver status is set to 'VIRTIO_CONFIG_S_DRIVER_OK'.

---
 hw/virtio/virtio-rng.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
hw/virtio/virtio-rng.c +14 -0
index 289bbcac03..855f1b41d1 100644
@@ -156,6 +156,19 @@ static void check_rate_limit(void *opaque)
     vrng->activate_timer = true;
 }
 
+static void virtio_rng_set_status(VirtIODevice *vdev, uint8_t status)
+{
+    VirtIORNG *vrng = VIRTIO_RNG(vdev);
+
+    if (!vdev->vm_running) {
+        return;
+    }
+    vdev->status = status;
+
+    /* Something changed, try to process buffers */
+    virtio_rng_process(vrng);
+}
+
 static void virtio_rng_device_realize(DeviceState *dev, Error **errp)
 {
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
@@ -261,6 +274,7 @@ static void virtio_rng_class_init(ObjectClass *klass, void *data)
     vdc->realize = virtio_rng_device_realize;
     vdc->unrealize = virtio_rng_device_unrealize;
     vdc->get_features = get_features;
+    vdc->set_status = virtio_rng_set_status;
 }
 
 static const TypeInfo virtio_rng_info = {
Signature · 1 line
MST
#4 lore raw
In reply to Michael S. Tsirkin
Quoted 10 lines · Michael S. Tsirkin

The following changes since commit 00928a421d47f49691cace1207481b7aad31b1f1:

Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180626' into staging (2018-06-26 18:23:49 +0100)

are available in the Git repository at:

git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to 5d9c9ea22ab4f3b3ee497523e34b6f4d3281f62d:

Quoted 9 lines

virtio-rng: process pending requests on DRIVER_OK (2018-06-28 04:46:16 +0300)

----------------------------------------------------------------
pc, virtio: fixes

A couple of fixes to amd iommu, and a fix to virtio iommu.

Applied, thanks.

-- PMM