[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1711272128360.2333@nanos>
Date: Mon, 27 Nov 2017 21:28:49 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Dave Hansen <dave.hansen@...ux.intel.com>
cc: LKML <linux-kernel@...r.kernel.org>,
Andy Lutomirski <luto@...nel.org>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
Brian Gerst <brgerst@...il.com>,
Denys Vlasenko <dvlasenk@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Rik van Riel <riel@...hat.com>, daniel.gruss@...k.tugraz.at,
hughd@...gle.com, keescook@...gle.com, linux-mm@...ck.org,
michael.schwarz@...k.tugraz.at, moritz.lipp@...k.tugraz.at,
richard.fellner@...dent.tugraz.at
Subject: Re: [patch V2 2/5] x86/kaiser: Simplify disabling of global pages
On Mon, 27 Nov 2017, Dave Hansen wrote:
> On 11/26/2017 03:14 PM, Thomas Gleixner wrote:
> > +static void enable_global_pages(void)
> > +{
> > +#ifndef CONFIG_KAISER
> > + __supported_pte_mask |= _PAGE_GLOBAL;
> > +#endif
> > +}
> > +
> > static void __init probe_page_size_mask(void)
> > {
> > /*
> > @@ -179,11 +186,11 @@ static void __init probe_page_size_mask(
> > cr4_set_bits_and_update_boot(X86_CR4_PSE);
> >
> > /* Enable PGE if available */
> > + __supported_pte_mask |= _PAGE_GLOBAL;
> > if (boot_cpu_has(X86_FEATURE_PGE)) {
> > cr4_set_bits_and_update_boot(X86_CR4_PGE);
> > - __supported_pte_mask |= _PAGE_GLOBAL;
> > - } else
> > - __supported_pte_mask &= ~_PAGE_GLOBAL;
> > + enable_global_pages();
> > + }
>
> This looks a little funky. Doesn't this or _PAGE_GLOBAL into
> __supported_pte_mask twice? Once before the if(), and then a second
> time via enable_global_pages() inside the if?
>
> Did you intend for it to be masked *out* in the first one and then or'd
> back in via enable_global_pages()?
It's fixed already ...
Powered by blists - more mailing lists