linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Like Xu <like.xu@linux.intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	Jason Baron <jbaron@akamai.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH] x86/perf: Use static_call for x86_pmu.guest_get_msrs
Date: Mon, 18 Jan 2021 21:05:06 +0800	[thread overview]
Message-ID: <a82754e7-9a2d-7ab4-466d-fc0d51a3b7f2@linux.intel.com> (raw)
In-Reply-To: <202101182008.jQybUDa0-lkp@intel.com>

I guess this fix will silence the compiler error,
and v2 will be sent after the local 0day test passes.

diff --git a/arch/x86/include/asm/perf_event.h 
b/arch/x86/include/asm/perf_event.h
index b9a7fd0a27e2..517f546b6b45 100644
--- a/arch/x86/include/asm/perf_event.h
+++ b/arch/x86/include/asm/perf_event.h
@@ -479,15 +479,11 @@ static inline void perf_events_lapic_init(void)   { }
  static inline void perf_check_microcode(void) { }
  #endif

-#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL)
  extern struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr);
+
+#if defined(CONFIG_PERF_EVENTS) && defined(CONFIG_CPU_SUP_INTEL)
  extern int x86_perf_get_lbr(struct x86_pmu_lbr *lbr);
  #else
-static inline struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
-{
-       *nr = 0;
-       return NULL;
-}
  static inline int x86_perf_get_lbr(struct x86_pmu_lbr *lbr)
  {
         return -1;

On 2021/1/18 20:12, kernel test robot wrote:
> Hi Like,
> 
> Thank you for the patch! Yet something to improve:
> 
> [auto build test ERROR on tip/perf/core]
> [also build test ERROR on v5.11-rc4 next-20210118]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/Like-Xu/x86-perf-Use-static_call-for-x86_pmu-guest_get_msrs/20210118-153219
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 9a7832ce3d920426a36cdd78eda4b3568d4d09e3
> config: x86_64-randconfig-a002-20210118 (attached as .config)
> compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 95d146182fdf2315e74943b93fb3bb0cbafc5d89)
> 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 x86_64 cross compiling tool for clang build
>          # apt-get install binutils-x86-64-linux-gnu
>          # https://github.com/0day-ci/linux/commit/0cd2262fad043a5edef91fca07d16759703658b8
>          git remote add linux-review https://github.com/0day-ci/linux
>          git fetch --no-tags linux-review Like-Xu/x86-perf-Use-static_call-for-x86_pmu-guest_get_msrs/20210118-153219
>          git checkout 0cd2262fad043a5edef91fca07d16759703658b8
>          # save the attached .config to linux build tree
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>>> arch/x86/events/core.c:670:31: error: redefinition of 'perf_guest_get_msrs'
>     struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
>                                   ^
>     arch/x86/include/asm/perf_event.h:486:45: note: previous definition is here
>     static inline struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
>                                                 ^
>     1 error generated.
> 
> 
> vim +/perf_guest_get_msrs +670 arch/x86/events/core.c
> 
>     669	
>   > 670	struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
>     671	{
>     672		struct perf_guest_switch_msr *ret = NULL;
>     673	
>     674		ret = static_call(x86_pmu_guest_get_msrs)(nr);
>     675		if (!ret)
>     676			*nr = 0;
>     677	
>     678		return ret;
>     679	}
>     680	EXPORT_SYMBOL_GPL(perf_guest_get_msrs);
>     681	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 


  reply	other threads:[~2021-01-18 13:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18  7:21 [PATCH] x86/perf: Use static_call for x86_pmu.guest_get_msrs Like Xu
2021-01-18 10:10 ` Peter Zijlstra
2021-01-18 12:12 ` kernel test robot
2021-01-18 13:05   ` Like Xu [this message]
2021-01-18 13:35     ` Peter Zijlstra
2021-01-22  3:19       ` Like Xu

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=a82754e7-9a2d-7ab4-466d-fc0d51a3b7f2@linux.intel.com \
    --to=like.xu@linux.intel.com \
    --cc=acme@kernel.org \
    --cc=bp@alien8.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=jbaron@akamai.com \
    --cc=jpoimboe@redhat.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --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;
as well as URLs for NNTP newsgroup(s).