]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: riscv: selftests: Decode stval to identify exact exception type
authorAtish Patra <atishp@rivosinc.com>
Wed, 30 Apr 2025 08:16:29 +0000 (01:16 -0700)
committerAnup Patel <anup@brainfault.org>
Wed, 21 May 2025 04:04:37 +0000 (09:34 +0530)
commit3608b174ece5633dbd1f9afe37a48a2a9a0f0499
treedb0db3f190a45b5c8aa514914b94e0c16ff6b35d
parente23bb06b17f81982450beb880b9c5a7fb4251164
KVM: riscv: selftests: Decode stval to identify exact exception type

Currently, the sbi_pmu_test continues if the exception type is illegal
instruction because access to hpmcounter will generate that. However
illegal instruction exception may occur due to the other reasons
which should result in test assertion.

Use the stval to decode the exact type of instructions and which csrs are
being accessed if it is csr access instructions. Assert in all cases
except if it is a csr access instructions that access valid PMU related
registers.

Take this opportunity to remove the CSR_CYCLEH reference as the test is
compiled for RV64 only.

Reviewed-by: Anup Patel <anup@brainfault.org>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20250430-kvm_selftest_improve-v3-2-eea270ff080b@rivosinc.com
Signed-off-by: Anup Patel <anup@brainfault.org>
tools/testing/selftests/kvm/include/riscv/processor.h
tools/testing/selftests/kvm/riscv/sbi_pmu_test.c