From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Hugh Dickins <hughd@google.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] x86/mm: Introduce 'no5lvl' kernel parameter
Date: Tue, 15 May 2018 00:50:57 +0300 [thread overview]
Message-ID: <20180514215057.yodhn3nk37fnsxui@black.fi.intel.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1805132339240.1582@nanos.tec.linutronix.de>
On Sun, May 13, 2018 at 09:55:00PM +0000, Thomas Gleixner wrote:
> On Fri, 11 May 2018, Kirill A. Shutemov wrote:
> > --- a/arch/x86/kernel/cpu/common.c
> > +++ b/arch/x86/kernel/cpu/common.c
> > @@ -1008,6 +1008,12 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
> > */
> > setup_clear_cpu_cap(X86_FEATURE_PCID);
> > #endif
> > +
> > +#ifdef CONFIG_X86_5LEVEL
> > + /* Clear the 5-level paging feature if user asked for 'no5lvl' */
>
> no5lvl is only one reason why 5 level paging is not available.
The 5-level paging may not be available for few reasons:
- CONFIG_X86_5LEVEL=n
- Machine doesn't support X86_FEATURE_LA57 -- clearing is nop;
- User asked for 'no5lvl'.
To me the one-line comment reflects the situation reasonably well.
Do you want more verbose comment here?
> > + if (!__pgtable_l5_enabled)
> > + setup_clear_cpu_cap(X86_FEATURE_LA57);
> > +#endif
>
> And that #ifdeffery can be avoided by simply doing:
>
> if (IS_ENABLED(CONFIG_X86_5LEVEL) && !pgtable_l5_enabled)
> setup_clear_cpu_cap(X86_FEATURE_LA57);
>
> Hmm?
Unfortunately, no.
pgtable_l5_enabled is defined as cpu_feature_enabled(X86_FEATURE_LA57).
So with such change we would only clear the feature bit if it's already
clear.
--
Kirill A. Shutemov
next prev parent reply other threads:[~2018-05-14 21:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-11 12:08 [PATCH 0/2] 5-level paging changes from v4.18 Kirill A. Shutemov
2018-05-11 12:08 ` [PATCH 1/2] x86/boot/compressed/64: Fix trampoline page table address calculation Kirill A. Shutemov
2018-05-11 12:08 ` [PATCH 2/2] x86/mm: Introduce 'no5lvl' kernel parameter Kirill A. Shutemov
2018-05-13 21:55 ` Thomas Gleixner
2018-05-14 21:50 ` Kirill A. Shutemov [this message]
2018-05-15 23:45 ` Thomas Gleixner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180514215057.yodhn3nk37fnsxui@black.fi.intel.com \
--to=kirill.shutemov@linux.intel.com \
--cc=hpa@zytor.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®