[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <24daac05a52fbd62a98eaad2ff689a89615a8287.camel@surriel.com>
Date: Mon, 10 Feb 2025 21:01:12 -0500
From: Rik van Riel <riel@...riel.com>
To: Brendan Jackman <jackmanb@...gle.com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, bp@...en8.de,
peterz@...radead.org, dave.hansen@...ux.intel.com,
zhengqi.arch@...edance.com, nadav.amit@...il.com, thomas.lendacky@....com,
kernel-team@...a.com, linux-mm@...ck.org, akpm@...ux-foundation.org,
jannh@...gle.com, mhklinux@...look.com, andrew.cooper3@...rix.com, Manali
Shukla <Manali.Shukla@....com>
Subject: Re: [PATCH v9 06/12] x86/mm: use INVLPGB for kernel TLB flushes
On Fri, 2025-02-07 at 17:03 +0100, Brendan Jackman wrote:
> On Thu, 6 Feb 2025 at 05:45, Rik van Riel <riel@...riel.com> wrote:
> > diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
> > index 36939b104561..227e972b6fbc 100644
> > --- a/arch/x86/mm/tlb.c
> > +++ b/arch/x86/mm/tlb.c
> > @@ -1086,6 +1086,30 @@ void flush_tlb_all(void)
> > on_each_cpu(do_flush_tlb_all, NULL, 1);
> > }
> >
> > +static bool broadcast_kernel_range_flush(struct flush_tlb_info
> > *info)
> > +{
> > + unsigned long addr;
> > + unsigned long nr;
> > +
> > + if (!IS_ENABLED(CONFIG_X86_BROADCAST_TLB_FLUSH))
> > + return false;
> > +
> > + if (!cpu_feature_enabled(X86_FEATURE_INVLPGB))
> > + return false;
>
> I think that first conditional can be shunted off into the header
>
> diff --git a/arch/x86/include/asm/disabled-features.h
> b/arch/x86/include/asm/disabled-features.h
> index c492bdc97b05..61376b4e4fa7 100644
> --- a/arch/x86/include/asm/disabled-features.h
> +++ b/arch/x86/include/asm/disabled-features.h
> @@ -129,6 +129,12 @@
> #define DISABLE_SEV_SNP (1 << (X86_FEATURE_SEV_SNP &
> 31))
> #endif
>
> +#ifdef CONFIG_X86_BROADCAST_TLB_FLUSH
> +#define DISABLE_INVLPGB 0
> +#else
> +#define DISABLE_INVLPGB (1 << (X86_FEATURE_INVLPGB & 31))
> +#endif
> +
I'm adding this for v10, with the disabled-features.h
stuff in patch 5, and removing the no longer needed
tests from each subsequent patch.
--
All Rights Reversed.
Powered by blists - more mailing lists