Re: [GIT PULL] perf/core for v5.17

From: Sean Christopherson
Date: Tue Jan 11 2022 - 16:21:23 EST


On Tue, Jan 11, 2022, Borislav Petkov wrote:
> KVM: Move x86's perf guest info callbacks to generic KVM

This commit, e1bfc24577cc, introduces a new warning on arm64 with CONFIG_GUEST_PERF_EVENTS=n.

>> arch/arm64/kvm/arm.c:499:15: warning: no previous prototype for function 'kvm_arch_vcpu_get_ip' [-Wmissing-prototypes]
unsigned long kvm_arch_vcpu_get_ip(struct kvm_vcpu *vcpu)

I floated a potential fix[*], but we all lost track of it. I assume the easiest
solution at this point is to post a proper patch to go on top?

---
arch/arm64/kvm/arm.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index 8129ee1ed3a4..e3b46951a92d 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -496,10 +496,12 @@ bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu)
return vcpu_mode_priv(vcpu);
}

+#ifdef CONFIG_GUEST_PERF_EVENTS
unsigned long kvm_arch_vcpu_get_ip(struct kvm_vcpu *vcpu)
{
return *vcpu_pc(vcpu);
}
+#endif

/* Just ensure a guest exit from a particular CPU */
static void exit_vm_noop(void *info)
--

[*] https://lore.kernel.org/all/YZvysKFSLTxDzaBs@xxxxxxxxxx/