mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-27 20:42:52 +00:00
iommu/vt-d: Set SRE bit only when hardware has SRS cap
commit7fc961cf7fupstream. SRS cap is the hardware cap telling if the hardware IOMMU can support requests seeking supervisor privilege or not. SRE bit in scalable-mode PASID table entry is treated as Reserved(0) for implementation not supporting SRS cap. Checking SRS cap before setting SRE bit can avoid the non-recoverable fault of "Non-zero reserved field set in PASID Table Entry" caused by setting SRE bit while there is no SRS cap support. The fault messages look like below: DMAR: DRHD: handling fault status reg 2 DMAR: [DMA Read NO_PASID] Request device [00:0d.0] fault addr 0x1154e1000 [fault reason 0x5a] SM: Non-zero reserved field set in PASID Table Entry Fixes:6f7db75e1c("iommu/vt-d: Add second level page table interface") Cc: stable@vger.kernel.org Signed-off-by: Tina Zhang <tina.zhang@intel.com> Link: https://lore.kernel.org/r/20221115070346.1112273-1-tina.zhang@intel.com Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Link: https://lore.kernel.org/r/20221116051544.26540-3-baolu.lu@linux.intel.com Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c31a792a82
commit
052d0e79ef
@@ -717,7 +717,7 @@ int intel_pasid_setup_second_level(struct intel_iommu *iommu,
|
||||
* Since it is a second level only translation setup, we should
|
||||
* set SRE bit as well (addresses are expected to be GPAs).
|
||||
*/
|
||||
if (pasid != PASID_RID2PASID)
|
||||
if (pasid != PASID_RID2PASID && ecap_srs(iommu->ecap))
|
||||
pasid_set_sre(pte);
|
||||
pasid_set_present(pte);
|
||||
pasid_flush_caches(iommu, pte, pasid, did);
|
||||
@@ -756,7 +756,8 @@ int intel_pasid_setup_pass_through(struct intel_iommu *iommu,
|
||||
* We should set SRE bit as well since the addresses are expected
|
||||
* to be GPAs.
|
||||
*/
|
||||
pasid_set_sre(pte);
|
||||
if (ecap_srs(iommu->ecap))
|
||||
pasid_set_sre(pte);
|
||||
pasid_set_present(pte);
|
||||
pasid_flush_caches(iommu, pte, pasid, did);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user