Re: [patch V3 02/35] x86/pci/XEN: Use PCI device property

2021-12-13 Thread Jason Gunthorpe
On Fri, Dec 10, 2021 at 11:18:46PM +0100, Thomas Gleixner wrote:
> From: Thomas Gleixner 
> 
> instead of fiddling with MSI descriptors.
> 
> Signed-off-by: Thomas Gleixner 
> Cc: Juergen Gross 
> Cc: xen-devel@lists.xenproject.org
> ---
> V3: Use pci_dev->msix_enabled.
> ---
>  arch/x86/pci/xen.c |9 ++---
>  1 file changed, 2 insertions(+), 7 deletions(-)

Reviewed-by: Jason Gunthorpe 

Jason



[patch V3 02/35] x86/pci/XEN: Use PCI device property

2021-12-10 Thread Thomas Gleixner
From: Thomas Gleixner 

instead of fiddling with MSI descriptors.

Signed-off-by: Thomas Gleixner 
Cc: Juergen Gross 
Cc: xen-devel@lists.xenproject.org
---
V3: Use pci_dev->msix_enabled.
---
 arch/x86/pci/xen.c |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

--- a/arch/x86/pci/xen.c
+++ b/arch/x86/pci/xen.c
@@ -399,9 +399,7 @@ static void xen_teardown_msi_irqs(struct
 
 static void xen_pv_teardown_msi_irqs(struct pci_dev *dev)
 {
-   struct msi_desc *msidesc = first_pci_msi_entry(dev);
-
-   if (msidesc->pci.msi_attrib.is_msix)
+   if (dev->msix_enabled)
xen_pci_frontend_disable_msix(dev);
else
xen_pci_frontend_disable_msi(dev);
@@ -417,10 +415,7 @@ static int xen_msi_domain_alloc_irqs(str
if (WARN_ON_ONCE(!dev_is_pci(dev)))
return -EINVAL;
 
-   if (first_msi_entry(dev)->pci.msi_attrib.is_msix)
-   type = PCI_CAP_ID_MSIX;
-   else
-   type = PCI_CAP_ID_MSI;
+   type = to_pci_dev(dev)->msix_enabled ? PCI_CAP_ID_MSIX : PCI_CAP_ID_MSI;
 
return xen_msi_ops.setup_msi_irqs(to_pci_dev(dev), nvec, type);
 }