RAS changes for v4.4
Linus,
Please pull the latest ras-core-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git ras-core-for-linus
# HEAD: dc34bdd2367fd31744ee3ba1de1b1cc0fa2ce193 x86/mce: Add a default case to the switch in __mcheck_cpu_ancient_init()
The main system reliability related changes were from x86, but also some generic RAS changes:
- AMD MCE error injection subsystem enhancements. (Aravind Gopalakrishnan)
- Fix MCE and CPU hotplug interaction bug. (Ashok Raj)
- kcrash bootup robustness fix. (Baoquan He)
- kcrash cleanups. (Borislav Petkov)
- x86 microcode driver rework: simplify it by unmodularizing it and other cleanups. (Borislav Petkov)
Thanks,
Ingo
------------------>
Andi Kleen (1):
x86/mce: Fix thermal throttling reporting after kexec
Aravind Gopalakrishnan (5):
x86/ras/mce_amd_inj: Return early on invalid input x86/ras/mce_amd_inj: Trigger deferred and thresholding errors interrupts x86/ras/mce_amd_inj: Inject bank 4 errors on the NBC x86/amd_nb, EDAC: Rename amd_get_node_id()
x86/mce: Add a Scalable MCA vendor flags bit
Ashok Raj (1):
x86/mce: Don't clear shared banks on Intel when offlining CPUs
Baoquan He (1):
x86/setup: Do not reserve crashkernel high memory if low reservation failed
Borislav Petkov (14):
x86/microcode/amd: Extract current patch level read to a function x86/microcode/amd: Do not overwrite final patch levels x86/setup: Cleanup crashkernel reservation functions x86/setup/crash: Remove alignment variable
x86/setup/crash: Cleanup some more
x86/setup/crash: Check memblock_reserve() retval kexec/crash: Say which char is the unrecognized x86/microcode: Unmodularize the microcode driver x86/microcode: Merge the early microcode loader x86/microcode: Remove modularization leftovers x86/microcode/amd: Remove maintainers from comments x86/microcode/intel: Move #ifdef DEBUG inside the function
MAINTAINERS: Unify the microcode driver section
x86/mce: Add a default case to the switch in __mcheck_cpu_ancient_init()
Gabriel Laskar (1):
x86/mce: Include linux/ioctl.h in uapi mce header
MAINTAINERS | 16 +- arch/x86/Kconfig | 22 +- arch/x86/include/asm/amd_nb.h | 2 +- arch/x86/include/asm/mce.h | 34 +- arch/x86/include/asm/microcode.h | 26 +- arch/x86/include/asm/microcode_amd.h | 3 +- arch/x86/include/asm/microcode_intel.h | 10 +- arch/x86/include/uapi/asm/mce.h | 2 +- arch/x86/kernel/cpu/mcheck/mce.c | 34 +- arch/x86/kernel/cpu/mcheck/therm_throt.c | 8 - arch/x86/kernel/cpu/microcode/Makefile | 3 - arch/x86/kernel/cpu/microcode/amd.c | 509 +++++++++++++++++- arch/x86/kernel/cpu/microcode/amd_early.c | 440 --------------- arch/x86/kernel/cpu/microcode/core.c | 232 +++++--- arch/x86/kernel/cpu/microcode/core_early.c | 170 ------ arch/x86/kernel/cpu/microcode/intel.c | 791 ++++++++++++++++++++++++++- arch/x86/kernel/cpu/microcode/intel_early.c | 808 ---------------------------- arch/x86/kernel/cpu/microcode/intel_lib.c | 1 - arch/x86/kernel/head_32.S | 5 +- arch/x86/kernel/setup.c | 102 ++-- arch/x86/mm/init.c | 2 - arch/x86/ras/Kconfig | 4 +- arch/x86/ras/mce_amd_inj.c | 103 +++- drivers/edac/amd64_edac.c | 6 +- kernel/kexec_core.c | 6 +- 25 files changed, 1678 insertions(+), 1661 deletions(-) delete mode 100644 arch/x86/kernel/cpu/microcode/amd_early.c delete mode 100644 arch/x86/kernel/cpu/microcode/core_early.c delete mode 100644 arch/x86/kernel/cpu/microcode/intel_early.c
MAINTAINERS +5 -11
@@ -654,11 +654,6 @@ F: drivers/gpu/drm/radeon/radeon_kfd.c F: drivers/gpu/drm/radeon/radeon_kfd.h F: include/uapi/linux/kfd_ioctl.h -AMD MICROCODE UPDATE SUPPORT -M: Borislav Petkov <[email protected]> -S: Maintained -F: arch/x86/kernel/cpu/microcode/amd* - AMD XGBE DRIVER M: Tom Lendacky <[email protected]> L: [email protected]
@@ -5430,12 +5425,6 @@ W: https://01.org/linux-acpi S: Supported F: drivers/platform/x86/intel_menlow.c -INTEL IA32 MICROCODE UPDATE SUPPORT -M: Borislav Petkov <[email protected]> -S: Maintained -F: arch/x86/kernel/cpu/microcode/core* -F: arch/x86/kernel/cpu/microcode/intel* - INTEL I/OAT DMA DRIVER M: Dave Jiang <[email protected]> R: Dan Williams <[email protected]>
@@ -11451,6 +11440,11 @@ L: [email protected] S: Maintained F: arch/x86/kernel/cpu/mcheck/* +X86 MICROCODE UPDATE SUPPORT +M: Borislav Petkov <[email protected]> +S: Maintained +F: arch/x86/kernel/cpu/microcode/* + X86 VDSO M: Andy Lutomirski <[email protected]> L: [email protected]
arch/x86/Kconfig +3 -19
@@ -1123,8 +1123,10 @@ config X86_REBOOTFIXUPS Say N otherwise. config MICROCODE - tristate "CPU microcode loading support" + bool "CPU microcode loading support" + default y depends on CPU_SUP_AMD || CPU_SUP_INTEL + depends on BLK_DEV_INITRD select FW_LOADER ---help---
@@ -1166,24 +1168,6 @@ config MICROCODE_OLD_INTERFACE def_bool y depends on MICROCODE -config MICROCODE_INTEL_EARLY - bool - -config MICROCODE_AMD_EARLY - bool - -config MICROCODE_EARLY - bool "Early load microcode" - depends on MICROCODE=y && BLK_DEV_INITRD - select MICROCODE_INTEL_EARLY if MICROCODE_INTEL - select MICROCODE_AMD_EARLY if MICROCODE_AMD - default y - help - This option provides functionality to read additional microcode data - at the beginning of initrd image. The data tells kernel to load - microcode to CPU's as early as possible. No functional change if no - microcode data is glued to the initrd, therefore it's safe to say Y. - config X86_MSR tristate "/dev/cpu/*/msr - Model-specific register support" ---help---
arch/x86/include/asm/amd_nb.h +1 -1
@@ -81,7 +81,7 @@ static inline struct amd_northbridge *node_to_amd_nb(int node)return (node < amd_northbridges.num) ? &amd_northbridges.nb[node] :NULL ; } -static inline u16 amd_get_node_id (struct pci_dev *pdev) +static inline u16 amd_pci_dev_to_node_id (struct pci_dev *pdev) {struct pci_dev *misc;int i;
arch/x86/include/asm/mce.h +21 -13
@@ -123,19 +123,27 @@ struct mca_config { };struct mce_vendor_flags { -/* -* overflow recovery cpuid bit indicates that overflow -* conditions are not fatal -*/ -__u64 overflow_recov :1 , - -/* -* SUCCOR stands for S/W UnCorrectable error COntainment -* and Recovery. It indicates support for data poisoning -* in HW and deferred error interrupts. -*/ - succor :1 , - __reserved_0 :62 ; +/* +* Indicates that overflow conditions are not fatal, when set. +*/ +__u64 overflow_recov :1 , + +/* +* (AMD) SUCCOR stands for S/W UnCorrectable error COntainment and +* Recovery. It indicates support for data poisoning in HW and deferred +* error interrupts. +*/ + succor :1 , + +/* +* (AMD) SMCA: This bit indicates support for Scalable MCA which expands +* the register space for each MCA bank and also increases number of +* banks. Also, to accommodate the new banks and registers, the MCA +* register space is moved to a new MSR range. +*/ + smca :1 , + + __reserved_0 :61 ; };extern struct mce_vendor_flags mce_flags;
arch/x86/include/asm/microcode.h +13 -13
@@ -27,7 +27,6 @@ struct cpu_signature {struct device ;enum ucode_state {UCODE_ERROR ,UCODE_OK ,UCODE_NFOUND }; -extern bool dis_ucode_ldr;struct microcode_ops { enum ucode_state (*request_microcode_user) (int cpu,
@@ -55,6 +54,12 @@ struct ucode_cpu_info { };extern struct ucode_cpu_info ucode_cpu_info[]; +#ifdef CONFIG_MICROCODE +int __init microcode_init (void ); +#else +static inline int __init microcode_init (void ) {return 0 ; }; +#endif +#ifdef CONFIG_MICROCODE_INTEL extern struct microcode_ops *__init init_intel_microcode (void );#else
@@ -75,7 +80,6 @@ static inline struct microcode_ops * __init init_amd_microcode(void) static inline void __exit exit_amd_microcode(void) {}#endif -#ifdef CONFIG_MICROCODE_EARLY #define MAX_UCODE_COUNT 128#define QCHAR (a, b, c, d) ((a) + ((b) << 8) + ((c) << 16) + ((d) << 24))
@@ -150,22 +154,18 @@ static inline unsigned int x86_model(unsigned int sig) return model; } +#ifdef CONFIG_MICROCODE extern void __init load_ucode_bsp (void );extern void load_ucode_ap (void );extern int __init save_microcode_in_initrd (void );void reload_early_microcode (void );extern bool get_builtin_firmware (struct cpio_data *cd,const char *name);#else -static inline void __init load_ucode_bsp (void ) {} -static inline void load_ucode_ap (void ) {} -static inline int __init save_microcode_in_initrd (void ) -{ -return 0 ; -} -static inline void reload_early_microcode (void ) {} -static inline bool get_builtin_firmware (struct cpio_data *cd,const char *name) -{ -return false; -} +static inline void __init load_ucode_bsp (void ) { } +static inline void load_ucode_ap (void ) { } +static inline int __init save_microcode_in_initrd (void ) {return 0 ; } +static inline void reload_early_microcode (void ) { } +static inline bool +get_builtin_firmware (struct cpio_data *cd,const char *name) {return false; }#endif #endif /* _ASM_X86_MICROCODE_H */
arch/x86/include/asm/microcode_amd.h +2 -1
@@ -64,7 +64,7 @@ extern enum ucode_state load_microcode_amd(int cpu, u8 family, const u8 *data, s#define PATCH_MAX_SIZE PAGE_SIZEextern u8 amd_ucode_patch[PATCH_MAX_SIZE ]; -#ifdef CONFIG_MICROCODE_AMD_EARLY +#ifdef CONFIG_MICROCODE_AMD extern void __init load_ucode_amd_bsp (unsigned int family);extern void load_ucode_amd_ap (void );extern int __init save_microcode_in_initrd_amd (void );
@@ -76,4 +76,5 @@ static inline int __init save_microcode_in_initrd_amd(void) { return -EINVAL; }void reload_ucode_amd (void ) {}#endif +extern bool check_current_patch_level (u32 *rev,bool early);#endif /* _ASM_X86_MICROCODE_AMD_H */
arch/x86/include/asm/microcode_intel.h +3 -7
@@ -57,7 +57,7 @@ extern int has_newer_microcode(void *mc, unsigned int csig, int cpf, int rev);extern int microcode_sanity_check (void *mc,int print_err);extern int find_matching_signature (void *mc,unsigned int csig,int cpf); -#ifdef CONFIG_MICROCODE_INTEL_EARLY +#ifdef CONFIG_MICROCODE_INTEL extern void __init load_ucode_intel_bsp (void );extern void load_ucode_intel_ap (void );extern void show_ucode_info_early (void );
@@ -71,13 +71,9 @@ static inline int __init save_microcode_in_initrd_intel(void) { return -EINVAL;static inline void reload_ucode_intel (void ) {}#endif -#if defined(CONFIG_MICROCODE_INTEL_EARLY ) && defined(CONFIG_HOTPLUG_CPU ) +#ifdef CONFIG_HOTPLUG_CPU extern int save_mc_for_early (u8 *mc);#else -static inline int save_mc_for_early (u8 *mc) -{ -return 0 ; -} +static inline int save_mc_for_early (u8 *mc) {return 0 ; }#endif -#endif /* _ASM_X86_MICROCODE_INTEL_H */
arch/x86/include/uapi/asm/mce.h +1 -1
@@ -2,7 +2,7 @@#define _UAPI_ASM_X86_MCE_H#include <linux/types.h> -#include <asm/ioctls.h> +#include <linux/ioctl.h> /* Fields are zero when not available */ struct mce {
arch/x86/kernel/cpu/mcheck/mce.c +24 -10
@@ -1586,6 +1586,8 @@ static int __mcheck_cpu_ancient_init(struct cpuinfo_x86 *c)winchip_mcheck_init (c);return 1 ;break ; +default : +return 0 ; }return 0 ;
@@ -1605,6 +1607,8 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c)mce_amd_feature_init (c); mce_flags.overflow_recov = !!(ebx &BIT (0 )); mce_flags.succor = !!(ebx &BIT (1 )); + mce_flags.smca = !!(ebx &BIT (3 )); +break ; }
@@ -2042,7 +2046,7 @@ int __init mcheck_init(void)* Disable machine checks on suspend and shutdown. We can't really handle * them later. */ -static int mce_disable_error_reporting (void ) +static void mce_disable_error_reporting (void ) {int i;
@@ -2052,17 +2056,32 @@ static int mce_disable_error_reporting(void)if (b->init)wrmsrl (MSR_IA32_MCx_CTL (i),0 ); } -return 0 ; +return ; +} + +static void vendor_disable_error_reporting (void ) +{ +/* +* Don't clear on Intel CPUs. Some of these MSRs are socket-wide. +* Disabling them for just a single offlined CPU is bad, since it will +* inhibit reporting for all shared resources on the socket like the +* last level cache (LLC), the integrated memory controller (iMC), etc. +*/ +if (boot_cpu_data.x86_vendor ==X86_VENDOR_INTEL ) +return ; + +mce_disable_error_reporting (); }static int mce_syscore_suspend (void ) { -return mce_disable_error_reporting (); +vendor_disable_error_reporting (); +return 0 ; }static void mce_syscore_shutdown (void ) { -mce_disable_error_reporting (); +vendor_disable_error_reporting (); }/*
@@ -2342,19 +2361,14 @@ static void mce_device_remove(unsigned int cpu)static void mce_disable_cpu (void *h) {unsigned long action = *(unsigned long *)h; -int i;if (!mce_available (raw_cpu_ptr (&cpu_info)))return ;if (!(action &CPU_TASKS_FROZEN ))cmci_clear (); -for (i =0 ; i < mca_cfg.banks; i++) { -struct mce_bank *b = &mce_banks[i]; -if (b->init) -wrmsrl (MSR_IA32_MCx_CTL (i),0 ); - } +vendor_disable_error_reporting (); }static void mce_reenable_cpu (void *h)
arch/x86/kernel/cpu/mcheck/therm_throt.c +0 -8
@@ -503,14 +503,6 @@ void intel_init_thermal(struct cpuinfo_x86 *c)return ; } -/* Check whether a vector already exists */ -if (h &APIC_VECTOR_MASK ) { -printk (KERN_DEBUG -"CPU%d: Thermal LVT vector (%#x) already installed\n" , - cpu, (h &APIC_VECTOR_MASK )); -return ; - } -/* early Pentium M models use different method for enabling TM2 */ if (cpu_has (c,X86_FEATURE_TM2 )) {if (c->x86 ==6 && (c->x86_model ==9 || c->x86_model ==13 )) {
arch/x86/kernel/cpu/microcode/Makefile +0 -3
@@ -2,6 +2,3 @@ microcode-y := core.o obj-$(CONFIG_MICROCODE) += microcode.o microcode-$(CONFIG_MICROCODE_INTEL) += intel.o intel_lib.o microcode-$(CONFIG_MICROCODE_AMD) += amd.o -obj-$(CONFIG_MICROCODE_EARLY) += core_early.o -obj-$(CONFIG_MICROCODE_INTEL_EARLY) += intel_early.o -obj-$(CONFIG_MICROCODE_AMD_EARLY) += amd_early.o
arch/x86/kernel/cpu/microcode/amd.c +492 -17
571 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/amd_early.c deleted +0 -440
440 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/core.c +169 -63
288 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/core_early.c deleted +0 -170
170 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/intel.c +784 -7
818 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/intel_early.c deleted +0 -808
398 lines not on this page · raw message
arch/x86/kernel/cpu/microcode/intel_lib.c +0 -1
Lines of this file are not shown. View the raw message.
arch/x86/kernel/setup.c +55 -47
102 lines not on this page · raw message
arch/x86/ras/mce_amd_inj.c +96 -7
103 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Part of the diff is not shown here. View the raw message.