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

Add support for sfence.vma instruction #23041

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions libr/arch/p/riscv/riscv-opc.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ static const struct riscv_opcode riscv_builtin_opcodes[] = {
{ "hret", "I", "", MATCH_HRET, MASK_HRET, match_opcode, 0 },
{ "mret", "I", "", MATCH_MRET, MASK_MRET, match_opcode, 0 },
{ "dret", "I", "", MATCH_DRET, MASK_DRET, match_opcode, 0 },
{ "sfence.vma","I", "s,t", MATCH_SFENCE_VMA, MASK_SFENCE_VMA, match_opcode, 0 },
buildandcrash marked this conversation as resolved.
Show resolved Hide resolved
{ "sfence.vm", "I", "", MATCH_SFENCE_VM, MASK_SFENCE_VM | MASK_RS1, match_opcode, 0 },
{ "sfence.vm", "I", "s", MATCH_SFENCE_VM, MASK_SFENCE_VM, match_opcode, 0 },
{ "wfi", "I", "", MATCH_WFI, MASK_WFI, match_opcode, 0 },
Expand Down
2 changes: 2 additions & 0 deletions libr/arch/p/riscv/riscv-opc.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@
#define MASK_MRET 0xffffffff
#define MATCH_DRET 0x7b200073
#define MASK_DRET 0xffffffff
#define MATCH_SFENCE_VMA 0x12000073
#define MASK_SFENCE_VMA 0xfe007fff
#define MATCH_SFENCE_VM 0x10400073
#define MASK_SFENCE_VM 0xfff07fff
#define MATCH_WFI 0x10500073
Expand Down
3 changes: 2 additions & 1 deletion libr/asm/d/riscv.sdb.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ sd=store double word (64 bits)
seqz=set if equal to zero
sext=two complement
sextw=two complement word
sfence.vm=supervisor-mode fence for virtual memory
sfence.vma=supervisor-mode fence for virtual memory
sfence.vm=supervisor-mode fence for virtual memory (Deprecated)
sgtz=set if greater than zero
sh=store half-word (16 bits)
slli=shift left logically by immediate
Expand Down
Loading