Skip to content

Commit cfb31f1

Browse files
yiliu1765joergroedel
authored andcommitted
iommu/vt-d: Make intel_svm_set_dev_pasid() support domain replacement
Make intel_svm_set_dev_pasid() support replacement. Signed-off-by: Yi Liu <yi.l.liu@intel.com> Link: https://lore.kernel.org/r/20241107122234.7424-10-yi.l.liu@intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent c33e208 commit cfb31f1

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,10 +1752,10 @@ static void domain_context_clear_one(struct device_domain_info *info, u8 bus, u8
17521752
intel_context_flush_present(info, context, did, true);
17531753
}
17541754

1755-
static int __domain_setup_first_level(struct intel_iommu *iommu,
1756-
struct device *dev, ioasid_t pasid,
1757-
u16 did, pgd_t *pgd, int flags,
1758-
struct iommu_domain *old)
1755+
int __domain_setup_first_level(struct intel_iommu *iommu,
1756+
struct device *dev, ioasid_t pasid,
1757+
u16 did, pgd_t *pgd, int flags,
1758+
struct iommu_domain *old)
17591759
{
17601760
if (!old)
17611761
return intel_pasid_setup_first_level(iommu, dev, pgd,

drivers/iommu/intel/iommu.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,6 +1250,11 @@ domain_add_dev_pasid(struct iommu_domain *domain,
12501250
void domain_remove_dev_pasid(struct iommu_domain *domain,
12511251
struct device *dev, ioasid_t pasid);
12521252

1253+
int __domain_setup_first_level(struct intel_iommu *iommu,
1254+
struct device *dev, ioasid_t pasid,
1255+
u16 did, pgd_t *pgd, int flags,
1256+
struct iommu_domain *old);
1257+
12531258
int dmar_ir_support(void);
12541259

12551260
void iommu_flush_write_buffer(struct intel_iommu *iommu);

drivers/iommu/intel/svm.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,9 @@ static int intel_svm_set_dev_pasid(struct iommu_domain *domain,
127127

128128
/* Setup the pasid table: */
129129
sflags = cpu_feature_enabled(X86_FEATURE_LA57) ? PASID_FLAG_FL5LP : 0;
130-
ret = intel_pasid_setup_first_level(iommu, dev, mm->pgd, pasid,
131-
FLPT_DEFAULT_DID, sflags);
130+
ret = __domain_setup_first_level(iommu, dev, pasid,
131+
FLPT_DEFAULT_DID, mm->pgd,
132+
sflags, old);
132133
if (ret)
133134
goto out_remove_dev_pasid;
134135

0 commit comments

Comments
 (0)