Hi, > 1. atomic_set_release > 2. atomic_fetch_andnot_relaxed > 3. atomic_cond_read_relaxed > 4. atomic_long_cond_read_relaxed > 5. atomic_long_xor > 6. atomic_set_release > 7. atomic_cmpxchg_relaxed might be we can use atomic_cmpxchg that is > implemented in XEN need to check. > 8. atomic_dec_return_release > 9. atomic_fetch_inc_relaxed
If we're going to pull in Linux's implementations of the above atomics helpers for SMMUv3, and given the majority of SMMUv3 systems are v8.1+ with LSE, perhaps this would be a good time to drop the current atomic.h in Xen completely and pull in both Linux's LL/SC and LSE helpers, then use a new Kconfig to toggle between them? Back in 5d45ecabe3 [1] Jan mentioned we probably want to avoid relying on gcc atomics helpers as we can't switch between LL/SC and LSE atomics. With the above we'd be able to drop the reference to gcc's built-in __sync_fetch_and_add() in xen/include/asm-arm/system.h by making arch_fetch_and_add() pull in the explicit implementation of the helper. Thoughts? Thanks, Ash. [1] https://xenbits.xen.org/gitweb/?p=xen.git;a=commit;h=5d45ecabe3