Patch "x86/mce: Init some CPU features early" has been added to the 4.9-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
x86/mce: Init some CPU features early
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
x86-mce-init-some-cpu-features-early.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From foo@baz Sun Mar 18 16:55:33 CET 2018
From: Yazen Ghannam <[email protected]>
Date: Wed, 15 Mar 2017 12:30:55 -0500
Subject: x86/mce: Init some CPU features early
From: Yazen Ghannam <[email protected]>
[ Upstream commit 5204bf17031b69fa5faa4dc80a9dc1e2446d74f9 ]
When the MCA banks in __mcheck_cpu_init_generic() are polled for leftover errors logged during boot or from the previous boot, its required to have CPU features detected sufficiently so that the reading out and handling of those early errors is done correctly.
If those features are not available, the decoding may miss some information and get incomplete errors logged. For example, on SMCA systems the MCA_IPID and MCA_SYND registers are not logged and MCA_ADDR is not masked appropriately.
To cure that, do a subset of the basic feature detection early while the rest happens in its usual place in __mcheck_cpu_init_vendor().
--- arch/x86/kernel/cpu/mcheck/mce.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-)
Patches currently in stable-queue which might be from [email protected] are
queue-4.9/x86-mce-init-some-cpu-features-early.patch
--
To unsubscribe from this list: send the line "unsubscribe linux-edac" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
arch/x86/kernel/cpu/mcheck/mce.c +18 -12
@@ -1695,30 +1695,35 @@ static int __mcheck_cpu_ancient_init(strreturn 0 ; } -static void __mcheck_cpu_init_vendor (struct cpuinfo_x86 *c) +/* +* Init basic CPU features needed for early decoding of MCEs. +*/ +static void __mcheck_cpu_init_early (struct cpuinfo_x86 *c) { -switch (c->x86_vendor) { -case X86_VENDOR_INTEL : -mce_intel_feature_init (c); - mce_adjust_timer = cmci_intel_adjust_timer; -break ; - -case X86_VENDOR_AMD : { +if (c->x86_vendor ==X86_VENDOR_AMD ) { mce_flags.overflow_recov = !!cpu_has (c,X86_FEATURE_OVERFLOW_RECOV ); mce_flags.succor = !!cpu_has (c,X86_FEATURE_SUCCOR ); mce_flags.smca = !!cpu_has (c,X86_FEATURE_SMCA ); -/* -* Install proper ops for Scalable MCA enabled processors -*/ if (mce_flags.smca) { msr_ops.ctl = smca_ctl_reg; msr_ops.status = smca_status_reg; msr_ops.addr = smca_addr_reg; msr_ops.misc = smca_misc_reg; } -mce_amd_feature_init (c); + } +} +static void __mcheck_cpu_init_vendor (struct cpuinfo_x86 *c) +{ +switch (c->x86_vendor) { +case X86_VENDOR_INTEL : +mce_intel_feature_init (c); + mce_adjust_timer = cmci_intel_adjust_timer; +break ; + +case X86_VENDOR_AMD : { +mce_amd_feature_init (c);break ; }
@@ -1804,6 +1809,7 @@ void mcheck_cpu_init(struct cpuinfo_x86 machine_check_vector = do_machine_check; +__mcheck_cpu_init_early (c);__mcheck_cpu_init_generic ();__mcheck_cpu_init_vendor (c);__mcheck_cpu_init_clear_banks ();