From: Sohil Mehta <sohil.mehta@intel.com>
To: Nikunj A Dadhania <nikunj@amd.com>,
<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
<bp@alien8.de>, <thomas.lendacky@amd.com>,
<dave.hansen@linux.intel.com>
Cc: <tglx@kernel.org>, <mingo@redhat.com>, <hpa@zytor.com>,
<xin@zytor.com>, <seanjc@google.com>, <pbonzini@redhat.com>,
<x86@kernel.org>, <chang.seok.bae@intel.com>, <jon.grimm@amd.com>
Subject: Re: [PATCH v3 1/3] x86/cpu: Enable FSGSBASE early in cpu_init_exception_handling()
Date: Wed, 18 Mar 2026 06:54:46 -0700 [thread overview]
Message-ID: <d3140cf6-e61a-40a5-8153-300d5fe07954@intel.com> (raw)
In-Reply-To: <20260318075654.1792916-2-nikunj@amd.com>
Hi Nikunj,
The code changes and the commit message looks fine to me. I would
suggest a minor correction to the code comment and the commit log. I
found it slightly misleading. It can probably be fixed up while applying
as well.
On 3/18/2026 12:56 AM, Nikunj A Dadhania wrote:
> Move FSGSBASE enablement from identify_cpu() to
> cpu_init_exception_handling() to ensure it is enabled before any exceptions
> can occur on both boot and secondary CPUs.
>
It would be more accurate to say ".. before any exceptions that uses
paranoid_entry() can occur.."
I think early exceptions such #VC can still occur and the
bringup_idt_table is set up to handle those.
> == Background ==
...
> + /*
> + * On CPUs with FSGSBASE support, paranoid_entry() uses
> + * ALTERNATIVE-patched RDGSBASE/WRGSBASE instructions. Secondary CPUs
> + * boot after alternatives are patched globally, so early exceptions
> + * execute patched code that depends on FSGSBASE. Enable the feature
> + * before any exceptions occur.
On similar lines. I suggest getting rid of the last line: "Enable the
feature before any exceptions occur." The rest looks fine to me.
> + */
> + if (cpu_feature_enabled(X86_FEATURE_FSGSBASE)) {
> + cr4_set_bits(X86_CR4_FSGSBASE);
> + elf_hwcap2 |= HWCAP2_FSGSBASE;
> + }
> +
Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
next prev parent reply other threads:[~2026-03-18 13:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-18 7:56 [PATCH v3 0/3] x86/fred: Fix SEV-ES/SNP guest boot failures Nikunj A Dadhania
2026-03-18 7:56 ` [PATCH v3 1/3] x86/cpu: Enable FSGSBASE early in cpu_init_exception_handling() Nikunj A Dadhania
2026-03-18 13:54 ` Sohil Mehta [this message]
2026-03-18 15:39 ` Borislav Petkov
2026-03-18 15:53 ` Dave Hansen
2026-03-18 16:49 ` Sohil Mehta
2026-03-18 7:56 ` [PATCH v3 2/3] x86/cpu: Disable CR pinning during CPU bringup Nikunj A Dadhania
2026-03-18 7:56 ` [PATCH v3 3/3] x86/fred: Fix early boot failures on SEV-ES/SNP guests Nikunj A Dadhania
2026-03-18 11:43 ` [PATCH v3 0/3] x86/fred: Fix SEV-ES/SNP guest boot failures Borislav Petkov
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=d3140cf6-e61a-40a5-8153-300d5fe07954@intel.com \
--to=sohil.mehta@intel.com \
--cc=bp@alien8.de \
--cc=chang.seok.bae@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jon.grimm@amd.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nikunj@amd.com \
--cc=pbonzini@redhat.com \
--cc=seanjc@google.com \
--cc=tglx@kernel.org \
--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