Re: [PATCH 1/2] pci-assign: Re-order initfn for memory API

2011-09-22 Thread Jan Kiszka
On 2011-09-22 05:12, Alex Williamson wrote:
> We now need to scan PCI capabilities and setup an MSI-X page
> before we walk the device resources since the overlay is now
> setup during init instead of at the first mapping by the guest.
> 
> Signed-off-by: Alex Williamson 
> ---
> 
>  hw/device-assignment.c |   16 
>  1 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/hw/device-assignment.c b/hw/device-assignment.c
> index 288f80c..93913b3 100644
> --- a/hw/device-assignment.c
> +++ b/hw/device-assignment.c
> @@ -1603,6 +1603,14 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
>  goto out;
>  }
>  
> +if (assigned_device_pci_cap_init(pci_dev) < 0)
> +goto out;
> +
> +/* intercept MSI-X entry page in the MMIO */
> +if (dev->cap.available & ASSIGNED_DEVICE_CAP_MSIX)
> +if (assigned_dev_register_msix_mmio(dev))
> +goto out;
> +

Please adjust the coding style at this chance.

Looks correct otherwise.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] pci-assign: Re-order initfn for memory API

2011-09-21 Thread Alex Williamson
We now need to scan PCI capabilities and setup an MSI-X page
before we walk the device resources since the overlay is now
setup during init instead of at the first mapping by the guest.

Signed-off-by: Alex Williamson 
---

 hw/device-assignment.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/hw/device-assignment.c b/hw/device-assignment.c
index 288f80c..93913b3 100644
--- a/hw/device-assignment.c
+++ b/hw/device-assignment.c
@@ -1603,6 +1603,14 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
 goto out;
 }
 
+if (assigned_device_pci_cap_init(pci_dev) < 0)
+goto out;
+
+/* intercept MSI-X entry page in the MMIO */
+if (dev->cap.available & ASSIGNED_DEVICE_CAP_MSIX)
+if (assigned_dev_register_msix_mmio(dev))
+goto out;
+
 /* handle real device's MMIO/PIO BARs */
 if (assigned_dev_register_regions(dev->real_device.regions,
   dev->real_device.region_number,
@@ -1618,9 +1626,6 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
 dev->h_busnr = dev->host.bus;
 dev->h_devfn = PCI_DEVFN(dev->host.dev, dev->host.func);
 
-if (assigned_device_pci_cap_init(pci_dev) < 0)
-goto out;
-
 /* assign device to guest */
 r = assign_device(dev);
 if (r < 0)
@@ -1631,11 +1636,6 @@ static int assigned_initfn(struct PCIDevice *pci_dev)
 if (r < 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))
-goto assigned_out;
-
 assigned_dev_load_option_rom(dev);
 QLIST_INSERT_HEAD(&devs, dev, next);
 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html