[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1565469607.357977088@decadent.org.uk>
Date: Sat, 10 Aug 2019 21:40:07 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Ashok Raj" <ashok.raj@...el.com>,
"Joerg Roedel" <jroedel@...e.de>, "mark gross" <mgross@...el.com>,
"Lu Baolu" <baolu.lu@...ux.intel.com>,
"Jacob Pan" <jacob.jun.pan@...ux.intel.com>
Subject: [PATCH 3.16 038/157] iommu/vt-d: Check capability before
disabling protected memory
3.16.72-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Lu Baolu <baolu.lu@...ux.intel.com>
commit 5bb71fc790a88d063507dc5d445ab8b14e845591 upstream.
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@...ux.intel.com>
Cc: mark gross <mgross@...el.com>
Suggested-by: Ashok Raj <ashok.raj@...el.com>
Fixes: f8bab73515ca5 ("intel-iommu: PMEN support")
Signed-off-by: Lu Baolu <baolu.lu@...ux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@...e.de>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/iommu/intel-iommu.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -1394,6 +1394,9 @@ static void iommu_disable_protect_mem_re
u32 pmen;
unsigned long flags;
+ if (!cap_plmr(iommu->cap) && !cap_phmr(iommu->cap))
+ return;
+
raw_spin_lock_irqsave(&iommu->register_lock, flags);
pmen = readl(iommu->reg + DMAR_PMEN_REG);
pmen &= ~DMA_PMEN_EPM;
Powered by blists - more mailing lists