Skip to content

Commit 7fc961c

Browse files
TinaZhangZWjoergroedel
authored andcommitted
iommu/vt-d: Set SRE bit only when hardware has SRS cap
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: 6f7db75 ("iommu/vt-d: Add second level page table interface") Cc: [email protected] Signed-off-by: Tina Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lu Baolu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 242b0aa commit 7fc961c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/iommu/intel/pasid.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ int intel_pasid_setup_second_level(struct intel_iommu *iommu,
642642
* Since it is a second level only translation setup, we should
643643
* set SRE bit as well (addresses are expected to be GPAs).
644644
*/
645-
if (pasid != PASID_RID2PASID)
645+
if (pasid != PASID_RID2PASID && ecap_srs(iommu->ecap))
646646
pasid_set_sre(pte);
647647
pasid_set_present(pte);
648648
spin_unlock(&iommu->lock);
@@ -685,7 +685,8 @@ int intel_pasid_setup_pass_through(struct intel_iommu *iommu,
685685
* We should set SRE bit as well since the addresses are expected
686686
* to be GPAs.
687687
*/
688-
pasid_set_sre(pte);
688+
if (ecap_srs(iommu->ecap))
689+
pasid_set_sre(pte);
689690
pasid_set_present(pte);
690691
spin_unlock(&iommu->lock);
691692

0 commit comments

Comments
 (0)