mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-21 16:57:20 +00:00
HV: add DRHD index to pci_pdev
We add new member pci_pdev.drhd_idx associating the DRHD (IOMMU) with this pdev, and a method to convert a pbdf of a device to this index by searching the pdev list. Partial patch: drhd_index initialization handled in subsequent patch. Tracked-On: #4134 Signed-off-by: Alexander Merritt <alex.merritt@intel.com> Signed-off-by: Sainath Grandhi <sainath.grandhi@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
committed by
wenlingz
parent
0b7bcd6408
commit
ea131eea41
@@ -165,6 +165,9 @@ struct pci_msix_cap {
|
||||
};
|
||||
|
||||
struct pci_pdev {
|
||||
/* IOMMU responsible for DMA and Interrupt Remapping for this device */
|
||||
uint32_t drhd_index;
|
||||
|
||||
/* The bar info of the physical PCI device. */
|
||||
uint32_t nr_bars; /* 6 for normal device, 2 for bridge, 1 for cardbus */
|
||||
|
||||
@@ -236,6 +239,16 @@ void enable_disable_pci_intx(union pci_bdf bdf, bool enable);
|
||||
|
||||
void init_pci_pdev_list(void);
|
||||
|
||||
/* @brief: Find the DRHD index corresponding to a PCI device
|
||||
* Runs through the pci_pdev_array and returns the value in drhd_idx
|
||||
* member from pdev strucutre that matches matches B:D.F
|
||||
*
|
||||
* @pbdf[in] B:D.F of a PCI device
|
||||
*
|
||||
* @return if there is a matching pbdf in pci_pdev_array, pdev->drhd_idx, else -1U
|
||||
*/
|
||||
uint32_t pci_lookup_drhd_for_pbdf(uint16_t pbdf);
|
||||
|
||||
static inline bool is_pci_vendor_valid(uint32_t vendor_id)
|
||||
{
|
||||
return !((vendor_id == 0xFFFFFFFFU) || (vendor_id == 0U) ||
|
||||
|
Reference in New Issue
Block a user