[PATCH 18/18] KVM: riscv: add warning if undecoded instruction
Ben Dooks
ben.dooks at codethink.co.uk
Fri Aug 22 09:52:48 PDT 2025
It seems a good idea if we get an undecoded instruction here to
at-least print an error.
Signed-off-by: Ben Dooks <ben.dooks at codethink.co.uk>
---
arch/riscv/kvm/vcpu_insn.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/riscv/kvm/vcpu_insn.c b/arch/riscv/kvm/vcpu_insn.c
index b1edc7b10d7a..ce6ef358c9c2 100644
--- a/arch/riscv/kvm/vcpu_insn.c
+++ b/arch/riscv/kvm/vcpu_insn.c
@@ -557,6 +557,8 @@ int kvm_riscv_vcpu_mmio_load(struct kvm_vcpu *vcpu, struct kvm_run *run,
len = 4;
shift = 8 * (sizeof(ulong) - len);
} else {
+ pr_err("%s: insn 0x%08lx not decoded at %lx\n",
+ __func__, insn, vcpu->arch.guest_context.sepc);
return -EOPNOTSUPP;
}
@@ -674,6 +676,8 @@ int kvm_riscv_vcpu_mmio_store(struct kvm_vcpu *vcpu, struct kvm_run *run,
len = 4;
data32 = GET_RS2C(insn, &vcpu->arch.guest_context);
} else {
+ pr_err("%s: insn 0x%08lx not decoded at %lx\n",
+ __func__, insn, vcpu->arch.guest_context.sepc);
return -EOPNOTSUPP;
}
--
2.37.2.352.g3c44437643
More information about the linux-riscv
mailing list