Skip to content

Commit 00ecd54

Browse files
Fenghua Yujoergroedel
authored andcommitted
iommu/vt-d: Clean up unused PASID updating functions
update_pasid() and its call chain are currently unused in the tree because Thomas disabled the ENQCMD feature. The feature will be re-enabled shortly using a different approach and update_pasid() and its call chain will not be used in the new approach. Remove the useless functions. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Reviewed-by: Tony Luck <tony.luck@intel.com> Link: https://lore.kernel.org/r/20210920192349.2602141-1-fenghua.yu@intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20211014053839.727419-8-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 94f797a commit 00ecd54

2 files changed

Lines changed: 1 addition & 25 deletions

File tree

  • arch/x86/include/asm/fpu
  • drivers/iommu/intel

arch/x86/include/asm/fpu/api.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,4 @@ extern int cpu_has_xfeatures(u64 xfeatures_mask, const char **feature_name);
106106
*/
107107
#define PASID_DISABLED 0
108108

109-
static inline void update_pasid(void) { }
110-
111109
#endif /* _ASM_X86_FPU_API_H */

drivers/iommu/intel/svm.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -505,21 +505,6 @@ int intel_svm_unbind_gpasid(struct device *dev, u32 pasid)
505505
return ret;
506506
}
507507

508-
static void _load_pasid(void *unused)
509-
{
510-
update_pasid();
511-
}
512-
513-
static void load_pasid(struct mm_struct *mm, u32 pasid)
514-
{
515-
mutex_lock(&mm->context.lock);
516-
517-
/* Update PASID MSR on all CPUs running the mm's tasks. */
518-
on_each_cpu_mask(mm_cpumask(mm), _load_pasid, NULL, true);
519-
520-
mutex_unlock(&mm->context.lock);
521-
}
522-
523508
static int intel_svm_alloc_pasid(struct device *dev, struct mm_struct *mm,
524509
unsigned int flags)
525510
{
@@ -614,10 +599,6 @@ static struct iommu_sva *intel_svm_bind_mm(struct intel_iommu *iommu,
614599
if (ret)
615600
goto free_sdev;
616601

617-
/* The newly allocated pasid is loaded to the mm. */
618-
if (!(flags & SVM_FLAG_SUPERVISOR_MODE) && list_empty(&svm->devs))
619-
load_pasid(mm, svm->pasid);
620-
621602
list_add_rcu(&sdev->list, &svm->devs);
622603
success:
623604
return &sdev->sva;
@@ -670,11 +651,8 @@ static int intel_svm_unbind_mm(struct device *dev, u32 pasid)
670651
kfree_rcu(sdev, rcu);
671652

672653
if (list_empty(&svm->devs)) {
673-
if (svm->notifier.ops) {
654+
if (svm->notifier.ops)
674655
mmu_notifier_unregister(&svm->notifier, mm);
675-
/* Clear mm's pasid. */
676-
load_pasid(mm, PASID_DISABLED);
677-
}
678656
pasid_private_remove(svm->pasid);
679657
/* We mandate that no page faults may be outstanding
680658
* for the PASID when intel_svm_unbind_mm() is called.

0 commit comments

Comments
 (0)