mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sohil Mehta <sohil.mehta@intel.com>
To: Xin Li <xin@zytor.com>, Dave Hansen <dave.hansen@intel.com>
Cc: <linux-kernel@vger.kernel.org>, <tglx@linutronix.de>,
	<mingo@redhat.com>, <bp@alien8.de>, <dave.hansen@linux.intel.com>,
	<x86@kernel.org>, <hpa@zytor.com>, <peterz@infradead.org>,
	<andrew.cooper3@citrix.com>, <nikunj@amd.com>,
	<thomas.lendacky@amd.com>, <seanjc@google.com>,
	<stable@vger.kernel.org>
Subject: Re: [PATCH v1] x86/smp: Set up exception handling before cr4_init()
Date: Mon, 9 Feb 2026 16:18:32 -0800	[thread overview]
Message-ID: <52e152b9-c840-4480-9337-0f0aca327543@intel.com> (raw)
In-Reply-To: <37de06e1-aae4-4ebd-ac93-1846ee4cd91e@intel.com>

On 2/8/2026 11:28 PM, Sohil Mehta wrote:
> I think Dave already posted the patch for it here.
> https://lore.kernel.org/lkml/02df7890-83c2-4047-8c88-46fbc6e0a892@intel.com/
> 
> I will test that out to confirm that it doesn't mess up some implicit
> behavior.
> 

I verified that the above patch works as expected. I added a debug print
in cpu_init_fred_exceptions() to test FRED behavior.

	if (cr4_read_shadow() & X86_CR4_FRED)
		pr_warn("FRED is already enabled on CPU%d\n",
			smp_processor_id());


With Dave's patch, the warning no longer shows up on APs.

However, I found another location where we enable FRED in CR4 before
enabling the MSRs.

__restore_processor_state():

...

  __write_cr4(ctxt->cr4);

...

  if (ctxt->cr4 & X86_CR4_FRED) {
    cpu_init_fred_exceptions();
    cpu_init_fred_rsps();
  }

Due to limitations of my test platform, I couldn't verify the FRED print
in __restore_processor_state()'s path. But, could "restore" run into a
similar issue in the future?

  parent reply	other threads:[~2026-02-10  0:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 18:50 Xin Li (Intel)
2026-02-06 19:19 ` Dave Hansen
2026-02-08 19:02   ` Xin Li
2026-02-09  7:28     ` Sohil Mehta
2026-02-09  8:16       ` Xin Li
2026-02-09 15:14         ` Dave Hansen
2026-02-10  0:18       ` Sohil Mehta [this message]
2026-02-10  1:13         ` Dave Hansen
2026-02-10  3:11           ` Xin Li

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=52e152b9-c840-4480-9337-0f0aca327543@intel.com \
    --to=sohil.mehta@intel.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nikunj@amd.com \
    --cc=peterz@infradead.org \
    --cc=seanjc@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    --cc=xin@zytor.com \
    /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®