[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 12/15] pci: Use pci_sbdf_t pci_check_disable_device()



No functional change intended.

Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
 xen/drivers/passthrough/amd/iommu_init.c | 3 +--
 xen/drivers/passthrough/pci.c            | 4 ++--
 xen/drivers/passthrough/vtd/iommu.c      | 3 +--
 xen/include/xen/pci.h                    | 2 +-
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/drivers/passthrough/amd/iommu_init.c 
b/xen/drivers/passthrough/amd/iommu_init.c
index e0c8925c33..c2d7201747 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -575,8 +575,7 @@ static void cf_check parse_event_log_entry(struct amd_iommu 
*iommu, u32 entry[])
 
         for ( bdf = 0; bdf < ivrs_bdf_entries; bdf++ )
             if ( get_dma_requestor_id(iommu->sbdf.seg, bdf) == device_id )
-                pci_check_disable_device(iommu->sbdf.seg, PCI_BUS(bdf),
-                                         PCI_DEVFN(bdf));
+                pci_check_disable_device(PCI_SBDF(iommu->sbdf.seg, bdf));
     }
     else
         printk(XENLOG_ERR "%s %08x %08x %08x %08x\n",
diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c
index 17a4931229..41ba47ab1d 100644
--- a/xen/drivers/passthrough/pci.c
+++ b/xen/drivers/passthrough/pci.c
@@ -1174,14 +1174,14 @@ bool __init pci_device_detect(pci_sbdf_t sbdf)
     return 1;
 }
 
-void pci_check_disable_device(u16 seg, u8 bus, u8 devfn)
+void pci_check_disable_device(pci_sbdf_t sbdf)
 {
     struct pci_dev *pdev;
     s_time_t now = NOW();
     u16 cword;
 
     pcidevs_lock();
-    pdev = pci_get_real_pdev(PCI_SBDF(seg, bus, devfn));
+    pdev = pci_get_real_pdev(sbdf);
     if ( pdev )
     {
         if ( now < pdev->fault.time ||
diff --git a/xen/drivers/passthrough/vtd/iommu.c 
b/xen/drivers/passthrough/vtd/iommu.c
index 3d6f787b3c..ee848a6d7e 100644
--- a/xen/drivers/passthrough/vtd/iommu.c
+++ b/xen/drivers/passthrough/vtd/iommu.c
@@ -1072,8 +1072,7 @@ static void __do_iommu_page_fault(struct vtd_iommu *iommu)
         iommu_page_fault_do_one(iommu, type, fault_reason,
                                 source_id, guest_addr);
 
-        pci_check_disable_device(iommu->drhd->segment,
-                                 PCI_BUS(source_id), PCI_DEVFN(source_id));
+        pci_check_disable_device(PCI_SBDF(iommu->drhd->segment, source_id));
 
         fault_index++;
         if ( fault_index > cap_num_fault_regs(iommu->cap) )
diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h
index c065b2cd5c..6b8fcd88dd 100644
--- a/xen/include/xen/pci.h
+++ b/xen/include/xen/pci.h
@@ -235,7 +235,7 @@ int pci_ro_device(pci_sbdf_t sbdf);
 int pci_hide_device(pci_sbdf_t sbdf);
 struct pci_dev *pci_get_pdev(const struct domain *d, pci_sbdf_t sbdf);
 struct pci_dev *pci_get_real_pdev(pci_sbdf_t sbdf);
-void pci_check_disable_device(u16 seg, u8 bus, u8 devfn);
+void pci_check_disable_device(pci_sbdf_t sbdf);
 
 /*
  * Iterate without locking or preemption over all PCI devices known by Xen.
-- 
2.54.0



--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.