From: Gregory Haskins <[email protected]>

The PCI spec requires bit 4 of the config-space STATUS register to be set
in order to indicate that the capabilities pointer and capabilities area are
valid.  We have a pci_enable_capabilities() routine to fill out the
config-space metadata, but we leave the status bit cleared. It is not
apparent if this was intentionally omitted as part of the related
device-assignment support, or simply an oversight.  This patch completes
the function by also setting the status bit appropriately.

Signed-off-by: Gregory Haskins <[email protected]>
CC: Sheng Yang <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>

diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c
index bf97c8c..5bfc4df 100644
--- a/qemu/hw/pci.c
+++ b/qemu/hw/pci.c
@@ -1009,6 +1009,8 @@ int pci_enable_capability_support(PCIDevice *pci_dev,
     if (!pci_dev)
         return -ENODEV;
 
+    pci_dev->config[0x06] |= 0x10; // status = capabilities
+
     if (config_start == 0)
        pci_dev->cap.start = PCI_CAPABILITY_CONFIG_DEFAULT_START_ADDR;
     else if (config_start >= 0x40 && config_start < 0xff)
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to