Skip to content

Commit e995fcd

Browse files
LuBaoluwilldeacon
authored andcommitted
iommu/vt-d: Remove control over Execute-Requested requests
The VT-d specification has removed architectural support of the requests with pasid with a value of 1 for Execute-Requested (ER). And the NXE bit in the pasid table entry and XD bit in the first-stage paging Entries are deprecated accordingly. Remove the programming of these bits to make it consistent with the spec. Suggested-by: Jacob Pan <[email protected]> Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 5fbf973 commit e995fcd

File tree

4 files changed

+4
-17
lines changed

4 files changed

+4
-17
lines changed

drivers/iommu/intel/iommu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ static struct dma_pte *pfn_to_dma_pte(struct dmar_domain *domain,
854854
domain_flush_cache(domain, tmp_page, VTD_PAGE_SIZE);
855855
pteval = ((uint64_t)virt_to_dma_pfn(tmp_page) << VTD_PAGE_SHIFT) | DMA_PTE_READ | DMA_PTE_WRITE;
856856
if (domain->use_first_level)
857-
pteval |= DMA_FL_PTE_XD | DMA_FL_PTE_US | DMA_FL_PTE_ACCESS;
857+
pteval |= DMA_FL_PTE_US | DMA_FL_PTE_ACCESS;
858858

859859
tmp = 0ULL;
860860
if (!try_cmpxchg64(&pte->val, &tmp, pteval))
@@ -1872,7 +1872,7 @@ __domain_mapping(struct dmar_domain *domain, unsigned long iov_pfn,
18721872
attr = prot & (DMA_PTE_READ | DMA_PTE_WRITE | DMA_PTE_SNP);
18731873
attr |= DMA_FL_PTE_PRESENT;
18741874
if (domain->use_first_level) {
1875-
attr |= DMA_FL_PTE_XD | DMA_FL_PTE_US | DMA_FL_PTE_ACCESS;
1875+
attr |= DMA_FL_PTE_US | DMA_FL_PTE_ACCESS;
18761876
if (prot & DMA_PTE_WRITE)
18771877
attr |= DMA_FL_PTE_DIRTY;
18781878
}

drivers/iommu/intel/iommu.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
#define DMA_FL_PTE_US BIT_ULL(2)
5050
#define DMA_FL_PTE_ACCESS BIT_ULL(5)
5151
#define DMA_FL_PTE_DIRTY BIT_ULL(6)
52-
#define DMA_FL_PTE_XD BIT_ULL(63)
5352

5453
#define DMA_SL_PTE_DIRTY_BIT 9
5554
#define DMA_SL_PTE_DIRTY BIT_ULL(DMA_SL_PTE_DIRTY_BIT)
@@ -831,11 +830,10 @@ static inline void dma_clear_pte(struct dma_pte *pte)
831830
static inline u64 dma_pte_addr(struct dma_pte *pte)
832831
{
833832
#ifdef CONFIG_64BIT
834-
return pte->val & VTD_PAGE_MASK & (~DMA_FL_PTE_XD);
833+
return pte->val & VTD_PAGE_MASK;
835834
#else
836835
/* Must have a full atomic 64-bit read */
837-
return __cmpxchg64(&pte->val, 0ULL, 0ULL) &
838-
VTD_PAGE_MASK & (~DMA_FL_PTE_XD);
836+
return __cmpxchg64(&pte->val, 0ULL, 0ULL) & VTD_PAGE_MASK;
839837
#endif
840838
}
841839

drivers/iommu/intel/pasid.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,6 @@ int intel_pasid_setup_first_level(struct intel_iommu *iommu,
336336
pasid_set_domain_id(pte, did);
337337
pasid_set_address_width(pte, iommu->agaw);
338338
pasid_set_page_snoop(pte, !!ecap_smpwc(iommu->ecap));
339-
pasid_set_nxe(pte);
340339

341340
/* Setup Present and PASID Granular Transfer Type: */
342341
pasid_set_translation_type(pte, PASID_ENTRY_PGTT_FL_ONLY);

drivers/iommu/intel/pasid.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,6 @@ static inline void pasid_set_page_snoop(struct pasid_entry *pe, bool value)
247247
pasid_set_bits(&pe->val[1], 1 << 23, value << 23);
248248
}
249249

250-
/*
251-
* Setup No Execute Enable bit (Bit 133) of a scalable mode PASID
252-
* entry. It is required when XD bit of the first level page table
253-
* entry is about to be set.
254-
*/
255-
static inline void pasid_set_nxe(struct pasid_entry *pe)
256-
{
257-
pasid_set_bits(&pe->val[2], 1 << 5, 1 << 5);
258-
}
259-
260250
/*
261251
* Setup the Page Snoop (PGSNP) field (Bit 88) of a scalable mode
262252
* PASID entry.

0 commit comments

Comments
 (0)