Hi Eric,
On 2026/8/28 00:56, Eric Auger wrote:
On 8/13/26 6:25 PM, Tao Tang wrote:
To prevent aliasing between translations controlled through the Secure and
Non-secure programming interfaces, the IOTLB lookup key must incorporate
SEC_SID.
This commit:
- expands SMMUIOTLBKey with SEC_SID field for cache key differentiation
- extends SMMUIOTLBPageInvInfo with SEC_SID for invalidation filtering
- updates all IOTLB invalidation helpers (smmu_iotlb_inv_iova,
smmu_iotlb_inv_ipa, smmu_iotlb_inv_asid_vmid, smmu_iotlb_inv_vmid,
smmu_iotlb_inv_vmid_s1) to accept and filter by SEC_SID
- plumbs SEC_SID through smmuv3_range_inval for TLB invalidation
- enhances trace events to include SEC_SID for better debugging
This ensures that IOTLB entries decoded through the Secure and Non-secure
programming interfaces are distinct, preventing cache aliasing across
SEC_SID namespaces.
Signed-off-by: Tao Tang <[email protected]>
---
hw/arm/smmu-common.c | 110 +++++++++++++++++++++++------------
hw/arm/smmu-internal.h | 2 +
hw/arm/smmuv3.c | 47 ++++++++++-----
hw/arm/trace-events | 20 +++----
include/hw/arm/smmu-common.h | 32 +++++++---
5 files changed, 140 insertions(+), 71 deletions(-)
------------------------------<snip>------------------------------
------------------------------<snip>------------------------------
diff --git a/hw/arm/smmuv3.c b/hw/arm/smmuv3.c
index cc5d3ab696c..087112ba4b6 100644
--- a/hw/arm/smmuv3.c
+++ b/hw/arm/smmuv3.c
@@ -634,6 +634,17 @@ static int decode_ste(SMMUv3State *s, SMMUTransCfg *cfg,
goto bad_ste;
}
+ /*
+ * Keep the SEC_SID-to-StreamWorld approximation used by the IOTLB key
+ * one-to-one until the other Secure translation regimes are modeled.
+ */
sorry but I don't understand the above comment. Also why are we talking
about IOTLB here whereas it is not used in this function?
also you already put a comment in smmu-common.h
+ if (sec_sid == SMMU_SEC_SID_S && STE_CFG_S1_TRANSLATE(config) &&
use smmu_sec_sid_is_secure()
I'll drop this comment from decode_ste() and use
smmu_sec_sid_is_secure() here.
Thanks.
Tao
Besides looks good to me
Reviewed-by: Eric Auger <[email protected]>
Thanks
Eric
------------------------------<snip>------------------------------
------------------------------<snip>------------------------------