On Mon, 2026-11-16 at 19:31 +0000, Peter Maydell wrote:
> On Fri, 21 Aug 2026 at 07:40, LIU Zhiwei
> <[email protected]> wrote:
> > 
> > Several guest architectures give their store-release instructions
> > RCsc
> > semantics, which requires the store to be ordered not only after
> > the
> > memory operations that precede it, but also before any subsequent
> > load-acquire with RCsc semantics.  The TCG translators, however,
> > only
> > emit the leading barrier before the store, so under MTTCG nothing
> > prevents the host CPU from executing the load-acquire that follows
> > a
> > store-release before the store has left its store buffer.  On an
> > x86
> > host (TSO), store-load is the only reordering the hardware may
> > perform, and it is exactly the ordering that is missing, so the
> > architecturally forbidden [0,0] outcome of the Store Buffering
> > litmus
> > test is easy to observe:
> > 
> >     CPU 0                      CPU 1
> >     store-release X = 1        store-release Y = 1
> >     load-acquire  r0 = Y       load-acquire  r1 = X
> > 
> > The affected instructions are the RISC-V Zalasr store-release
> > instructions and the Arm STLR, STLPUR and A32/T32 STL store-release
> > instructions.  Neither architecture defines an RCpc store, so every
> > store-release is RCsc (RVWMO preserved program order Rule 7; Arm
> > Architecture Reference Manual DDI 0487, section B2.3.8 "Acquire and
> > release semantics").
> > 
> > Patch 1 fixes the RISC-V side and patch 2 the Arm side by emitting
> > a
> > full barrier after the store as well.  Patch 3 fixes an inverted
> > barrier polarity found in the A32 LDA load-acquire translator while
> > auditing the load-acquire side.
> 
> > LIU Zhiwei (3):
> >   target/riscv: Fix RCsc ordering of Zalasr store-release
> >   target/arm: Fix RCsc ordering of store-release instructions
> >   target/arm: Fix barrier polarity of A32 LDA load-acquire
> 
> This series seems to have been accidentally missed, possibly
> because it included both arm and riscv patches in the same
> patchset. RTH tells me that the Arm patches are correct, and
> Daniel has reviewed the riscv one.
> 
> riscv maintainers: are you OK with me queuing the whole set
> including the riscv patch in target-arm.next, or would you
> prefer to take the riscv patch yourself through your queue?

Thanks for checking, this is fine to go via target-arm.next

Alistair

> 
> thanks
> -- PMM

Reply via email to