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] [day] [month] [year] [list]
Message-ID: <20250811205529.GBaJpYwcmMfEFqEicm@fat_crate.local>
Date: Mon, 11 Aug 2025 22:55:29 +0200
From: Borislav Petkov <bp@...en8.de>
To: Yazen Ghannam <yazen.ghannam@....com>
Cc: x86@...nel.org, Tony Luck <tony.luck@...el.com>,
	linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] x86/mce: Use ZENx features for Zen IF quirk

On Mon, Aug 11, 2025 at 04:34:08PM -0400, Yazen Ghannam wrote:
> diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
> index 4da4eab56c81..0ef164568077 100644
> --- a/arch/x86/kernel/cpu/mce/core.c
> +++ b/arch/x86/kernel/cpu/mce/core.c
> @@ -1951,8 +1951,11 @@ static void apply_quirks_amd(struct cpuinfo_x86 *c)
>  	if (c->x86 == 0x15 && c->x86_model <= 0xf)
>  		mce_flags.overflow_recov = 1;
>  
> -	if (c->x86 >= 0x17 && c->x86 <= 0x1A)
> -		mce_flags.zen_ifu_quirk = 1;
> +	mce_flags.zen_ifu_quirk = cpu_feature_enabled(X86_FEATURE_ZEN1) ||
> +				  cpu_feature_enabled(X86_FEATURE_ZEN2) ||
> +				  cpu_feature_enabled(X86_FEATURE_ZEN3) ||
> +				  cpu_feature_enabled(X86_FEATURE_ZEN4) ||
> +				  cpu_feature_enabled(X86_FEATURE_ZEN5);

I was fearing this day would come where we'd need something like that and it
would look gross. And it does.

Can't we simplify the quirk to do:

	if (!m->cs)
		m->cs = regs->cs;

when X86_FEATURE_ZEN is set and that should be good enough if we squint our
eyes hard enough...

m->cs on the fixed machines won't be 0 so it all just works...

-- 
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