Skip to content

Implement memX_locked instructions #23

@Rot127

Description

@Rot127

locked load and and conditional stores are used for thread safe storing and loading (see ISA v73 5.12 Atomic operations).

Currently they are not implemented yet, because RzIL doesn't support concurrency. Since those instructions are relatively rare we can skip them in the beginning until someone needs them.

Though here is the outline how to implement them:

  • Introduce global variables to save atomically writable vaddr and the "locked" flag (equivalent to
    QEMUs hex_llsc_addr, hex_llsc_val).
  • Add a patch for the fLOAD_LOCKED and fSTORE_LOCKED macros to call our sub-routines.
  • Add sub-routine for locked load and conditional store.
    • In them, handle the conditional stores and locked loads and set those global vars accordingly.
  • For tracing we need to track the contents of those values in QEMU as well. Otherwise, those instructions will get an incorrect state, because they are always tested sequentially.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions