linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [tip:perf/core 12/17] arch/arm64/kvm/arm.c:499:15: warning: no previous prototype for function 'kvm_arch_vcpu_get_ip'
@ 2021-11-22 12:26 kernel test robot
  2021-11-22 19:42 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-11-22 12:26 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: llvm, kbuild-all, linux-kernel, x86, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 2047 bytes --]

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
config: arm64-buildonly-randconfig-r004-20211122 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c133fb321f7ca6083ce15b6aa5bf89de6600e649)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=e1bfc24577cc65c95dc519d7621a9c985b97e567
        git remote add tip https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
        git fetch --no-tags tip perf/core
        git checkout e1bfc24577cc65c95dc519d7621a9c985b97e567
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

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.


vim +/kvm_arch_vcpu_get_ip +499 arch/arm64/kvm/arm.c

   498	
 > 499	unsigned long kvm_arch_vcpu_get_ip(struct kvm_vcpu *vcpu)
   500	{
   501		return *vcpu_pc(vcpu);
   502	}
   503	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 42150 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [tip:perf/core 12/17] arch/arm64/kvm/arm.c:499:15: warning: no previous prototype for function 'kvm_arch_vcpu_get_ip'
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2021-11-22 19:42 UTC (permalink / raw)
  To: kernel test robot
  Cc: llvm, kbuild-all, linux-kernel, x86, Paolo Bonzini,
	Peter Zijlstra, Marc Zyngier

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-22 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).