I don't think memory barriers have anything to do with speculation,Since idx can be speculated, I guess we need array_index_nospec here?So we have
ACQUIRE(mmu_lock)
get idx
RELEASE(mmu_lock)
ACQUIRE(mmu_lock)
read array[idx]
RELEASE(mmu_lock)
Then I think idx can't be speculated consider we've passed RELEASE +
ACQUIRE?
they are architectural.