KVM: riscv: selftests: Add exception handling support
authorHaibo Xu <haibo1.xu@intel.com>
Mon, 22 Jan 2024 09:58:39 +0000 (17:58 +0800)
committerAnup Patel <anup@brainfault.org>
Wed, 6 Mar 2024 15:21:41 +0000 (20:51 +0530)
commit38f680c25ece49c1f8ff55ee78dca0ee4e1793a6
treeca4ee6636d3e89a7845959c23241423b91e5bbc7
parentfeb2c8fae3b8703408f01a8db822dd05b1a576ee
KVM: riscv: selftests: Add exception handling support

Add the infrastructure for guest exception handling in riscv selftests.
Customized handlers can be enabled by vm_install_exception_handler(vector)
or vm_install_interrupt_handler().

The code is inspired from that of x86/arm64.

Signed-off-by: Haibo Xu <haibo1.xu@intel.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Anup Patel <anup@brainfault.org>
tools/testing/selftests/kvm/Makefile
tools/testing/selftests/kvm/include/riscv/processor.h
tools/testing/selftests/kvm/lib/riscv/handlers.S [new file with mode: 0644]
tools/testing/selftests/kvm/lib/riscv/processor.c