[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241112152716.GB3017802@yaz-khff2.amd.com>
Date: Tue, 12 Nov 2024 10:27:16 -0500
From: Yazen Ghannam <yazen.ghannam@....com>
To: Qiuxu Zhuo <qiuxu.zhuo@...el.com>
Cc: bp@...en8.de, tony.luck@...el.com, tglx@...utronix.de,
dave.hansen@...ux.intel.com, mingo@...hat.com, hpa@...or.com,
sohil.mehta@...el.com, nik.borisov@...e.com, x86@...nel.org,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 5/8] x86/mce: Convert family/model mixed checks to
VFM-based checks
On Mon, Nov 11, 2024 at 02:04:25PM +0800, Qiuxu Zhuo wrote:
> Convert family/model mixed checks to VFM-based checks to make
> the code more compact.
>
> Suggested-by: Sohil Mehta <sohil.mehta@...el.com>
> Suggested-by: Dave Hansen <dave.hansen@...el.com>
> Reviewed-by: Tony Luck <tony.luck@...el.com>
> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@...el.com>
> ---
> Changes in v4:
> - No changes but rebased.
>
> Changes in v3:
> - Newly added.
>
> arch/x86/kernel/cpu/mce/core.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
> index 3855ec2ed0e0..d288cc7390f6 100644
> --- a/arch/x86/kernel/cpu/mce/core.c
> +++ b/arch/x86/kernel/cpu/mce/core.c
> @@ -1954,6 +1954,10 @@ static void apply_quirks_intel(struct cpuinfo_x86 *c)
> {
> struct mce_bank *mce_banks = this_cpu_ptr(mce_banks_array);
>
> + /* Older CPUs (prior to family 6) don't need quirks. */
> + if (c->x86_vfm < INTEL_PENTIUM_PRO)
> + return;
> +
Is it possible for pre-"family 6" to get here?
Family 5 is "ancient" which has its own MCE init path. And I assume
anything older doesn't support MCE/MCA. Is this correct?
> /*
> * SDM documents that on family 6 bank 0 should not be written
> * because it aliases to another special BIOS controlled
> @@ -1962,22 +1966,21 @@ static void apply_quirks_intel(struct cpuinfo_x86 *c)
> * Don't ignore bank 0 completely because there could be a
> * valid event later, merely don't write CTL0.
> */
> - if (c->x86 == 6 && c->x86_model < 0x1A && this_cpu_read(mce_num_banks) > 0)
> + if (c->x86_vfm < INTEL_NEHALEM_EP && this_cpu_read(mce_num_banks) > 0)
The "> 0" is not needed, since mce_num_banks is unsigned int.
Otherwise, looks good.
Reviewed-by: Yazen Ghannam <yazen.ghannam@....com>
Thanks,
Yazen
Powered by blists - more mailing lists