lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260130214026.GEaX0lSoVqbM9lInfr@fat_crate.local>
Date: Fri, 30 Jan 2026 22:40:26 +0100
From: Borislav Petkov <bp@...en8.de>
To: Joongsun Moon-Lee <moontorise@....kr>
Cc: x86@...nel.org, Thomas Gleixner <tglx@...nel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	"H . Peter Anvin" <hpa@...or.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>,
	Josh Poimboeuf <jpoimboe@...nel.org>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/2] x86/cpu: Refactor RFDS mitigation to use
 X86_FEATURE_RFDS_CLEAR

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ