Conversation
|
Note: Additionally, a quick search shows that the unprivileged |
|
In the ARM backend, the valgrind-riscv64/VEX/priv/host_arm64_defs.c Lines 4338 to 4343 in 8864c92 This means that the ARM backend has strengthened the semantics of the However, in the RISC-V backend, the valgrind-riscv64/VEX/priv/host_riscv64_defs.c Lines 2314 to 2318 in d087725 We might consider doing something similar, or perhaps introduce a new |
Right, I wouldn't expect to see FENCE.I used in userspace applications. The RISC-V Instruction Set Manual Volume I: Unprivileged Architecture has a note on it: Because FENCE.I only orders stores with a hart’s own instruction fetches, application code should only rely upon FENCE.I if the application thread will not be migrated to a different hart. The EEI can provide mechanisms for efficient multiprocessor instruction-stream synchronization.
I think that from the perspective of the VCPU that Valgrind implements, FENCE.I would effectively need to result in discarding all translations. Something as |
|
SMC (self-modifying code, somewhat seen in malware/injected code/thunk) is one more use case of Based on the very rare use cases listed, I would recommend emitting an |
|
I'm somewhat in favor of implementing this instruction properly if it is added. Turning it into Userspace programs shouldn't really need to use this instruction, but instead need to invoke the |
#19 partially
sorry for the inconsistent commit log, should be:
riscv64: Support fence.iThe project-level README is left unmodified.