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: Fri, 22 Jan 2021 11:19:31 +0800	[thread overview]
Message-ID: <7f31ae2f-25a1-a7fb-1598-a8f21f3bc447@linux.intel.com> (raw)
In-Reply-To: <YAWOhxi6Vxiq8JLR@hirez.programming.kicks-ass.net>

On 2021/1/18 21:35, Peter Zijlstra wrote:
> On Mon, Jan 18, 2021 at 09:05:06PM +0800, Like Xu wrote:
>> I guess this fix will silence the compiler error,
>> and v2 will be sent after the local 0day test passes.
> 
> I think there's also a problem where you don't assign a function at all.

Thank you!

> 
> I think you want something like
> 
> 	if (!x86_pmu.guest_get_msr)
> 		x86_pmu.guest_get_msr = guest_get_msr_nop;
> 
> right before x86_pmu_static_call_update();
> 
> And then have it be something like:
> 
> static void *guest_et_msr_nop(int *nr)

The [-Werror=incompatible-pointer-types] will yell at "void *".

Please review the v2 version.

https://lore.kernel.org/lkml/20210122030324.2754492-1-like.xu@linux.intel.com/T/#u

> {
> 	*nr = 0;
> 	return NULL;
> }
> 
> and then you can reduce the entire thing to:
> 
> struct perf_guest_switch_msr *perf_guest_get_msrs(int *nr)
> {
> 	return static_call(x86_pmu_guest_get_msrs)(nr);
> }
> 


      reply	other threads:[~2021-01-22  3:21 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
2021-01-18 13:35     ` Peter Zijlstra
2021-01-22  3:19       ` Like Xu [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=7f31ae2f-25a1-a7fb-1598-a8f21f3bc447@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).