Hi Christoph,
On 2/14/22 3:38 PM, Christoph Hellwig wrote:
const struct iommu_ops intel_iommu_ops;
@@ -903,7 +905,8 @@ static void pgtable_walk(struct intel_iommu *iommu,
unsigned long pfn, u8 bus, u
struct dmar_domain *domain;
int offset, level;
- info =
Hi Jason,
On 2/14/22 10:00 PM, Jason Gunthorpe wrote:
+
+/* Convert device source ID into the index of device_domain_array. */
+static inline unsigned long devi_idx(unsigned long seg, u8 bus, u8 devfn)
+{
+ return (seg << 16) | PCI_DEVID(bus, devfn);
+}
/*
- * Iterate over elements
On Mon, Feb 14, 2022 at 10:57:03AM +0800, Lu Baolu wrote:
> Replace the existing global device_domain_list with an array so that it
> could be rapidly searched. The index of the array is composed by the PCI
> segment, bus and devfn. Use RCU for lock protection.
>
> Signed-off-by: Lu Baolu
>
>
> const struct iommu_ops intel_iommu_ops;
> @@ -903,7 +905,8 @@ static void pgtable_walk(struct intel_iommu *iommu,
> unsigned long pfn, u8 bus, u
> struct dmar_domain *domain;
> int offset, level;
>
> - info = dmar_search_domain_by_dev_info(iommu->segment, bus, devfn);
> +
Replace the existing global device_domain_list with an array so that it
could be rapidly searched. The index of the array is composed by the PCI
segment, bus and devfn. Use RCU for lock protection.
Signed-off-by: Lu Baolu
---
include/linux/intel-iommu.h | 1 -
drivers/iommu/intel/iommu.c | 72