From 84474e4f393700bbe26b2618d50b295afc1ef5ad Mon Sep 17 00:00:00 2001 From: Gregory Haskins Date: Mon, 20 Apr 2009 11:20:57 -0400 Subject: [PATCH] kvm: qemu: fix pci_enable_capabilities to set the CAP feature in pci::status 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 CC: Sheng Yang Signed-off-by: Avi Kivity --- qemu/hw/pci.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index bf97c8cd..5bfc4df0 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) -- 2.11.4.GIT