[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a9560e97-478d-4e03-b936-cf6f663279a4@citrix.com>
Date: Tue, 3 Dec 2024 01:28:54 +0000
From: Andrew Cooper <andrew.cooper3@...rix.com>
To: Kevin Loughlin <kevinloughlin@...gle.com>, linux-kernel@...r.kernel.org
Cc: seanjc@...gle.com, pbonzini@...hat.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, kvm@...r.kernel.org, thomas.lendacky@....com,
pgonda@...gle.com, sidtelang@...gle.com, mizhang@...gle.com,
virtualization@...ts.linux.dev, xen-devel@...ts.xenproject.org,
bcm-kernel-feedback-list@...adcom.com
Subject: Re: [RFC PATCH 1/2] x86, lib, xenpv: Add WBNOINVD helper functions
On 03/12/2024 12:59 am, Kevin Loughlin wrote:
> diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
> index d4eb9e1d61b8..c040af2d8eff 100644
> --- a/arch/x86/include/asm/paravirt.h
> +++ b/arch/x86/include/asm/paravirt.h
> @@ -187,6 +187,13 @@ static __always_inline void wbinvd(void)
> PVOP_ALT_VCALL0(cpu.wbinvd, "wbinvd", ALT_NOT_XEN);
> }
>
> +extern noinstr void pv_native_wbnoinvd(void);
> +
> +static __always_inline void wbnoinvd(void)
> +{
> + PVOP_ALT_VCALL0(cpu.wbnoinvd, "wbnoinvd", ALT_NOT_XEN);
> +}
Given this, ...
> diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
> index fec381533555..a66b708d8a1e 100644
> --- a/arch/x86/kernel/paravirt.c
> +++ b/arch/x86/kernel/paravirt.c
> @@ -149,6 +154,7 @@ struct paravirt_patch_template pv_ops = {
> .cpu.write_cr0 = native_write_cr0,
> .cpu.write_cr4 = native_write_cr4,
> .cpu.wbinvd = pv_native_wbinvd,
> + .cpu.wbnoinvd = pv_native_wbnoinvd,
> .cpu.read_msr = native_read_msr,
> .cpu.write_msr = native_write_msr,
> .cpu.read_msr_safe = native_read_msr_safe,
this, and ...
> diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
> index d6818c6cafda..a5c76a6f8976 100644
> --- a/arch/x86/xen/enlighten_pv.c
> +++ b/arch/x86/xen/enlighten_pv.c
> @@ -1162,6 +1162,7 @@ static const typeof(pv_ops) xen_cpu_ops __initconst = {
> .write_cr4 = xen_write_cr4,
>
> .wbinvd = pv_native_wbinvd,
> + .wbnoinvd = pv_native_wbnoinvd,
>
> .read_msr = xen_read_msr,
> .write_msr = xen_write_msr,
this, what is the point having a paravirt hook which is wired to
native_wbnoinvd() in all cases?
That just seems like overhead for overhead sake.
~Andrew
Powered by blists - more mailing lists