lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Jan 2021 14:35:03 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Like Xu <like.xu@...ux.intel.com>
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>, x86@...nel.org,
        linux-kernel@...r.kernel.org, Jason Baron <jbaron@...mai.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        kernel test robot <lkp@...el.com>
Subject: Re: [PATCH] x86/perf: Use static_call for x86_pmu.guest_get_msrs

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.

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)
{
	*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);
}

Powered by blists - more mailing lists