The RISC-V Instruction Set Manual Volume I: Unprivileged ISA says:
Setting the
aqbit on the LR instruction, and setting both theaqand therlbit on the SC instruction makes the LR/SC sequence sequentially consistent, meaning that it cannot be reordered with earlier or later memory operations from the same hart.
My question is: what prevents earlier memory operations from being reordered after lr.aq, breaking the sequential consistency guarantee, if the rl bit isn't set on the lr instruction? Shouldn't it be lr.aqrl instead?
The specification has been improved regarding this: https://github.com/riscv/riscv-isa-manual/issues/886