Hi Eric,

On 2026/3/3 01:07, Eric Auger wrote:

On 2/21/26 11:15 AM, Tao Tang wrote:
Add helper macros for NS and NSTable bits and group PTE attribute
accessors for clarity. No functional change beyond the new helpers.

Signed-off-by: Tao Tang <[email protected]>
---
  hw/arm/smmu-internal.h | 16 ++++++++++++++--
  1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/hw/arm/smmu-internal.h b/hw/arm/smmu-internal.h
index d143d296f34..a0454f720da 100644
--- a/hw/arm/smmu-internal.h
+++ b/hw/arm/smmu-internal.h
@@ -58,16 +58,28 @@
      ((level == 3) &&                                                    \
       ((pte & ARM_LPAE_PTE_TYPE_MASK) == ARM_LPAE_L3_PTE_TYPE_PAGE))
+/* Block & page descriptor attributes */
Maybe use the spec terminology:
Stage 1 attribute fields in VMSAv8-64 Block and Page descriptors
vs 7 Stage 1 VMSAv8-64 Table descriptor fields

By the way AF belongs to both



I’ll rework the comments to use the spec terminology and avoid grouping AF too narrowly under Block/Page wording.


Best regards,

Tao


+/* Non-secure bit */
+#define PTE_NS(pte) \
+    (extract64(pte, 5, 1))
+
  /* access permissions */
#define PTE_AP(pte) \
      (extract64(pte, 6, 2))
+/* access flag */
+#define PTE_AF(pte) \
+    (extract64(pte, 10, 1))
+
+
+/* Table descriptor attributes */
  #define PTE_APTABLE(pte) \
      (extract64(pte, 61, 2))
-#define PTE_AF(pte) \
-    (extract64(pte, 10, 1))
+#define PTE_NSTABLE(pte) \
+    (extract64(pte, 63, 1))
+
  /*
   * TODO: At the moment all transactions are considered as privileged (EL1)
   * as IOMMU translation callback does not pass user/priv attributes.
Eric


Reply via email to