[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY8PR11MB7134E2BD84013EF41F8F5AC8894D2@CY8PR11MB7134.namprd11.prod.outlook.com>
Date: Wed, 23 Oct 2024 08:20:22 +0000
From: "Zhuo, Qiuxu" <qiuxu.zhuo@...el.com>
To: "Hansen, Dave" <dave.hansen@...el.com>, "Luck, Tony"
<tony.luck@...el.com>, "Mehta, Sohil" <sohil.mehta@...el.com>
CC: "bp@...en8.de" <bp@...en8.de>, "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 v2 06/10] x86/mce: Convert multiple if () statements into
a switch() statement
> From: Hansen, Dave <dave.hansen@...el.com>
> [...]
> On 10/21/24 09:06, Luck, Tony wrote:
> >> /*
> >> * All newer Intel systems support MCE broadcasting. Enable
> >> * synchronization with a one second timeout.
> >> */
> >> - if ((c->x86 > 6 || (c->x86 == 6 && c->x86_model >= 0xe)) &&
> >> - cfg->monarch_timeout < 0)
> >> + if (c->x86_vfm >= INTEL_CORE_YONAH && cfg->monarch_timeout <
> >> + 0)
> >> cfg->monarch_timeout = USEC_PER_SEC;
> > This change is correct. But the old code makes it more explicit that
> > CPUs in families > 6 take this action. As the author of the VFM
> > changes it's clear to me, maybe less so to others?
> >
> > But maybe its OK. The comment does help a lot. Anyone else have thoughts
> on this?
>
> It certainly is a bit subtle.
>
> To me, the earlier check would be even better if it were:
>
> - if (c->x86 < 6)
Thanks, Dave.
OK, I'll update it in the next version.
Apart from this, I'll also add a comment below, as suggested by Sohil, to make it explicit that it's for prior to family 6.
/* Older CPUs (prior to family 6) don't need quirks */
> + if (c->x86_vfm < INTEL_PENTIUM_PRO)
> return;
>
> That at least makes it more clear that it's a range of models and avoids having
> a ->x86 check mixed with a ->x86_vfm one.
Powered by blists - more mailing lists