iommu/vt-d: Check capability before disabling protected memory
authorLu Baolu <baolu.lu@linux.intel.com>
Wed, 20 Mar 2019 01:58:33 +0000 (09:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 20 Apr 2019 07:15:03 +0000 (09:15 +0200)
commit486d82206c3bfd21f9ea4a3b6bca8ca7c9060285
tree41c6bbc56c20297174dc876e9cd22ec18b3ef179
parent19525f7b031f1018a74ed3760b81a4f0f3940fa3
iommu/vt-d: Check capability before disabling protected memory

[ Upstream commit 5bb71fc790a88d063507dc5d445ab8b14e845591 ]

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: f8bab73515ca5 ("intel-iommu: PMEN support")
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/intel-iommu.c