KVM: Add a simplified wrapper for registering perf callbacks

Add a parameter-less API for registering perf callbacks in anticipation of
introducing another x86-only parameter for handling mediated PMU PMIs.

No functional change intended.

Acked-by: Anup Patel <anup@brainfault.org>
Tested-by: Xudong Hao <xudong.hao@intel.com>
Tested-by: Manali Shukla <manali.shukla@amd.com>
Link: https://patch.msgid.link/20251206001720.468579-15-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
This commit is contained in:
Sean Christopherson 2025-12-05 16:16:50 -08:00
parent 01122b8936
commit 4b24910c05
6 changed files with 16 additions and 8 deletions

View file

@ -6470,10 +6470,11 @@ static struct perf_guest_info_callbacks kvm_guest_cbs = {
.handle_mediated_pmi = NULL,
};
void kvm_register_perf_callbacks(unsigned int (*pt_intr_handler)(void))
void __kvm_register_perf_callbacks(unsigned int (*pt_intr_handler)(void),
void (*mediated_pmi_handler)(void))
{
kvm_guest_cbs.handle_intel_pt_intr = pt_intr_handler;
kvm_guest_cbs.handle_mediated_pmi = NULL;
kvm_guest_cbs.handle_mediated_pmi = mediated_pmi_handler;
perf_register_guest_info_callbacks(&kvm_guest_cbs);
}