[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e259c5d-3367-4efb-8291-69fbbcb0003c@intel.com>
Date: Wed, 15 Oct 2025 14:17:19 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>, "tglx@...utronix.de"
<tglx@...utronix.de>, "mingo@...hat.com" <mingo@...hat.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>, "bp@...en8.de"
<bp@...en8.de>, "x86@...nel.org" <x86@...nel.org>
CC: "corbet@....net" <corbet@....net>, "ardb@...nel.org" <ardb@...nel.org>,
"andrew.cooper3@...rix.com" <andrew.cooper3@...rix.com>,
"alexander.shishkin@...ux.intel.com" <alexander.shishkin@...ux.intel.com>,
"luto@...nel.org" <luto@...nel.org>, "david.laight.linux@...il.com"
<david.laight.linux@...il.com>, "jpoimboe@...nel.org" <jpoimboe@...nel.org>,
"Luck, Tony" <tony.luck@...el.com>, "linux-efi@...r.kernel.org"
<linux-efi@...r.kernel.org>, "kas@...nel.org" <kas@...nel.org>,
"seanjc@...gle.com" <seanjc@...gle.com>, "dwmw@...zon.co.uk"
<dwmw@...zon.co.uk>, "rdunlap@...radead.org" <rdunlap@...radead.org>,
"vegard.nossum@...cle.com" <vegard.nossum@...cle.com>, "xin@...or.com"
<xin@...or.com>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "linux-doc@...r.kernel.org"
<linux-doc@...r.kernel.org>, "kees@...nel.org" <kees@...nel.org>,
"hpa@...or.com" <hpa@...or.com>, "peterz@...radead.org"
<peterz@...radead.org>, "geert@...ux-m68k.org" <geert@...ux-m68k.org>
Subject: Re: [PATCH v10 05/15] x86/cpu: Defer CR pinning enforcement until
late_initcall()
On 10/10/2025 1:45 PM, Sohil Mehta wrote:
>
> As we discussed in another thread, CR pinning has expanded beyond the
> original security related bits. They have become bits that are never
> expected to be modified once initialized. I wonder whether we could run
> into issues if the initial CR4 value on the APs doesn't have one of the
> pinned bits set. From a cursory look, everything should be fine (except
> maybe FRED). I could give it a try.
>
I tried this. Getting rid of the cr4_pinned_bits setting during
cr_init() seems to be working fine.
Xin says that there may be an existing issue with FRED, as CR4.FRED is
set before programming the FRED config MSRs in
cpu_init_fred_exceptions(). Any exceptions during that brief window,
though unlikely, would cause a triple fault. I think not setting
CR4.FRED might help the issue, but, I am not sure. I'll let Xin or Peter
evaluate this.
> But, is there a preference here? There is no additional cost of setting
> the pinned bits because we definitely need to program X86_CR4_PCIDE. Do
> we set the pinned bits along with that, or wait for the AP to go through
> the init flow and set them one by one?
>
As we are planning to defer CR pinning enforcement, I am inclining
towards getting rid of the following check in cr4_init().
if (static_branch_likely(&cr_pinning))
cr4 = (cr4 & ~cr4_pinned_mask) | cr4_pinned_bits;
AFAIU, this change shouldn't harm FRED. Resolving the existing FRED
issue can be done in a separate patch.
Powered by blists - more mailing lists