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 <smostafa@google.com>
This commit is contained in:
Mostafa Saleh 2023-10-10 08:25:06 +00:00 committed by Will Deacon
parent f4812c6864
commit 8b1bd87917

View File

@ -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();
}