Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement memX_locked instructions #23

Open
Rot127 opened this issue Nov 20, 2023 · 0 comments
Open

Implement memX_locked instructions #23

Rot127 opened this issue Nov 20, 2023 · 0 comments
Labels

Comments

@Rot127
Copy link
Member

Rot127 commented Nov 20, 2023

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.
@Rot127 Rot127 added enhancement New feature or request missing-instructions labels Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant