From 65f295739c930f94ecd495b993c7571b2c7f4e95 Mon Sep 17 00:00:00 2001 From: Nikita Ioffe Date: Thu, 3 Jul 2025 16:06:03 +0000 Subject: [PATCH] ANDROID: kvm: arm64: start hypervisor event IDs from 1 IDs of tracing events are expected to be positive integers, hence this patch. This is a quick fix to make sure that hypervisor tracing works, while the proper solution that avoids ID collision is being worked on. Bug: 428904926 Test: presubmit Change-Id: I95459cbf32466351b6a539ea2111e8d091291c2b Signed-off-by: Nikita Ioffe --- arch/arm64/kvm/hyp_events.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kvm/hyp_events.c b/arch/arm64/kvm/hyp_events.c index 424cd5189355..086931bec32c 100644 --- a/arch/arm64/kvm/hyp_events.c +++ b/arch/arm64/kvm/hyp_events.c @@ -250,7 +250,10 @@ bool hyp_trace_init_event_early(void) } static struct dentry *event_tracefs; -static unsigned int last_event_id; +// Event IDs should be positive integers, hence starting from 1 here. +// NOTE: this introduces ID clash between hypervisor events and kernel events. +// For now this doesn't seem to cause problems, but we should fix it... +static unsigned int last_event_id = 1; struct hyp_event_table { struct hyp_event *start;