Skip to contentSkip to conversation

virtio-pci: fix bus master bug setting on load

PATCH Applied Alex Williamson 6 participants 6 messages Jun 17, 2010 – Jun 23, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 virtio-pci: fix bus master bug setting on load

The comment suggests we're checking for the driver in the ready state and bus master disabled, but the code is checking that it's not in the ready state.

---

 hw/virtio-pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/virtio-pci.c +1 -1
index e101fa0..7a86a81 100644
@@ -155,7 +155,7 @@ static int virtio_pci_load_config(void * opaque, QEMUFile *f)
 
     /* Try to find out if the guest has bus master disabled, but is
        in ready state. Then we have a buggy guest OS. */
-    if (!(proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) &&
+    if ((proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) &&
         !(proxy->pci_dev.config[PCI_COMMAND] & PCI_COMMAND_MASTER)) {
         proxy->bugs |= VIRTIO_PCI_BUG_BUS_MASTER;
     }
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Alex Williamson

The comment suggests we're checking for the driver in the ready state and bus master disabled, but the code is checking that it's not in the ready state.

Quoted 18 lines

---

 hw/virtio-pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/virtio-pci.c +1 -1
index e101fa0..7a86a81 100644
@@ -155,7 +155,7 @@ static int virtio_pci_load_config(void * opaque, QEMUFile *f)
 
     /* Try to find out if the guest has bus master disabled, but is
        in ready state. Then we have a buggy guest OS. */
-    if (!(proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) &&
+    if ((proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) &&
         !(proxy->pci_dev.config[PCI_COMMAND] & PCI_COMMAND_MASTER)) {
         proxy->bugs |= VIRTIO_PCI_BUG_BUS_MASTER;
     }
Acked-by on v1 1/1
#3 lore raw
In reply to Alex Williamson
Quoted 16 lines · Alex Williamson

The comment suggests we're checking for the driver in the ready state and bus master disabled, but the code is checking that it's not in the ready state.

---

 hw/virtio-pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/virtio-pci.c +0 -0
index e101fa0..7a86a81 100644

hw/virtio-pci.c static int virtio_pci_load_config(void * opaque, QEMUFile *f) · line 159

Quoted 6 lines
hw/virtio-pci.c +1 -1
@@ -155,7 +155,7 @@ static int virtio_pci_load_config(void * opaque, QEMUFile *f)
 
     /* Try to find out if the guest has bus master disabled, but is
        in ready state. Then we have a buggy guest OS. */
-    if (!(proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) &&
+    if ((proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) &&
 

Phew - that's an evil one. Thanks for the catch!

Alex

Acked-by on v1 1/1
#4 lore raw
In reply to Alex Williamson
Quoted 6 lines · Alex Williamson

The comment suggests we're checking for the driver in the ready state and bus master disabled, but the code is checking that it's not in the ready state.

Quoted 18 lines

---

 hw/virtio-pci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/virtio-pci.c +1 -1
index e101fa0..7a86a81 100644
@@ -155,7 +155,7 @@ static int virtio_pci_load_config(void * opaque, QEMUFile *f)
 
     /* Try to find out if the guest has bus master disabled, but is
        in ready state. Then we have a buggy guest OS. */
-    if (!(proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) &&
+    if ((proxy->vdev->status & VIRTIO_CONFIG_S_DRIVER_OK) &&
         !(proxy->pci_dev.config[PCI_COMMAND] & PCI_COMMAND_MASTER)) {
         proxy->bugs |= VIRTIO_PCI_BUG_BUS_MASTER;
     }
#5 lore raw
In reply to Alex Williamson
Quoted 7 lines · Alex Williamson

The comment suggests we're checking for the driver in the ready state and bus master disabled, but the code is checking that it's not in the ready state.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 22 lines

---

  hw/virtio-pci.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
hw/virtio-pci.c +1 -1
index e101fa0..7a86a81 100644
@@ -155,7 +155,7 @@ static int virtio_pci_load_config(void * opaque, QEMUFile *f)
 
      /* Try to find out if the guest has bus master disabled, but is
         in ready state. Then we have a buggy guest OS. */
-    if (!(proxy->vdev->status&  VIRTIO_CONFIG_S_DRIVER_OK)&&
+    if ((proxy->vdev->status&  VIRTIO_CONFIG_S_DRIVER_OK)&&
          !(proxy->pci_dev.config[PCI_COMMAND]&  PCI_COMMAND_MASTER)) {
          proxy->bugs |= VIRTIO_PCI_BUG_BUS_MASTER;
      }