public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qemu: fix pci_enable_capabilities to set the CAP feature in pci::status
@ 2009-04-20 15:20 Gregory Haskins
  2009-04-21 14:53 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Gregory Haskins @ 2009-04-20 15:20 UTC (permalink / raw)
  To: kvm; +Cc: Sheng Yang

(Applies to kvm-userspace.git:a1075de527f309850df278484f2ef4127827c6f4)

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 <ghaskins@novell.com>
CC: Sheng Yang <sheng@linux.intel.com>
---

 qemu/hw/pci.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

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)


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] qemu: fix pci_enable_capabilities to set the CAP feature in pci::status
  2009-04-20 15:20 [PATCH] qemu: fix pci_enable_capabilities to set the CAP feature in pci::status Gregory Haskins
@ 2009-04-21 14:53 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2009-04-21 14:53 UTC (permalink / raw)
  To: Gregory Haskins; +Cc: kvm, Sheng Yang

Gregory Haskins wrote:
> (Applies to kvm-userspace.git:a1075de527f309850df278484f2ef4127827c6f4)
>
> 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.
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-21 14:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 15:20 [PATCH] qemu: fix pci_enable_capabilities to set the CAP feature in pci::status Gregory Haskins
2009-04-21 14:53 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox