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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB71344FF8D9EA706AFA74618A89542@CY8PR11MB7134.namprd11.prod.outlook.com>
Date: Wed, 30 Oct 2024 01:39:43 +0000
From: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To: Yazen Ghannam <yazen.ghannam@....com>
CC: "bp@...en8.de" <bp@...en8.de>, "Luck, Tony" <tony.luck@...el.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>, "dave.hansen@...ux.intel.com"
	<dave.hansen@...ux.intel.com>, "mingo@...hat.com" <mingo@...hat.com>,
	"hpa@...or.com" <hpa@...or.com>, "x86@...nel.org" <x86@...nel.org>,
	"linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v3 06/10] x86/mce: Break up __mcheck_cpu_apply_quirks()

Hi Yazen,

> From: Yazen Ghannam <yazen.ghannam@....com>
> [...]
> > +static void apply_quirks_amd(struct cpuinfo_x86 *c) {
> > +	struct mce_bank *mce_banks = this_cpu_ptr(mce_banks_array);
> > +	struct mca_config *cfg = &mca_cfg;
> > +
> > +	/* This should be disabled by the BIOS, but isn't always */
> > +	if (c->x86 == 15 && this_cpu_read(mce_num_banks) > 4) {
> > +		/*
> > +		 * disable GART TBL walk error reporting, which
> > +		 * trips off incorrectly with the IOMMU & 3ware
> > +		 * & Cerberus:
> > +		 */
> > +		clear_bit(10, (unsigned long *)&mce_banks[4].ctl);
> > +	}
> 
> Newline here please.

OK. 
Will update it in next version.

> > +	if (c->x86 < 0x11 && cfg->bootlog < 0) {
> > +		/*
> > +		 * Lots of broken BIOS around that don't clear them
> > +		 * by default and leave crap in there. Don't log:
> > +		 */
> > +		cfg->bootlog = 0;
> > +	}
> 
> And here.

And will update it in next version.

> [...]

> > +static void apply_quirks_intel(struct cpuinfo_x86 *c) {
> > +	struct mce_bank *mce_banks = this_cpu_ptr(mce_banks_array);
> > +	struct mca_config *cfg = &mca_cfg;
> 
> Is there a benefit to this pointer? We use mca_cfg.FIELD in most other places.

This could make the diff smaller for easier review, and I also believe that fewer direct
uses of global variables in functions are better. Additionally, there are multiple uses of
'mca_cfg' in the function, the local variable 'cfg' is shorter and more convenient to use.

[ Certainly, if the global variable 'mca_cfg' is only used once in the function, directly
  using it might be more convenient. ]

Just from my perspective, no strong preference. 😊

-Qiuxu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ