RISC-V: KVM: Add new exit statstics for redirected traps
authorAtish Patra <atishp@rivosinc.com>
Tue, 24 Dec 2024 21:04:55 +0000 (13:04 -0800)
committerAnup Patel <anup@brainfault.org>
Mon, 30 Dec 2024 08:31:02 +0000 (14:01 +0530)
commitaf79caa83f6aa41e9092292a2ba7f701e57353ec
tree1d283794e45e1391aecb1667c31a3308f4b24d98
parent2f15b5eaff79b70b004b0aae79dee62d3b3abda0
RISC-V: KVM: Add new exit statstics for redirected traps

Currently, kvm doesn't delegate the few traps such as misaligned
load/store, illegal instruction and load/store access faults because it
is not expected to occur in the guest very frequently. Thus, kvm gets a
chance to act upon it or collect statistics about it before redirecting
the traps to the guest.

Collect both guest and host visible statistics during the traps.
Enable them so that both guest and host can collect the stats about
them if required.

Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Atish Patra <atishp@rivosinc.com>
Link: https://lore.kernel.org/r/20241224-kvm_guest_stat-v2-3-08a77ac36b02@rivosinc.com
Signed-off-by: Anup Patel <anup@brainfault.org>
arch/riscv/include/asm/kvm_host.h
arch/riscv/kvm/vcpu.c
arch/riscv/kvm/vcpu_exit.c