KVM: arm64: Add hyp_enter/hyp_exit events to nVHE/pKVM hyp

The hyp_enter and hyp_exit events are logged by the hypervisor any time
it is entered and exited.

Signed-off-by: Vincent Donnefort <vdonnefort@google.com>
Link: https://patch.msgid.link/20260309162516.2623589-29-vdonnefort@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
This commit is contained in:
Vincent Donnefort
2026-03-09 16:25:14 +00:00
committed by Marc Zyngier
parent 0a90fbc8a1
commit 696dfec22b
10 changed files with 131 additions and 17 deletions

View File

@@ -364,8 +364,26 @@ static struct trace_remote_callbacks trace_remote_callbacks = {
.enable_event = hyp_trace_enable_event,
};
static const char *__hyp_enter_exit_reason_str(u8 reason);
#include <asm/kvm_define_hypevents.h>
static const char *__hyp_enter_exit_reason_str(u8 reason)
{
static const char strs[][12] = {
"smc",
"hvc",
"psci",
"host_abort",
"guest_exit",
"eret_host",
"eret_guest",
"unknown",
};
return strs[min(reason, HYP_REASON_UNKNOWN)];
}
static void __init hyp_trace_init_events(void)
{
struct hyp_event_id *hyp_event_id = __hyp_event_ids_start;