Skip to content

Commit 5bb71fc

Browse files
LuBaolujoergroedel
authored andcommitted
iommu/vt-d: Check capability before disabling protected memory
The spec states in 10.4.16 that the Protected Memory Enable Register should be treated as read-only for implementations not supporting protected memory regions (PLMR and PHMR fields reported as Clear in the Capability register). Cc: Jacob Pan <jacob.jun.pan@linux.intel.com> Cc: mark gross <mgross@intel.com> Suggested-by: Ashok Raj <ashok.raj@intel.com> Fixes: f8bab73 ("intel-iommu: PMEN support") Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
1 parent 80ef446 commit 5bb71fc

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/iommu/intel-iommu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,9 @@ static void iommu_disable_protect_mem_regions(struct intel_iommu *iommu)
15381538
u32 pmen;
15391539
unsigned long flags;
15401540

1541+
if (!cap_plmr(iommu->cap) && !cap_phmr(iommu->cap))
1542+
return;
1543+
15411544
raw_spin_lock_irqsave(&iommu->register_lock, flags);
15421545
pmen = readl(iommu->reg + DMAR_PMEN_REG);
15431546
pmen &= ~DMA_PMEN_EPM;

0 commit comments

Comments
 (0)