You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When we call lr instructions to load memory and reserve the address location, any store-related instruction (atomic or non-atomic) with a totally different address (not even the same cache line) will cause an error for subsequent sc instruction. Note that no PMP is enabled, and based on the device tree and memory map configs, the region is read/writeable. Also, on the Spike golden model, no error happens, and store conditional instruction updates the value of the address. For more information, I attached a sequence of instructions to reproduce.
If the current behavior is a bug, please provide the steps to reproduce the problem:
Execute following instructions on Rocket core or Boom:
What is the expected behavior?
Rocket core / Boom has to change the content of the memory because, between the lr and sc instructions, nothing broke the reservation.
Spike trace:
This is allowed in the specification for LR/SC behavior.
Based on specification An implementation can register an arbitrarily large reservation set on each LR, provided the reser- vation set includes all bytes of the addressed data word or doubleword. but there are two critical problems:
Registering reservation for size of whole physical memory, first of all bring a lots of overhead because any store for any arbitrary address will break the reservation and code(user/kernel/firmware) needs a lots of try in a multi thread system. 2. Furthermore, such behaviour limit the flexibility of (user/kernel/firmware) for writing code between LR and SC because they need to avoid any store between LR and SC. It is makes sense to reserve a page size not whole memory.
This isn't due to the reservation size, this is due to the limitations on what can be within a constrained LR/SC loop to guarantee eventual success, see section 8.3 of the unprivileged spec (Eventual Success of Store Conditional Instructions).
Type of issue: bug report
Impact: unknown
Development Phase: request
Other information
When we call
lr
instructions to load memory and reserve the address location, any store-related instruction (atomic or non-atomic) with a totally different address (not even the same cache line) will cause an error for subsequentsc
instruction. Note that no PMP is enabled, and based on the device tree and memory map configs, the region is read/writeable. Also, on the Spike golden model, no error happens, and store conditional instruction updates the value of the address. For more information, I attached a sequence of instructions to reproduce.If the current behavior is a bug, please provide the steps to reproduce the problem:
Execute following instructions on Rocket core or Boom:
What is the current behavior?
Rocket core / Boom does not change the memory content, and
sc
writes an error bit in therd
register.Rocket core trace:
What is the expected behavior?
Rocket core / Boom has to change the content of the memory because, between the
lr
andsc
instructions, nothing broke the reservation.Spike trace:
Please tell us about your environment:
The text was updated successfully, but these errors were encountered: