Skip to content

Commit ca6e322

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Pass pasid table to context mapping
So that the pasid related info, such as the pasid table and the maximum of pasid could be used during setting up scalable mode context. Cc: Ashok Raj <ashok.raj@intel.com> Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: Kevin Tian <kevin.tian@intel.com> Cc: Liu Yi L <yi.l.liu@intel.com> Cc: Sanjay Kumar <sanjay.k.kumar@intel.com> Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Ashok Raj <ashok.raj@intel.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent ef848b7 commit ca6e322

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ static void domain_exit(struct dmar_domain *domain)
19201920

19211921
static int domain_context_mapping_one(struct dmar_domain *domain,
19221922
struct intel_iommu *iommu,
1923+
struct pasid_table *table,
19231924
u8 bus, u8 devfn)
19241925
{
19251926
u16 did = domain->iommu_did[iommu->seq_id];
@@ -2042,6 +2043,7 @@ static int domain_context_mapping_one(struct dmar_domain *domain,
20422043
struct domain_context_mapping_data {
20432044
struct dmar_domain *domain;
20442045
struct intel_iommu *iommu;
2046+
struct pasid_table *table;
20452047
};
20462048

20472049
static int domain_context_mapping_cb(struct pci_dev *pdev,
@@ -2050,25 +2052,31 @@ static int domain_context_mapping_cb(struct pci_dev *pdev,
20502052
struct domain_context_mapping_data *data = opaque;
20512053

20522054
return domain_context_mapping_one(data->domain, data->iommu,
2053-
PCI_BUS_NUM(alias), alias & 0xff);
2055+
data->table, PCI_BUS_NUM(alias),
2056+
alias & 0xff);
20542057
}
20552058

20562059
static int
20572060
domain_context_mapping(struct dmar_domain *domain, struct device *dev)
20582061
{
2062+
struct domain_context_mapping_data data;
2063+
struct pasid_table *table;
20592064
struct intel_iommu *iommu;
20602065
u8 bus, devfn;
2061-
struct domain_context_mapping_data data;
20622066

20632067
iommu = device_to_iommu(dev, &bus, &devfn);
20642068
if (!iommu)
20652069
return -ENODEV;
20662070

2071+
table = intel_pasid_get_table(dev);
2072+
20672073
if (!dev_is_pci(dev))
2068-
return domain_context_mapping_one(domain, iommu, bus, devfn);
2074+
return domain_context_mapping_one(domain, iommu, table,
2075+
bus, devfn);
20692076

20702077
data.domain = domain;
20712078
data.iommu = iommu;
2079+
data.table = table;
20722080

20732081
return pci_for_each_dma_alias(to_pci_dev(dev),
20742082
&domain_context_mapping_cb, &data);

0 commit comments

Comments
 (0)