[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a56307f-f280-4ce6-878e-98923ddc2102@intel.com>
Date: Thu, 24 Oct 2024 15:18:56 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Sohil Mehta <sohil.mehta@...el.com>, "Luck, Tony" <tony.luck@...el.com>,
"Zhuo, Qiuxu" <qiuxu.zhuo@...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
On 10/24/24 14:31, Sohil Mehta wrote:
> @@ -1924,6 +1924,10 @@ 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;
>
> + /* Older CPUs (prior to family 6) don't need quirks. */
> + if (c->x86_vfm < INTEL_PENTIUM_PRO)
> + return;
In case anyone grumbles, this is one of those expressions that's not
perfect, but I think it's quite good enough in practice.
It wouldn't work if we ever (for instance) moved 'vendor' to be less
significant bits than 'model'. Or on a CPU that claimed to be family=6
but model=0. But Intel never (as far as I know) sold a CPU like that,
so it's probably only possible in a VM where these checks are rather
worthless anyway.
In short, I think >=INTEL_PENTIUM_PRO is a great check that can mean
"family 6 or later" almost anywhere.
Powered by blists - more mailing lists