Skip to content

Commit 113a031

Browse files
Jacob Panjoergroedel
authored andcommitted
iommu/vt-d: Remove PASID supervisor request support
There's no more usage, remove PASID supervisor support. Suggested-by: Lu Baolu <baolu.lu@linux.intel.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Link: https://lore.kernel.org/r/20230331231137.1947675-3-jacob.jun.pan@linux.intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent a7050fb commit 113a031

2 files changed

Lines changed: 0 additions & 50 deletions

File tree

drivers/iommu/intel/pasid.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,6 @@ static inline void pasid_set_fault_enable(struct pasid_entry *pe)
335335
pasid_set_bits(&pe->val[0], 1 << 1, 0);
336336
}
337337

338-
/*
339-
* Setup the SRE(Supervisor Request Enable) field (Bit 128) of a
340-
* scalable mode PASID entry.
341-
*/
342-
static inline void pasid_set_sre(struct pasid_entry *pe)
343-
{
344-
pasid_set_bits(&pe->val[2], 1 << 0, 1);
345-
}
346-
347338
/*
348339
* Setup the WPE(Write Protect Enable) field (Bit 132) of a
349340
* scalable mode PASID entry.
@@ -521,23 +512,6 @@ int intel_pasid_setup_first_level(struct intel_iommu *iommu,
521512
return -EINVAL;
522513
}
523514

524-
if (flags & PASID_FLAG_SUPERVISOR_MODE) {
525-
#ifdef CONFIG_X86
526-
unsigned long cr0 = read_cr0();
527-
528-
/* CR0.WP is normally set but just to be sure */
529-
if (unlikely(!(cr0 & X86_CR0_WP))) {
530-
pr_err("No CPU write protect!\n");
531-
return -EINVAL;
532-
}
533-
#endif
534-
if (!ecap_srs(iommu->ecap)) {
535-
pr_err("No supervisor request support on %s\n",
536-
iommu->name);
537-
return -EINVAL;
538-
}
539-
}
540-
541515
if ((flags & PASID_FLAG_FL5LP) && !cap_fl5lp_support(iommu->cap)) {
542516
pr_err("No 5-level paging support for first-level on %s\n",
543517
iommu->name);
@@ -560,10 +534,6 @@ int intel_pasid_setup_first_level(struct intel_iommu *iommu,
560534

561535
/* Setup the first level page table pointer: */
562536
pasid_set_flptr(pte, (u64)__pa(pgd));
563-
if (flags & PASID_FLAG_SUPERVISOR_MODE) {
564-
pasid_set_sre(pte);
565-
pasid_set_wpe(pte);
566-
}
567537

568538
if (flags & PASID_FLAG_FL5LP)
569539
pasid_set_flpm(pte, 1);
@@ -658,12 +628,6 @@ int intel_pasid_setup_second_level(struct intel_iommu *iommu,
658628
pasid_set_fault_enable(pte);
659629
pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
660630

661-
/*
662-
* Since it is a second level only translation setup, we should
663-
* set SRE bit as well (addresses are expected to be GPAs).
664-
*/
665-
if (pasid != PASID_RID2PASID && ecap_srs(iommu->ecap))
666-
pasid_set_sre(pte);
667631
pasid_set_present(pte);
668632
spin_unlock(&iommu->lock);
669633

@@ -700,13 +664,6 @@ int intel_pasid_setup_pass_through(struct intel_iommu *iommu,
700664
pasid_set_translation_type(pte, PASID_ENTRY_PGTT_PT);
701665
pasid_set_fault_enable(pte);
702666
pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
703-
704-
/*
705-
* We should set SRE bit as well since the addresses are expected
706-
* to be GPAs.
707-
*/
708-
if (ecap_srs(iommu->ecap))
709-
pasid_set_sre(pte);
710667
pasid_set_present(pte);
711668
spin_unlock(&iommu->lock);
712669

drivers/iommu/intel/pasid.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@
4141
#define FLPT_DEFAULT_DID 1
4242
#define NUM_RESERVED_DID 2
4343

44-
/*
45-
* The SUPERVISOR_MODE flag indicates a first level translation which
46-
* can be used for access to kernel addresses. It is valid only for
47-
* access to the kernel's static 1:1 mapping of physical memory — not
48-
* to vmalloc or even module mappings.
49-
*/
50-
#define PASID_FLAG_SUPERVISOR_MODE BIT(0)
5144
#define PASID_FLAG_NESTED BIT(1)
5245
#define PASID_FLAG_PAGE_SNOOP BIT(2)
5346

0 commit comments

Comments
 (0)