From 8b1bd879171b40e401b789b11288ec8571eabb73 Mon Sep 17 00:00:00 2001 From: Mostafa Saleh Date: Tue, 10 Oct 2023 08:25:06 +0000 Subject: [PATCH] ANDROID: KVM: arm64: Add missing hyp events for forwarded SMCs __kvm_hyp_host_forward_smc() forwards SMCs to EL3, which means we exit and enter the hypervisor without tracing those. Add missing hyp events. Bug: 304445720 Change-Id: I0b66c37f1521702764b12c038324c3fec3e499a6 Signed-off-by: Mostafa Saleh --- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kvm/hyp/nvhe/hyp-main.c b/arch/arm64/kvm/hyp/nvhe/hyp-main.c index 48e20ad5ff38..995c3a840010 100644 --- a/arch/arm64/kvm/hyp/nvhe/hyp-main.c +++ b/arch/arm64/kvm/hyp/nvhe/hyp-main.c @@ -1383,11 +1383,15 @@ static void handle_host_smc(struct kvm_cpu_context *host_ctxt) handled = kvm_host_ffa_handler(host_ctxt); if (!handled && smp_load_acquire(&default_host_smc_handler)) handled = default_host_smc_handler(host_ctxt); - if (!handled) - __kvm_hyp_host_forward_smc(host_ctxt); trace_host_smc(func_id, !handled); + if (!handled) { + trace_hyp_exit(); + __kvm_hyp_host_forward_smc(host_ctxt); + trace_hyp_enter(); + } + /* SMC was trapped, move ELR past the current PC. */ kvm_skip_host_instr(); }