On 2/21/26 2:02 AM, Tao Tang wrote:
Rework the SMMUv3 state management by introducing a banked register
structure. This is a purely mechanical refactoring with no functional
changes.

To support multiple security states, a new enum, SMMUSecSID, is
introduced to identify each state, sticking to the spec terminology.

A new structure, SMMUv3RegBank, is then defined to hold the state
for a single security context. The main SMMUv3State now contains an
array of these banks, indexed by SMMUSecSID. This avoids the need for
separate fields for non-secure and future secure registers.

All existing code, which handles only the Non-secure state, is updated
to access its state via s->bank[SMMU_SEC_SID_NS]. A local bank helper
pointer is used where it improves readability.

Function signatures and logic remain untouched in this commit to
isolate the structural changes and simplify review. This is the
foundational step for building multi-security-state support.

Signed-off-by: Tao Tang <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
---
  hw/arm/smmuv3-accel.c        |  42 +++--
  hw/arm/smmuv3-internal.h     |  24 ++-
  hw/arm/smmuv3.c              | 345 +++++++++++++++++++----------------
  include/hw/arm/smmu-common.h |   6 +
  include/hw/arm/smmuv3.h      |  30 ++-
  5 files changed, 257 insertions(+), 190 deletions(-)


Reviewed-by: Pierrick Bouvier <[email protected]>

Reply via email to