From: Borislav Petkov <bp@alien8.de>
To: Joongsun Moon-Lee <moontorise@cfg.kr>
Cc: x86@kernel.org, Thomas Gleixner <tglx@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H . Peter Anvin" <hpa@zytor.com>,
Peter Zijlstra <peterz@infradead.org>,
Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
Josh Poimboeuf <jpoimboe@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] x86/cpu: Refactor RFDS mitigation to use X86_FEATURE_RFDS_CLEAR
Date: Fri, 30 Jan 2026 22:40:26 +0100 [thread overview]
Message-ID: <20260130214026.GEaX0lSoVqbM9lInfr@fat_crate.local> (raw)
In-Reply-To: <20260130123340.1544-2-moontorise@cfg.kr>
On Fri, Jan 30, 2026 at 09:33:39PM +0900, Joongsun Moon-Lee wrote:
> The current RFDS mitigation logic relies on verw_clears_cpu_reg_file(),
> which directly checks the RFDS_CLEAR bit in the IA32_ARCH_CAPABILITIES MSR.
>
> To support quirks for CPUs that mitigate RFDS but do not enumerate it,
> transition to using the synthetic feature flag X86_FEATURE_RFDS_CLEAR.
>
> Replace the MSR-bit-based check with boot_cpu_has(X86_FEATURE_RFDS_CLEAR)
> and synthesize this feature bit in rfds_select_mitigation() if the
> architectural RFDS_CLEAR bit is present.
Please do not explain the diff - talk about why this patch exists and other
details which are not obvious from the code.
> @@ -670,7 +665,10 @@ static void __init rfds_select_mitigation(void)
> if (rfds_mitigation == RFDS_MITIGATION_OFF)
> return;
>
> - if (verw_clears_cpu_reg_file())
> + if (x86_arch_cap_msr & ARCH_CAP_RFDS_CLEAR)
> + setup_force_cpu_cap(X86_FEATURE_RFDS_CLEAR);
> +
> + if (boot_cpu_has(X86_FEATURE_RFDS_CLEAR))
> verw_clear_cpu_buf_mitigation_selected = true;
> }
So:
if (x86_arch_cap_msr & ARCH_CAP_RFDS_CLEAR) {
setup_force_cpu_cap(X86_FEATURE_RFDS_CLEAR);
verw_clear_cpu_buf_mitigation_selected = true;
}
?
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2026-01-30 21:40 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 15:43 [PATCH] x86/cpu/intel: Add RFDS mitigation quirk for Goldmont and Tremont-D moontorise
2026-01-29 16:37 ` Dave Hansen
2026-01-30 12:33 ` [PATCH v2 0/2] " Joongsun Moon-Lee
2026-01-30 12:33 ` [PATCH v2 1/2] x86/cpu: Refactor RFDS mitigation to use X86_FEATURE_RFDS_CLEAR Joongsun Moon-Lee
2026-01-30 21:40 ` Borislav Petkov [this message]
2026-01-30 12:33 ` [PATCH v2 2/2] x86/cpu/intel: Add implicit RFDS mitigation for Goldmont and Tremont-D Joongsun Moon-Lee
2026-01-30 17:50 ` Dave Hansen
2026-02-02 12:32 ` Joongsun Moon-Lee
2026-01-30 22:28 ` Sohil Mehta
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=20260130214026.GEaX0lSoVqbM9lInfr@fat_crate.local \
--to=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jpoimboe@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=moontorise@cfg.kr \
--cc=pawan.kumar.gupta@linux.intel.com \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
--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®