lib: Redirect WFI trapped from VS/VU mode to HS-mode

The WFI will trap as illegal instruction trap when executed
in VS/VU mode so we just forward/redirect it to HS-mode so
that hypervisor can deal with it appropriately.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
This commit is contained in:
Anup Patel
2019-04-05 18:17:11 +05:30
committed by Anup Patel
parent bbeb8e619d
commit a14e7ee82c
2 changed files with 20 additions and 3 deletions

View File

@@ -544,6 +544,9 @@
#define INSN_MATCH_C_FSWSP 0xe002
#define INSN_MASK_C_FSWSP 0xe003
#define INSN_MASK_WFI 0xffffff00
#define INSN_MATCH_WFI 0x10500000
#define INSN_LEN(insn) ((((insn) & 0x3) < 0x3) ? 2 : 4)
#if __riscv_xlen == 64