riscv-software-src / riscv-isa-sim

Spike, a RISC-V ISA Simulator
Other
2.44k stars 857 forks source link

SFENCE.VMA instruction privilege #1798

Open Seo-sang opened 2 months ago

Seo-sang commented 2 months ago

Can sfence.vma instruction be executed in supervisor mode? I think both 'S' and 'M' modes are possible, but spike doesn't support it in 'M' mode. Also, it doesn't work even though I changed the code as below in sfencevma.h file. require_extension('S') -> require_extension('M')_ Is there any solution to support sfence.vma in 'M' mode?

Thank you.

aswaterman commented 2 months ago

Spike does allow SFENCE.VMA to be executed in M-mode, but only if the implementation supports S-mode. This is the correct behavior.