public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: kernel test robot <lkp@intel.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org,
	linux-kernel@vger.kernel.org, x86@kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Marc Zyngier <maz@kernel.org>
Subject: Re: [tip:perf/core 12/17] arch/arm64/kvm/arm.c:499:15: warning: no previous prototype for function 'kvm_arch_vcpu_get_ip'
Date: Mon, 22 Nov 2021 19:42:40 +0000	[thread overview]
Message-ID: <YZvysKFSLTxDzaBs@google.com> (raw)
In-Reply-To: <202111222031.KekEh4ig-lkp@intel.com>

+Peter, Marc

On Mon, Nov 22, 2021, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git perf/core
> head:   a9f4a6e92b3b319296fb078da2615f618f6cd80c
> commit: e1bfc24577cc65c95dc519d7621a9c985b97e567 [12/17] KVM: Move x86's perf guest info callbacks to generic KVM
> All warnings (new ones prefixed by >>):
> 
> >> 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)
>                  ^
>    arch/arm64/kvm/arm.c:499:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
>    unsigned long kvm_arch_vcpu_get_ip(struct kvm_vcpu *vcpu)
>    ^
>    static 
>    1 warning generated.

Argh, the declaration is behind CONFIG_GUEST_PERF_EVENTS=y so that architectures
that don't support GUEST_PERF_EVENTS at all didn't need to provide implementations.

There are a few ways to solve this, none of which I particularly love.  I think my
first choice would be to wrap arm's implementation with an #ifdef.  Stubbing out a
getter like this feels all kinds of wrong, and moving the declaration outside of
CONFIG_GUEST_PERF_EVENTS=y will set someone up to try and use the helper when it's
not available.

---
 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)
--


      reply	other threads:[~2021-11-22 19:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 12:26 [tip:perf/core 12/17] arch/arm64/kvm/arm.c:499:15: warning: no previous prototype for function 'kvm_arch_vcpu_get_ip' kernel test robot
2021-11-22 19:42 ` Sean Christopherson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YZvysKFSLTxDzaBs@google.com \
    --to=seanjc@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox