* [PATCH] kvm: Move device capability init earlier
@ 2009-03-19 7:02 Sheng Yang
2009-03-19 9:40 ` Avi Kivity
0 siblings, 1 reply; 2+ messages in thread
From: Sheng Yang @ 2009-03-19 7:02 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm, Sheng Yang
For if assign_irq() is called before capability init, it don't know device
support MSI or not for the first time calling. So it won't enable MSI2INTx...
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
qemu/hw/device-assignment.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c
index 2ee0e47..b7f9fa6 100644
--- a/qemu/hw/device-assignment.c
+++ b/qemu/hw/device-assignment.c
@@ -1149,6 +1149,11 @@ struct PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus)
pci_init(pacc);
dev->pdev = pci_get_dev(pacc, 0, adev->bus, adev->dev, adev->func);
+ if (pci_enable_capability_support(pci_dev, 0, NULL,
+ assigned_device_pci_cap_write_config,
+ assigned_device_pci_cap_init) < 0)
+ goto assigned_out;
+
/* assign device to guest */
r = assign_device(adev);
if (r < 0)
@@ -1159,11 +1164,6 @@ struct PCIDevice *init_assigned_device(AssignedDevInfo *adev, PCIBus *bus)
if (r < 0)
goto assigned_out;
- if (pci_enable_capability_support(pci_dev, 0, NULL,
- assigned_device_pci_cap_write_config,
- assigned_device_pci_cap_init) < 0)
- goto assigned_out;
-
/* intercept MSI-X entry page in the MMIO */
if (dev->cap.available & ASSIGNED_DEVICE_CAP_MSIX)
if (assigned_dev_register_msix_mmio(dev))
--
1.5.4.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] kvm: Move device capability init earlier
2009-03-19 7:02 [PATCH] kvm: Move device capability init earlier Sheng Yang
@ 2009-03-19 9:40 ` Avi Kivity
0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2009-03-19 9:40 UTC (permalink / raw)
To: Sheng Yang; +Cc: kvm
Sheng Yang wrote:
> For if assign_irq() is called before capability init, it don't know device
> support MSI or not for the first time calling. So it won't enable MSI2INTx...
>
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-03-19 9:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-19 7:02 [PATCH] kvm: Move device capability init earlier Sheng Yang
2009-03-19 9:40 ` Avi Kivity
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.