Skip to content

Commit 7b51783

Browse files
sean-jcPeter Zijlstra
authored andcommitted
KVM: arm64: Convert to the generic perf callbacks
Drop arm64's version of the callbacks in favor of the callbacks provided by generic KVM, which are semantically identical. Signed-off-by: Sean Christopherson <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 33271a9 commit 7b51783

File tree

1 file changed

+2
-32
lines changed

1 file changed

+2
-32
lines changed

arch/arm64/kvm/perf.c

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,42 +13,12 @@
1313

1414
DEFINE_STATIC_KEY_FALSE(kvm_arm_pmu_available);
1515

16-
static unsigned int kvm_guest_state(void)
17-
{
18-
struct kvm_vcpu *vcpu = kvm_get_running_vcpu();
19-
unsigned int state;
20-
21-
if (!vcpu)
22-
return 0;
23-
24-
state = PERF_GUEST_ACTIVE;
25-
if (!vcpu_mode_priv(vcpu))
26-
state |= PERF_GUEST_USER;
27-
28-
return state;
29-
}
30-
31-
static unsigned long kvm_get_guest_ip(void)
32-
{
33-
struct kvm_vcpu *vcpu = kvm_get_running_vcpu();
34-
35-
if (WARN_ON_ONCE(!vcpu))
36-
return 0;
37-
38-
return *vcpu_pc(vcpu);
39-
}
40-
41-
static struct perf_guest_info_callbacks kvm_guest_cbs = {
42-
.state = kvm_guest_state,
43-
.get_ip = kvm_get_guest_ip,
44-
};
45-
4616
void kvm_perf_init(void)
4717
{
48-
perf_register_guest_info_callbacks(&kvm_guest_cbs);
18+
kvm_register_perf_callbacks(NULL);
4919
}
5020

5121
void kvm_perf_teardown(void)
5222
{
53-
perf_unregister_guest_info_callbacks(&kvm_guest_cbs);
23+
kvm_unregister_perf_callbacks();
5424
}

0 commit comments

Comments
 (0)