walnux/arch/arm64
Shen Cao 8e68c7a810 arch/arm: Add gic lock for GICD_ICFGR RMW operations.
GICD_ICFGR requires full 32-bit RMW operations.
Each interrupt uses 2 bits; thus updates must be synchronized
to avoid losing configuration in concurrent environments.

RMW conflict on GICD_ICFGRn (without lock)

CPU0 (set IRQ32 edge)      CPU1 (set IRQ33 level)
---------------------      -----------------------
val0 = read(ICFGRn)     │  val1 = read(ICFGRn)
                        │
val0 |= (edge << 4)     │
                        │  val1 &= ~(3 << 6)
                        │
write(ICFGRn, val0)     │
                        │  write(ICFGRn, val1)

=> IRQ32 config lost OR IRQ33 config lost
   (depends on which write finishes last)

Concurrent RMW on ICFGRn causes lost config.
Protect with spinlock to avoid data race.

Since interrupt type configuration is infrequent,
a single global GIC lock is sufficient (no need for
fine-grained locking per ICFGR register).

Signed-off-by: Shen Cao <caoshen3@lixiang.com>
2025-07-03 19:02:50 -03:00
..
include spinlock: fix stxr instruction status register requirement 2025-06-26 20:31:19 +08:00
src arch/arm: Add gic lock for GICD_ICFGR RMW operations. 2025-07-03 19:02:50 -03:00
CMakeLists.txt arch/arm64: migrate to SPDX identifier 2024-12-02 22:43:23 +08:00
Kconfig arm64: Support hardware debug 2025-07-03 00:20:54 +08:00