On 6/8/25 17:11, Tao Tang wrote:
Following the implementation of the secure command queue, this commit
introduces the infrastructure for reporting faults and events back to
secure software.

The secure event queue is now enabled, serving as the primary mechanism
for the SMMU to report translation faults and other architected events.

For more critical failures, such as an abort on an event queue write,
the SMMU_S_GERROR registers are also added. Finally, SMMU_S_IRQ_CTRL
is wired up to control interrupt notifications for both the event
queue and these global errors.

Signed-off-by: Tao Tang <tangtao1...@phytium.com.cn>
---
  hw/arm/smmuv3-internal.h | 38 ++++++++++++++-----
  hw/arm/smmuv3.c          | 82 +++++++++++++++++++++++++---------------
  hw/arm/trace-events      |  2 +-
  3 files changed, 81 insertions(+), 41 deletions(-)


-static inline bool smmuv3_eventq_irq_enabled(SMMUv3State *s)
+static inline bool smmuv3_eventq_irq_enabled(SMMUv3State *s, bool is_secure)
  {
-    return FIELD_EX32(s->irq_ctrl, IRQ_CTRL, EVENTQ_IRQEN);
+    if (is_secure) {
+        return FIELD_EX32(s->secure_irq_ctrl, S_IRQ_CTRL, EVENTQ_IRQEN);
+    } else {
+        return FIELD_EX32(s->irq_ctrl, IRQ_CTRL, EVENTQ_IRQEN);
+    }
  }

Or using bank as suggested in patch #1:

   static inline bool smmuv3_eventq_irq_enabled(SMMUv3State *s,
                                                unsigned idx)
   {
       return FIELD_EX32(s->bank[idx].irq_ctrl, IRQ_CTRL, EVENTQ_IRQEN);
   }



Reply via email to