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: <20250219155745.GB337534@yaz-khff2.amd.com>
Date: Wed, 19 Feb 2025 10:57:45 -0500
From: Yazen Ghannam <yazen.ghannam@....com>
To: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
Cc: "x86@...nel.org" <x86@...nel.org>, "Luck, Tony" <tony.luck@...el.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
	"Smita.KoralahalliChannabasappa@....com" <Smita.KoralahalliChannabasappa@....com>
Subject: Re: [PATCH v2 07/16] x86/mce: Define BSP-only init

On Tue, Feb 18, 2025 at 03:16:49AM +0000, Zhuo, Qiuxu wrote:
> > From: Yazen Ghannam <yazen.ghannam@....com>
> > [...]
> > diff --git a/arch/x86/kernel/cpu/mce/amd.c
> > b/arch/x86/kernel/cpu/mce/amd.c index 302a310d0630..a4ef4ff1a7ff 100644
> > --- a/arch/x86/kernel/cpu/mce/amd.c
> > +++ b/arch/x86/kernel/cpu/mce/amd.c
> > @@ -656,9 +656,6 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
> >  	u32 low = 0, high = 0, address = 0;
> >  	int offset = -1;
> > 
> > -	mce_flags.overflow_recov =
> > cpu_feature_enabled(X86_FEATURE_OVERFLOW_RECOV);
> > -	mce_flags.succor	 =
> > cpu_feature_enabled(X86_FEATURE_SUCCOR);
> > -	mce_flags.smca		 =
> > cpu_feature_enabled(X86_FEATURE_SMCA);
> >  	mce_flags.amd_threshold	 = 1;
> > 
> > [...]
> > --- a/arch/x86/kernel/cpu/mce/core.c
> > +++ b/arch/x86/kernel/cpu/mce/core.c
> > [...]
> > +/* Called only on the boot CPU. */
> > +void cpu_mca_init(struct cpuinfo_x86 *c) {
> > +	u64 cap;
> > +
> > +	if (!mce_available(c))
> > +		return;
> > +
> > +	mce_flags.overflow_recov =
> > cpu_feature_enabled(X86_FEATURE_OVERFLOW_RECOV);
> > +	mce_flags.succor	 =
> > cpu_feature_enabled(X86_FEATURE_SUCCOR);
> > +	mce_flags.smca		 =
> > cpu_feature_enabled(X86_FEATURE_SMCA);
> 
> 1. Before this patch set, the above code was executed only if the following 
>     condition was true. Do we still need this check?
> 
>     if (c->x86_vendor == X86_VENDOR_AMD || c->x86_vendor == X86_VENDOR_HYGON) 
>     {
>           The above code.
>      }

I don't think so. Feature checks should be independent of vendor, so the
vendor checks are redundant.

> 
> 2. Can " mce_flags.amd_threshold  = 1;" also be moved here?
> 

No, because this flag is not based on a CPU feature. However, I think
more cleanup can be done for this, but that will come later.

Thanks,
Yazen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ