Commit 34067c56 authored by Jon Derrick's avatar Jon Derrick Committed by Bjorn Helgaas

x86/PCI: Expose VMD's pci_dev in struct pci_sysdata

Expose VMD's pci_dev pointer in struct pci_sysdata.  This will be used
indirectly by intel-iommu.c to find the correct domain.

Link: https://lore.kernel.org/r/1579613871-301529-3-git-send-email-jonathan.derrick@intel.com
[bhelgaas: commit log]
Signed-off-by: default avatarJon Derrick <jonathan.derrick@intel.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Cc: Christoph Hellwig <hch@lst.de>
parent aad6aa0c
...@@ -25,7 +25,7 @@ struct pci_sysdata { ...@@ -25,7 +25,7 @@ struct pci_sysdata {
void *fwnode; /* IRQ domain for MSI assignment */ void *fwnode; /* IRQ domain for MSI assignment */
#endif #endif
#if IS_ENABLED(CONFIG_VMD) #if IS_ENABLED(CONFIG_VMD)
bool vmd_domain; /* True if in Intel VMD domain */ struct pci_dev *vmd_dev; /* VMD Device if in Intel VMD domain */
#endif #endif
}; };
...@@ -64,7 +64,7 @@ static inline void *_pci_root_bus_fwnode(struct pci_bus *bus) ...@@ -64,7 +64,7 @@ static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
#if IS_ENABLED(CONFIG_VMD) #if IS_ENABLED(CONFIG_VMD)
static inline bool is_vmd(struct pci_bus *bus) static inline bool is_vmd(struct pci_bus *bus)
{ {
return to_pci_sysdata(bus)->vmd_domain; return to_pci_sysdata(bus)->vmd_dev != NULL;
} }
#else #else
#define is_vmd(bus) false #define is_vmd(bus) false
......
...@@ -679,7 +679,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features) ...@@ -679,7 +679,7 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
.parent = res, .parent = res,
}; };
sd->vmd_domain = true; sd->vmd_dev = vmd->dev;
sd->domain = vmd_find_free_domain(); sd->domain = vmd_find_free_domain();
if (sd->domain < 0) if (sd->domain < 0)
return sd->domain; return sd->domain;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment