lkml.org 
[lkml]   [2017]   [Nov]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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 ...

\
 
 \ /
  Last update: 2017-11-27 22:18    [W:0.057 / U:0.784 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site