mirror of
https://github.com/qemu/qemu.git
synced 2026-09-21 22:14:32 +00:00
In linux-user parallel execution, AMO and ordinary integer stores do not invalidate load reservations held by another hart. A store that preserves the numeric value can therefore leave the reservation intact and allow a later SC to succeed. Use the existing EXCP_ATOMIC path to re-execute LR, SC, AMO, and ordinary integer store instructions in a serial context. The completed store and reservation invalidation then cannot be interleaved with another guest hart. Track the LR access size and invalidate every other-hart reservation whose byte range overlaps the completed store. A successful SC uses the same invalidation helper. Clear the reservation when cloning a new linux-user RISC-V hart so that a child cannot inherit the parent's reservation state. The change is limited to linux-user TCG and the base scalar integer/ A-extension translator paths. Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4149 Signed-off-by: wangyang <wangyang25@otcaix.iscas.ac.cn> Signed-off-by: Helge Deller <deller@gmx.de>