[PATCH] RISC-V: KVM: Delegate illegal instruction fault

From: Xu Lu
Date: Fri Jun 20 2025 - 05:17:40 EST


Delegate illegal instruction fault to VS mode in default to avoid such
exceptions being trapped to HS and redirected back to VS.

Signed-off-by: Xu Lu <luxu.kernel@xxxxxxxxxxxxx>
---
arch/riscv/include/asm/kvm_host.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/riscv/include/asm/kvm_host.h b/arch/riscv/include/asm/kvm_host.h
index 85cfebc32e4cf..97cc2c0dba73a 100644
--- a/arch/riscv/include/asm/kvm_host.h
+++ b/arch/riscv/include/asm/kvm_host.h
@@ -48,6 +48,7 @@
BIT(EXC_SYSCALL) | \
BIT(EXC_INST_PAGE_FAULT) | \
BIT(EXC_LOAD_PAGE_FAULT) | \
+ BIT(EXC_INST_ILLEGAL) | \
BIT(EXC_STORE_PAGE_FAULT))

#define KVM_HIDELEG_DEFAULT (BIT(IRQ_VS_SOFT) | \
--
2.20.1