x86/RAS queue for 4.3
Subsystems (7)
Borislav Petkov
maintainercover x86/RAS queue for 4.3
From: Borislav Petkov <[email protected]>
Hi Ingo,
here's the reworked RAS queue. 1-8 are the ones which Tony already sent you. They, esp. 5/13 and the ones leading up to it deal with printk'ing from #MC context. We're basically switching to lockless gen_pool for that.
Patch 9 is a fix for correctable errors polling (CMCI) where the CMCI interrupt doesn't get reenabled. This has been this way since 3.15 thus the stable tag. You might want to queue it to x86/urgent, if possible.
The rest is small cleanups and moving the MCE injector to arch/x86/ras/. This will be even more useful later when we start cleaning up the error decoding paths and need a quick way to inject errors.
Please queue for 4.3.
Thanks.
Ashok Raj (2):
x86/mce: Remove unused function declarations
x86/mce: Clear Local MCE opt-in before kexec
Borislav Petkov (6):
x86/mce: Reuse one of the u16 padding fields in struct mce x86/mce: Kill drain_mcelog_buffer()
RAS: Add a menuconfig option with descriptive text x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check() x86/mce: Add a wrapper around mce_log() for injection x86/ras: Move AMD MCE injector to arch/x86/ras/
Chen, Gong (4):
x86/mce: Provide a lockless memory pool to save error records x86/mce: Don't use percpu workqueues
x86/mce: Remove the MCE ring for Action Optional errors x86/mce: Avoid potential deadlock due to printk() in MCE context
Xie XiuQi (1):
x86/mce: Reenable CMCI banks when swiching back to interrupt mode
arch/x86/Kconfig | 1 +
arch/x86/Makefile | 2 +
arch/x86/include/asm/mce.h | 8 +-
arch/x86/include/uapi/asm/mce.h | 3 +-
arch/x86/kernel/cpu/mcheck/Makefile | 2 +-
arch/x86/kernel/cpu/mcheck/mce-apei.c | 1 -
arch/x86/kernel/cpu/mcheck/mce-genpool.c | 99 ++++++++++++
arch/x86/kernel/cpu/mcheck/mce-internal.h | 14 ++
arch/x86/kernel/cpu/mcheck/mce.c | 231 +++++++++++++--------------
arch/x86/kernel/cpu/mcheck/mce_intel.c | 61 ++++---
arch/x86/kernel/process.c | 2 +
arch/x86/kernel/smp.c | 2 +
arch/x86/ras/Kconfig | 11 ++
arch/x86/ras/Makefile | 2 +
{drivers/edac => arch/x86/ras}/mce_amd_inj.c | 6 +-
drivers/edac/Kconfig | 10 --
drivers/edac/Makefile | 1 -
drivers/ras/Kconfig | 37 ++++-
18 files changed, 329 insertions(+), 164 deletions(-)
create mode 100644 arch/x86/kernel/cpu/mcheck/mce-genpool.c
create mode 100644 arch/x86/ras/Kconfig
create mode 100644 arch/x86/ras/Makefile
rename {drivers/edac => arch/x86/ras}/mce_amd_inj.c (98%)Signature · 1 line
2.5.0.rc2.28.g6003e7f
Borislav Petkov
maintainerPATCH 1/13 x86/mce: Reuse one of the u16 padding fields in struct mce
From: Borislav Petkov <[email protected]>
... to save the error severity of the MCE and whether the reported address of the error is usable.
--- arch/x86/include/uapi/asm/mce.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/include/uapi/asm/mce.h +2 -1
@@ -15,7 +15,8 @@ struct mce {__u64 time;/* wall time_t when error was detected */ __u8 cpuvendor;/* cpu vendor as encoded in system.h */ __u8 inject_flags;/* software inject flags */ -__u16 pad; +__u8 severity; +__u8 usable_addr;__u32 cpuid;/* CPUID 1 EAX */ __u8 cs;/* code segment */ __u8 bank;/* machine check bank */
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Borislav Petkov
merge bot[tip:ras/core] x86/mce: Reuse one of the u16 padding fields in ' struct mce'
x86/mce: Reuse one of the u16 padding fields in 'struct mce'
Commit-ID: 20d51a426fe9a0d0a63cc3a7488f621c8bac37e1 Gitweb: http://git.kernel.org/tip/20d51a426fe9a0d0a63cc3a7488f621c8bac37e1 Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:33 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:50 +0200
x86/mce: Reuse one of the u16 padding fields in 'struct mce'
... to save the error severity of the MCE and whether the reported address of the error is usable.
--- arch/x86/include/uapi/asm/mce.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/include/uapi/asm/mce.h +2 -1
@@ -15,7 +15,8 @@ struct mce {__u64 time;/* wall time_t when error was detected */ __u8 cpuvendor;/* cpu vendor as encoded in system.h */ __u8 inject_flags;/* software inject flags */ -__u16 pad; +__u8 severity; +__u8 usable_addr;__u32 cpuid;/* CPUID 1 EAX */ __u8 cs;/* code segment */ __u8 bank;/* machine check bank */
Borislav Petkov
maintainerPATCH 2/13 x86/mce: Provide a lockless memory pool to save error records
In reply to Borislav PetkovFrom: "Chen, Gong" <[email protected]>
printk() is not safe to use in MCE context. Add a lockless memory allocator pool to save error records in MCE context. Those records will be issued later, in a printk-safe context. The idea is inspired by the APEI/GHES driver.
We're very conservative and allocate only two pages for it but since we're going to use those pages throughout the system's lifetime, we allocate them statically to avoid early boot time allocation woes.
--- arch/x86/Kconfig | 1 + arch/x86/kernel/cpu/mcheck/Makefile | 2 +- arch/x86/kernel/cpu/mcheck/mce-genpool.c | 99 +++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/mcheck/mce-internal.h | 12 ++++ arch/x86/kernel/cpu/mcheck/mce.c | 8 ++- 5 files changed, 120 insertions(+), 2 deletions(-) create mode 100644 arch/x86/kernel/cpu/mcheck/mce-genpool.c
arch/x86/Kconfig +1 -0
@@ -955,6 +955,7 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS config X86_MCE bool "Machine Check / overheating reporting" + select GENERIC_ALLOCATOR default y ---help--- Machine Check support allows the processor to notify the
arch/x86/kernel/cpu/mcheck/Makefile +1 -1
@@ -1,4 +1,4 @@ -obj-y = mce.o mce-severity.o +obj-y = mce.o mce-severity.o mce-genpool.o obj-$(CONFIG_X86_ANCIENT_MCE) += winchip.o p5.o obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
arch/x86/kernel/cpu/mcheck/mce-genpool.c new file +99 -0
99 lines not on this page · raw message
arch/x86/kernel/cpu/mcheck/mce-internal.h +12 -0
@@ -13,6 +13,8 @@ enum severity_level { MCE_PANIC_SEVERITY, }; +extern struct atomic_notifier_head x86_mce_decoder_chain; +#define ATTR_LEN 16#define INITIAL_CHECK_INTERVAL 5 * 60/* 5 minutes */
@@ -24,6 +26,16 @@ struct mce_bank {char attrname[ATTR_LEN ];/* attribute name */ }; +struct mce_evt_llist { +struct llist_node llnode; +struct mce mce; +}; + +void mce_gen_pool_process (void ); +bool mce_gen_pool_empty (void ); +int mce_gen_pool_add (struct mce *mce); +int mce_gen_pool_init (void ); +extern int (*mce_severity)(struct mce *a,int tolerant,char **msg,bool is_excp);struct dentry *mce_get_debugfs_dir (void );
arch/x86/kernel/cpu/mcheck/mce.c +7 -1
@@ -118,7 +118,7 @@ static void (*quirk_no_way_out)(int bank, struct mce *m, struct pt_regs *regs);* CPU/chipset specific EDAC code can register a notifier call here to print * MCE errors in a human-readable form. */ -static ATOMIC_NOTIFIER_HEAD (x86_mce_decoder_chain); +ATOMIC_NOTIFIER_HEAD (x86_mce_decoder_chain);/* Do initial initialization of a struct mce */ void mce_setup (struct mce *m)
@@ -1731,6 +1731,12 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)return ; } +if (mce_gen_pool_init ()) { + mca_cfg.disabled = true; +pr_emerg ("Couldn't allocate MCE records pool!\n" ); +return ; + } + machine_check_vector = do_machine_check;__mcheck_cpu_init_generic ();
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Chen, Gong
merge bot[tip:ras/core] x86/mce: Provide a lockless memory pool to save error records
x86/mce: Provide a lockless memory pool to save error records
Commit-ID: 648ed94038c030245a06e4be59744fd5cdc18c40 Gitweb: http://git.kernel.org/tip/648ed94038c030245a06e4be59744fd5cdc18c40 Author: Chen, Gong <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:34 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:50 +0200
x86/mce: Provide a lockless memory pool to save error records
printk() is not safe to use in MCE context. Add a lockless memory allocator pool to save error records in MCE context. Those records will be issued later, in a printk-safe context. The idea is inspired by the APEI/GHES driver.
We're very conservative and allocate only two pages for it but since we're going to use those pages throughout the system's lifetime, we allocate them statically to avoid early boot time allocation woes.
--- arch/x86/Kconfig | 1 + arch/x86/kernel/cpu/mcheck/Makefile | 2 +- arch/x86/kernel/cpu/mcheck/mce-genpool.c | 99 +++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/mcheck/mce-internal.h | 12 ++++ arch/x86/kernel/cpu/mcheck/mce.c | 8 ++- 5 files changed, 120 insertions(+), 2 deletions(-)
arch/x86/Kconfig +1 -0
@@ -955,6 +955,7 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS config X86_MCE bool "Machine Check / overheating reporting" + select GENERIC_ALLOCATOR default y ---help--- Machine Check support allows the processor to notify the
arch/x86/kernel/cpu/mcheck/Makefile +1 -1
@@ -1,4 +1,4 @@ -obj-y = mce.o mce-severity.o +obj-y = mce.o mce-severity.o mce-genpool.o obj-$(CONFIG_X86_ANCIENT_MCE) += winchip.o p5.o obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
arch/x86/kernel/cpu/mcheck/mce-genpool.c new file +99 -0
99 lines not on this page · raw message
arch/x86/kernel/cpu/mcheck/mce-internal.h +12 -0
@@ -13,6 +13,8 @@ enum severity_level { MCE_PANIC_SEVERITY, }; +extern struct atomic_notifier_head x86_mce_decoder_chain; +#define ATTR_LEN 16#define INITIAL_CHECK_INTERVAL 5 * 60/* 5 minutes */
@@ -24,6 +26,16 @@ struct mce_bank {char attrname[ATTR_LEN ];/* attribute name */ }; +struct mce_evt_llist { +struct llist_node llnode; +struct mce mce; +}; + +void mce_gen_pool_process (void ); +bool mce_gen_pool_empty (void ); +int mce_gen_pool_add (struct mce *mce); +int mce_gen_pool_init (void ); +extern int (*mce_severity)(struct mce *a,int tolerant,char **msg,bool is_excp);struct dentry *mce_get_debugfs_dir (void );
arch/x86/kernel/cpu/mcheck/mce.c +7 -1
@@ -118,7 +118,7 @@ static void (*quirk_no_way_out)(int bank, struct mce *m, struct pt_regs *regs);* CPU/chipset specific EDAC code can register a notifier call here to print * MCE errors in a human-readable form. */ -static ATOMIC_NOTIFIER_HEAD (x86_mce_decoder_chain); +ATOMIC_NOTIFIER_HEAD (x86_mce_decoder_chain);/* Do initial initialization of a struct mce */ void mce_setup (struct mce *m)
@@ -1731,6 +1731,12 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)return ; } +if (mce_gen_pool_init ()) { + mca_cfg.disabled = true; +pr_emerg ("Couldn't allocate MCE records pool!\n" ); +return ; + } + machine_check_vector = do_machine_check;__mcheck_cpu_init_generic ();
Borislav Petkov
maintainerPATCH 3/13 x86/mce: Don't use percpu workqueues
In reply to Borislav PetkovFrom: "Chen, Gong" <[email protected]>
An MCE is a rare event. Therefore, there's no need to have per-CPU instances of both normal and IRQ workqueues. Make them both global.
--- arch/x86/kernel/cpu/mcheck/mce.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/mcheck/mce.c +7 -7
@@ -110,7 +110,8 @@ DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {*/ mce_banks_t mce_banks_ce_disabled; -static DEFINE_PER_CPU(struct work_struct, mce_work); +static struct work_struct mce_work; +static struct irq_work mce_irq_work;static void (*quirk_no_way_out)(int bank,struct mce *m,struct pt_regs *regs);
@@ -526,11 +527,9 @@ int mce_available(struct cpuinfo_x86 *c)static void mce_schedule_work (void ) {if (!mce_ring_empty ()) -schedule_work (this_cpu_ptr (&mce_work)); +schedule_work (&mce_work); } -static DEFINE_PER_CPU(struct irq_work, mce_irq_work); -static void mce_irq_work_cb (struct irq_work *entry) {mce_notify_irq ();
@@ -551,7 +550,7 @@ static void mce_report_event(struct pt_regs *regs)return ; } -irq_work_queue (this_cpu_ptr (&mce_irq_work)); +irq_work_queue (&mce_irq_work); }/*
@@ -1742,8 +1741,6 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)__mcheck_cpu_init_generic ();__mcheck_cpu_init_vendor (c);__mcheck_cpu_init_timer (); -INIT_WORK (this_cpu_ptr (&mce_work), mce_process_work); -init_irq_work (this_cpu_ptr (&mce_irq_work), &mce_irq_work_cb); }/*
@@ -2064,6 +2061,9 @@ int __init mcheck_init(void)mcheck_intel_therm_init ();mcheck_vendor_init_severity (); +INIT_WORK (&mce_work, mce_process_work); +init_irq_work (&mce_irq_work, mce_irq_work_cb); +return 0 ; }
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Chen, Gong
merge bot[tip:ras/core] x86/mce: Don't use percpu workqueues
x86/mce: Don't use percpu workqueues
Commit-ID: 061120aed7081b9a4393fbe07b558192f40ad911 Gitweb: http://git.kernel.org/tip/061120aed7081b9a4393fbe07b558192f40ad911 Author: Chen, Gong <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:35 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:51 +0200
x86/mce: Don't use percpu workqueues
An MCE is a rare event. Therefore, there's no need to have per-CPU instances of both normal and IRQ workqueues. Make them both global.
--- arch/x86/kernel/cpu/mcheck/mce.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/mcheck/mce.c +7 -7
@@ -110,7 +110,8 @@ DEFINE_PER_CPU(mce_banks_t, mce_poll_banks) = {*/ mce_banks_t mce_banks_ce_disabled; -static DEFINE_PER_CPU(struct work_struct, mce_work); +static struct work_struct mce_work; +static struct irq_work mce_irq_work;static void (*quirk_no_way_out)(int bank,struct mce *m,struct pt_regs *regs);
@@ -526,11 +527,9 @@ int mce_available(struct cpuinfo_x86 *c)static void mce_schedule_work (void ) {if (!mce_ring_empty ()) -schedule_work (this_cpu_ptr (&mce_work)); +schedule_work (&mce_work); } -static DEFINE_PER_CPU(struct irq_work, mce_irq_work); -static void mce_irq_work_cb (struct irq_work *entry) {mce_notify_irq ();
@@ -551,7 +550,7 @@ static void mce_report_event(struct pt_regs *regs)return ; } -irq_work_queue (this_cpu_ptr (&mce_irq_work)); +irq_work_queue (&mce_irq_work); }/*
@@ -1742,8 +1741,6 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)__mcheck_cpu_init_generic ();__mcheck_cpu_init_vendor (c);__mcheck_cpu_init_timer (); -INIT_WORK (this_cpu_ptr (&mce_work), mce_process_work); -init_irq_work (this_cpu_ptr (&mce_irq_work), &mce_irq_work_cb); }/*
@@ -2064,6 +2061,9 @@ int __init mcheck_init(void)mcheck_intel_therm_init ();mcheck_vendor_init_severity (); +INIT_WORK (&mce_work, mce_process_work); +init_irq_work (&mce_irq_work, mce_irq_work_cb); +return 0 ; }
Borislav Petkov
maintainerPATCH 4/13 x86/mce: Remove the MCE ring for Action Optional errors
In reply to Borislav PetkovFrom: "Chen, Gong" <[email protected]>
Use unified genpool to save Action Optional error events and put Action Optional error handling in the same notification chain as MCE error decoding.
--- arch/x86/include/asm/mce.h | 2 +- arch/x86/kernel/cpu/mcheck/mce.c | 135 +++++++++++++++++---------------------- drivers/acpi/acpi_extlog.c | 2 +- drivers/edac/i7core_edac.c | 2 +- drivers/edac/mce_amd.c | 2 +- drivers/edac/sb_edac.c | 2 +- 6 files changed, 65 insertions(+), 80 deletions(-)
arch/x86/include/asm/mce.h +1 -1
@@ -140,7 +140,7 @@ struct mce_vendor_flags {extern struct mce_vendor_flags mce_flags;extern struct mca_config mca_cfg; -extern void mce_register_decode_chain (struct notifier_block *nb); +extern void mce_register_decode_chain (struct notifier_block *nb,bool drain);extern void mce_unregister_decode_chain (struct notifier_block *nb);#include <linux/percpu.h>
arch/x86/kernel/cpu/mcheck/mce.c +60 -75
199 lines not on this page · raw message
drivers/acpi/acpi_extlog.c +1 -1
@@ -286,7 +286,7 @@ static int __init extlog_init(void)*/ old_edac_report_status =get_edac_report_status ();set_edac_report_status (EDAC_REPORTING_DISABLED ); -mce_register_decode_chain (&extlog_mce_dec); +mce_register_decode_chain (&extlog_mce_dec, true);/* enable OS to be involved to take over management from BIOS */ ((struct extlog_l1_head *)extlog_l1_addr)->flags |=FLAG_OS_OPTIN ;
drivers/edac/i7core_edac.c +1 -1
@@ -2424,7 +2424,7 @@ static int __init i7core_init(void) pci_rc =pci_register_driver (&i7core_driver);if (pci_rc >=0 ) { -mce_register_decode_chain (&i7_mce_dec); +mce_register_decode_chain (&i7_mce_dec, true);return 0 ; }
drivers/edac/mce_amd.c +1 -1
@@ -895,7 +895,7 @@ static int __init mce_amd_init(void)pr_info ("MCE: In-kernel MCE decoding enabled.\n" ); -mce_register_decode_chain (&amd_mce_dec_nb); +mce_register_decode_chain (&amd_mce_dec_nb, true);return 0 ; }
drivers/edac/sb_edac.c +1 -1
@@ -2591,7 +2591,7 @@ static int __init sbridge_init(void) pci_rc =pci_register_driver (&sbridge_driver);if (pci_rc >=0 ) { -mce_register_decode_chain (&sbridge_mce_dec); +mce_register_decode_chain (&sbridge_mce_dec, true);if (get_edac_report_status () ==EDAC_REPORTING_DISABLED )sbridge_printk (KERN_WARNING ,"Loading driver, error reporting disabled.\n" );return 0 ;
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Chen, Gong
merge bot[tip:ras/core] x86/mce: Remove the MCE ring for Action Optional errors
x86/mce: Remove the MCE ring for Action Optional errors
Commit-ID: fd4cf79fcc4b5130ced8fd8c40378d3cec2e5fa8 Gitweb: http://git.kernel.org/tip/fd4cf79fcc4b5130ced8fd8c40378d3cec2e5fa8 Author: Chen, Gong <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:36 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:51 +0200
x86/mce: Remove the MCE ring for Action Optional errors
Use unified genpool to save Action Optional error events and put Action Optional error handling in the same notification chain as MCE error decoding.
--- arch/x86/include/asm/mce.h | 2 +- arch/x86/kernel/cpu/mcheck/mce.c | 135 +++++++++++++++++---------------------- drivers/acpi/acpi_extlog.c | 2 +- drivers/edac/i7core_edac.c | 2 +- drivers/edac/mce_amd.c | 2 +- drivers/edac/sb_edac.c | 2 +- 6 files changed, 65 insertions(+), 80 deletions(-)
arch/x86/include/asm/mce.h +1 -1
@@ -140,7 +140,7 @@ struct mce_vendor_flags {extern struct mce_vendor_flags mce_flags;extern struct mca_config mca_cfg; -extern void mce_register_decode_chain (struct notifier_block *nb); +extern void mce_register_decode_chain (struct notifier_block *nb,bool drain);extern void mce_unregister_decode_chain (struct notifier_block *nb);#include <linux/percpu.h>
arch/x86/kernel/cpu/mcheck/mce.c +60 -75
199 lines not on this page · raw message
drivers/acpi/acpi_extlog.c +1 -1
@@ -286,7 +286,7 @@ static int __init extlog_init(void)*/ old_edac_report_status =get_edac_report_status ();set_edac_report_status (EDAC_REPORTING_DISABLED ); -mce_register_decode_chain (&extlog_mce_dec); +mce_register_decode_chain (&extlog_mce_dec, true);/* enable OS to be involved to take over management from BIOS */ ((struct extlog_l1_head *)extlog_l1_addr)->flags |=FLAG_OS_OPTIN ;
drivers/edac/i7core_edac.c +1 -1
@@ -2424,7 +2424,7 @@ static int __init i7core_init(void) pci_rc =pci_register_driver (&i7core_driver);if (pci_rc >=0 ) { -mce_register_decode_chain (&i7_mce_dec); +mce_register_decode_chain (&i7_mce_dec, true);return 0 ; }
drivers/edac/mce_amd.c +1 -1
@@ -895,7 +895,7 @@ static int __init mce_amd_init(void)pr_info ("MCE: In-kernel MCE decoding enabled.\n" ); -mce_register_decode_chain (&amd_mce_dec_nb); +mce_register_decode_chain (&amd_mce_dec_nb, true);return 0 ; }
drivers/edac/sb_edac.c +1 -1
@@ -2591,7 +2591,7 @@ static int __init sbridge_init(void) pci_rc =pci_register_driver (&sbridge_driver);if (pci_rc >=0 ) { -mce_register_decode_chain (&sbridge_mce_dec); +mce_register_decode_chain (&sbridge_mce_dec, true);if (get_edac_report_status () ==EDAC_REPORTING_DISABLED )sbridge_printk (KERN_WARNING ,"Loading driver, error reporting disabled.\n" );return 0 ;
Borislav Petkov
maintainerPATCH 5/13 x86/mce: Avoid potential deadlock due to printk() in MCE context
In reply to Borislav PetkovFrom: "Chen, Gong" <[email protected]>
Printing in MCE context is a no-no, currently, as printk() is not NMI-safe. If some of the notifiers on the MCE chain call do so, we may deadlock. In order to avoid that, delay printk() to process context where it is safe.
--- arch/x86/kernel/cpu/mcheck/mce-apei.c | 1 - arch/x86/kernel/cpu/mcheck/mce.c | 4 ++-- arch/x86/kernel/cpu/mcheck/mce_intel.c | 1 - 3 files changed, 2 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mcheck/mce-apei.c +0 -1
@@ -57,7 +57,6 @@ void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err) m.addr = mem_err->physical_addr;mce_log (&m); -mce_notify_irq (); }EXPORT_SYMBOL_GPL (apei_mce_report_mem_error);
arch/x86/kernel/cpu/mcheck/mce.c +2 -2
@@ -159,7 +159,8 @@ void mce_log(struct mce *mce)/* Emit the trace record: */ trace_mce_record (mce); -atomic_notifier_call_chain (&x86_mce_decoder_chain,0 , mce); +if (!mce_gen_pool_add (mce)) +irq_work_queue (&mce_irq_work); mce->finished =0 ;wmb ();
@@ -1122,7 +1123,6 @@ void do_machine_check(struct pt_regs *regs, long error_code)/* assuming valid severity level != 0 */ m.severity = severity; m.usable_addr =mce_usable_address (&m); -mce_gen_pool_add (&m);mce_log (&m);
arch/x86/kernel/cpu/mcheck/mce_intel.c +0 -1
@@ -246,7 +246,6 @@ static void intel_threshold_interrupt(void)return ;machine_check_poll (MCP_TIMESTAMP ,this_cpu_ptr (&mce_banks_owned)); -mce_notify_irq (); }/*
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Chen, Gong
merge bot[tip:ras/core] x86/mce: Avoid potential deadlock due to printk() in MCE context
x86/mce: Avoid potential deadlock due to printk() in MCE context
Commit-ID: f29a7aff4bd60ebc3da4982f80144a4158c4c74a Gitweb: http://git.kernel.org/tip/f29a7aff4bd60ebc3da4982f80144a4158c4c74a Author: Chen, Gong <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:37 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:51 +0200
x86/mce: Avoid potential deadlock due to printk() in MCE context
Printing in MCE context is a no-no, currently, as printk() is not NMI-safe. If some of the notifiers on the MCE chain call do so, we may deadlock. In order to avoid that, delay printk() to process context where it is safe.
--- arch/x86/kernel/cpu/mcheck/mce-apei.c | 1 - arch/x86/kernel/cpu/mcheck/mce.c | 4 ++-- arch/x86/kernel/cpu/mcheck/mce_intel.c | 1 - 3 files changed, 2 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mcheck/mce-apei.c +0 -1
@@ -57,7 +57,6 @@ void apei_mce_report_mem_error(int severity, struct cper_sec_mem_err *mem_err) m.addr = mem_err->physical_addr;mce_log (&m); -mce_notify_irq (); }EXPORT_SYMBOL_GPL (apei_mce_report_mem_error);
arch/x86/kernel/cpu/mcheck/mce.c +2 -2
@@ -159,7 +159,8 @@ void mce_log(struct mce *mce)/* Emit the trace record: */ trace_mce_record (mce); -atomic_notifier_call_chain (&x86_mce_decoder_chain,0 , mce); +if (!mce_gen_pool_add (mce)) +irq_work_queue (&mce_irq_work); mce->finished =0 ;wmb ();
@@ -1122,7 +1123,6 @@ void do_machine_check(struct pt_regs *regs, long error_code)/* assuming valid severity level != 0 */ m.severity = severity; m.usable_addr =mce_usable_address (&m); -mce_gen_pool_add (&m);mce_log (&m);
arch/x86/kernel/cpu/mcheck/mce_intel.c +0 -1
@@ -246,7 +246,6 @@ static void intel_threshold_interrupt(void)return ;machine_check_poll (MCP_TIMESTAMP ,this_cpu_ptr (&mce_banks_owned)); -mce_notify_irq (); }/*
Borislav Petkov
maintainerPATCH 6/13 x86/mce: Kill drain_mcelog_buffer()
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
This used to flush out MCEs logged during early boot and which were in the MCA registers from a previous system run. No need for that now, since we've moved to a genpool.
--- arch/x86/include/asm/mce.h | 2 +- arch/x86/kernel/cpu/mcheck/mce.c | 44 ++-------------------------------------- drivers/acpi/acpi_extlog.c | 2 +- drivers/edac/i7core_edac.c | 2 +- drivers/edac/mce_amd.c | 2 +- drivers/edac/sb_edac.c | 2 +- 6 files changed, 7 insertions(+), 47 deletions(-)
arch/x86/include/asm/mce.h +1 -1
@@ -140,7 +140,7 @@ struct mce_vendor_flags {extern struct mce_vendor_flags mce_flags;extern struct mca_config mca_cfg; -extern void mce_register_decode_chain (struct notifier_block *nb,bool drain); +extern void mce_register_decode_chain (struct notifier_block *nb);extern void mce_unregister_decode_chain (struct notifier_block *nb);#include <linux/percpu.h>
arch/x86/kernel/cpu/mcheck/mce.c +2 -42
64 lines not on this page · raw message
drivers/acpi/acpi_extlog.c +1 -1
@@ -286,7 +286,7 @@ static int __init extlog_init(void)*/ old_edac_report_status =get_edac_report_status ();set_edac_report_status (EDAC_REPORTING_DISABLED ); -mce_register_decode_chain (&extlog_mce_dec, true); +mce_register_decode_chain (&extlog_mce_dec);/* enable OS to be involved to take over management from BIOS */ ((struct extlog_l1_head *)extlog_l1_addr)->flags |=FLAG_OS_OPTIN ;
drivers/edac/i7core_edac.c +1 -1
@@ -2424,7 +2424,7 @@ static int __init i7core_init(void) pci_rc =pci_register_driver (&i7core_driver);if (pci_rc >=0 ) { -mce_register_decode_chain (&i7_mce_dec, true); +mce_register_decode_chain (&i7_mce_dec);return 0 ; }
drivers/edac/mce_amd.c +1 -1
@@ -895,7 +895,7 @@ static int __init mce_amd_init(void)pr_info ("MCE: In-kernel MCE decoding enabled.\n" ); -mce_register_decode_chain (&amd_mce_dec_nb, true); +mce_register_decode_chain (&amd_mce_dec_nb);return 0 ; }
drivers/edac/sb_edac.c +1 -1
@@ -2591,7 +2591,7 @@ static int __init sbridge_init(void) pci_rc =pci_register_driver (&sbridge_driver);if (pci_rc >=0 ) { -mce_register_decode_chain (&sbridge_mce_dec, true); +mce_register_decode_chain (&sbridge_mce_dec);if (get_edac_report_status () ==EDAC_REPORTING_DISABLED )sbridge_printk (KERN_WARNING ,"Loading driver, error reporting disabled.\n" );return 0 ;
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Borislav Petkov
merge bot[tip:ras/core] x86/mce: Kill drain_mcelog_buffer()
x86/mce: Kill drain_mcelog_buffer()
Commit-ID: eef4dfa0cb83899c782935ac5345532f47073cea Gitweb: http://git.kernel.org/tip/eef4dfa0cb83899c782935ac5345532f47073cea Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:38 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:52 +0200
x86/mce: Kill drain_mcelog_buffer()
This used to flush out MCEs logged during early boot and which were in the MCA registers from a previous system run. No need for that now, since we've moved to a genpool.
--- arch/x86/include/asm/mce.h | 2 +- arch/x86/kernel/cpu/mcheck/mce.c | 44 ++-------------------------------------- drivers/acpi/acpi_extlog.c | 2 +- drivers/edac/i7core_edac.c | 2 +- drivers/edac/mce_amd.c | 2 +- drivers/edac/sb_edac.c | 2 +- 6 files changed, 7 insertions(+), 47 deletions(-)
arch/x86/include/asm/mce.h +1 -1
@@ -140,7 +140,7 @@ struct mce_vendor_flags {extern struct mce_vendor_flags mce_flags;extern struct mca_config mca_cfg; -extern void mce_register_decode_chain (struct notifier_block *nb,bool drain); +extern void mce_register_decode_chain (struct notifier_block *nb);extern void mce_unregister_decode_chain (struct notifier_block *nb);#include <linux/percpu.h>
arch/x86/kernel/cpu/mcheck/mce.c +2 -42
64 lines not on this page · raw message
drivers/acpi/acpi_extlog.c +1 -1
@@ -286,7 +286,7 @@ static int __init extlog_init(void)*/ old_edac_report_status =get_edac_report_status ();set_edac_report_status (EDAC_REPORTING_DISABLED ); -mce_register_decode_chain (&extlog_mce_dec, true); +mce_register_decode_chain (&extlog_mce_dec);/* enable OS to be involved to take over management from BIOS */ ((struct extlog_l1_head *)extlog_l1_addr)->flags |=FLAG_OS_OPTIN ;
drivers/edac/i7core_edac.c +1 -1
@@ -2424,7 +2424,7 @@ static int __init i7core_init(void) pci_rc =pci_register_driver (&i7core_driver);if (pci_rc >=0 ) { -mce_register_decode_chain (&i7_mce_dec, true); +mce_register_decode_chain (&i7_mce_dec);return 0 ; }
drivers/edac/mce_amd.c +1 -1
@@ -895,7 +895,7 @@ static int __init mce_amd_init(void)pr_info ("MCE: In-kernel MCE decoding enabled.\n" ); -mce_register_decode_chain (&amd_mce_dec_nb, true); +mce_register_decode_chain (&amd_mce_dec_nb);return 0 ; }
drivers/edac/sb_edac.c +1 -1
@@ -2591,7 +2591,7 @@ static int __init sbridge_init(void) pci_rc =pci_register_driver (&sbridge_driver);if (pci_rc >=0 ) { -mce_register_decode_chain (&sbridge_mce_dec, true); +mce_register_decode_chain (&sbridge_mce_dec);if (get_edac_report_status () ==EDAC_REPORTING_DISABLED )sbridge_printk (KERN_WARNING ,"Loading driver, error reporting disabled.\n" );return 0 ;
Borislav Petkov
maintainerPATCH 7/13 x86/mce: Remove unused function declarations
In reply to Borislav PetkovFrom: Ashok Raj <[email protected]>
Remove unused function declarations.
--- arch/x86/include/asm/mce.h | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/include/asm/mce.h +0 -4
@@ -185,16 +185,12 @@ void cmci_clear(void);void cmci_reenable (void );void cmci_rediscover (void );void cmci_recheck (void ); -void lmce_clear (void ); -void lmce_enable (void );#else static inline void mce_intel_feature_init (struct cpuinfo_x86 *c) { }static inline void cmci_clear (void ) {}static inline void cmci_reenable (void ) {}static inline void cmci_rediscover (void ) {}static inline void cmci_recheck (void ) {} -static inline void lmce_clear (void ) {} -static inline void lmce_enable (void ) {}#endif #ifdef CONFIG_X86_MCE_AMD
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Ashok Raj
merge bot[tip:ras/core] x86/mce: Remove unused function declarations
x86/mce: Remove unused function declarations
Commit-ID: 4d1d5cdc345d15e09518a2410f7fcd069465ffac Gitweb: http://git.kernel.org/tip/4d1d5cdc345d15e09518a2410f7fcd069465ffac Author: Ashok Raj <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:39 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:52 +0200
x86/mce: Remove unused function declarations
Remove unused function declarations.
--- arch/x86/include/asm/mce.h | 4 ---- 1 file changed, 4 deletions(-)
arch/x86/include/asm/mce.h +0 -4
@@ -185,16 +185,12 @@ void cmci_clear(void);void cmci_reenable (void );void cmci_rediscover (void );void cmci_recheck (void ); -void lmce_clear (void ); -void lmce_enable (void );#else static inline void mce_intel_feature_init (struct cpuinfo_x86 *c) { }static inline void cmci_clear (void ) {}static inline void cmci_reenable (void ) {}static inline void cmci_rediscover (void ) {}static inline void cmci_recheck (void ) {} -static inline void lmce_clear (void ) {} -static inline void lmce_enable (void ) {}#endif #ifdef CONFIG_X86_MCE_AMD
Borislav Petkov
maintainerPATCH 8/13 x86/mce: Clear Local MCE opt-in before kexec
In reply to Borislav PetkovFrom: Ashok Raj <[email protected]>
kexec could boot a kernel that could be legacy with no knowledge of LMCE. Hence we should make sure we clear LMCE optin before kexec reboot.
--- arch/x86/include/asm/mce.h | 4 ++++ arch/x86/kernel/cpu/mcheck/mce.c | 30 ++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/mcheck/mce_intel.c | 19 ++++++++++++++++++- arch/x86/kernel/process.c | 2 ++ arch/x86/kernel/smp.c | 2 ++ 5 files changed, 56 insertions(+), 1 deletion(-)
arch/x86/include/asm/mce.h +4 -0
@@ -151,10 +151,12 @@ extern int mce_p5_enabled;#ifdef CONFIG_X86_MCE int mcheck_init (void );void mcheck_cpu_init (struct cpuinfo_x86 *c); +void mcheck_cpu_clear (struct cpuinfo_x86 *c);void mcheck_vendor_init_severity (void );#else static inline int mcheck_init (void ) {return 0 ; }static inline void mcheck_cpu_init (struct cpuinfo_x86 *c) {} +static inline void mcheck_cpu_clear (struct cpuinfo_x86 *c) {}static inline void mcheck_vendor_init_severity (void ) {}#endif
@@ -181,12 +183,14 @@ DECLARE_PER_CPU(struct device *, mce_device);#ifdef CONFIG_X86_MCE_INTEL void mce_intel_feature_init (struct cpuinfo_x86 *c); +void mce_intel_feature_clear (struct cpuinfo_x86 *c);void cmci_clear (void );void cmci_reenable (void );void cmci_rediscover (void );void cmci_recheck (void );#else static inline void mce_intel_feature_init (struct cpuinfo_x86 *c) { } +static inline void mce_intel_feature_clear (struct cpuinfo_x86 *c) { }static inline void cmci_clear (void ) {}static inline void cmci_reenable (void ) {}static inline void cmci_rediscover (void ) {}
arch/x86/kernel/cpu/mcheck/mce.c +30 -0
@@ -1606,6 +1606,17 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c) } } +static void __mcheck_cpu_clear_vendor (struct cpuinfo_x86 *c) +{ +switch (c->x86_vendor) { +case X86_VENDOR_INTEL : +mce_intel_feature_clear (c); +break ; +default : +break ; + } +} +static void mce_start_timer (unsigned int cpu,struct timer_list *t) {unsigned long iv = check_interval *HZ ;
@@ -1673,6 +1684,25 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c) }/* +* Called for each booted CPU to clear some machine checks opt-ins +*/ +void mcheck_cpu_clear (struct cpuinfo_x86 *c) +{ +if (mca_cfg.disabled) +return ; + +if (!mce_available (c)) +return ; + +/* +* Possibly to clear general settings generic to x86 +* __mcheck_cpu_clear_generic(c); +*/ +__mcheck_cpu_clear_vendor (c); + +} + +/* * mce_chrdev: Character device /dev/mcelog to read and clear the MCE log. */
arch/x86/kernel/cpu/mcheck/mce_intel.c +18 -1
@@ -434,7 +434,7 @@ static void intel_init_cmci(void)cmci_recheck (); } -void intel_init_lmce (void ) +static void intel_init_lmce (void ) {u64 val;
@@ -447,9 +447,26 @@ void intel_init_lmce(void)wrmsrl (MSR_IA32_MCG_EXT_CTL , val |MCG_EXT_CTL_LMCE_EN ); } +static void intel_clear_lmce (void ) +{ +u64 val; + +if (!lmce_supported ()) +return ; + +rdmsrl (MSR_IA32_MCG_EXT_CTL , val); + val &= ~MCG_EXT_CTL_LMCE_EN ; +wrmsrl (MSR_IA32_MCG_EXT_CTL , val); +} +void mce_intel_feature_init (struct cpuinfo_x86 *c) {intel_init_thermal (c);intel_init_cmci ();intel_init_lmce (); } + +void mce_intel_feature_clear (struct cpuinfo_x86 *c) +{ +intel_clear_lmce (); +}
arch/x86/kernel/process.c +2 -0
@@ -29,6 +29,7 @@#include <asm/debugreg.h> #include <asm/nmi.h> #include <asm/tlbflush.h> +#include <asm/mce.h> /* * per-CPU TSS segments. Threads are completely 'soft' on Linux,
@@ -319,6 +320,7 @@ void stop_this_cpu(void *dummy)*/ set_cpu_online (smp_processor_id (), false);disable_local_APIC (); +mcheck_cpu_clear (this_cpu_ptr (&cpu_info));for (;;)halt ();
arch/x86/kernel/smp.c +2 -0
@@ -30,6 +30,7 @@#include <asm/proto.h> #include <asm/apic.h> #include <asm/nmi.h> +#include <asm/mce.h> #include <asm/trace/irq_vectors.h> /* * Some notes on x86 processor bugs affecting SMP operation:
@@ -243,6 +244,7 @@ static void native_stop_other_cpus(int wait) finish:local_irq_save (flags);disable_local_APIC (); +mcheck_cpu_clear (this_cpu_ptr (&cpu_info));local_irq_restore (flags); }
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Ashok Raj
merge bot[tip:ras/core] x86/mce: Clear Local MCE opt-in before kexec
x86/mce: Clear Local MCE opt-in before kexec
Commit-ID: 8838eb6c0bf3b6a6494a163947ab3d1700ab45d2 Gitweb: http://git.kernel.org/tip/8838eb6c0bf3b6a6494a163947ab3d1700ab45d2 Author: Ashok Raj <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:40 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:52 +0200
x86/mce: Clear Local MCE opt-in before kexec
kexec could boot a kernel that could be legacy with no knowledge of LMCE. Hence we should make sure we clear LMCE optin before kexec reboot.
--- arch/x86/include/asm/mce.h | 4 ++++ arch/x86/kernel/cpu/mcheck/mce.c | 30 ++++++++++++++++++++++++++++++ arch/x86/kernel/cpu/mcheck/mce_intel.c | 19 ++++++++++++++++++- arch/x86/kernel/process.c | 2 ++ arch/x86/kernel/smp.c | 2 ++ 5 files changed, 56 insertions(+), 1 deletion(-)
arch/x86/include/asm/mce.h +4 -0
@@ -151,10 +151,12 @@ extern int mce_p5_enabled;#ifdef CONFIG_X86_MCE int mcheck_init (void );void mcheck_cpu_init (struct cpuinfo_x86 *c); +void mcheck_cpu_clear (struct cpuinfo_x86 *c);void mcheck_vendor_init_severity (void );#else static inline int mcheck_init (void ) {return 0 ; }static inline void mcheck_cpu_init (struct cpuinfo_x86 *c) {} +static inline void mcheck_cpu_clear (struct cpuinfo_x86 *c) {}static inline void mcheck_vendor_init_severity (void ) {}#endif
@@ -181,12 +183,14 @@ DECLARE_PER_CPU(struct device *, mce_device);#ifdef CONFIG_X86_MCE_INTEL void mce_intel_feature_init (struct cpuinfo_x86 *c); +void mce_intel_feature_clear (struct cpuinfo_x86 *c);void cmci_clear (void );void cmci_reenable (void );void cmci_rediscover (void );void cmci_recheck (void );#else static inline void mce_intel_feature_init (struct cpuinfo_x86 *c) { } +static inline void mce_intel_feature_clear (struct cpuinfo_x86 *c) { }static inline void cmci_clear (void ) {}static inline void cmci_reenable (void ) {}static inline void cmci_rediscover (void ) {}
arch/x86/kernel/cpu/mcheck/mce.c +30 -0
@@ -1606,6 +1606,17 @@ static void __mcheck_cpu_init_vendor(struct cpuinfo_x86 *c) } } +static void __mcheck_cpu_clear_vendor (struct cpuinfo_x86 *c) +{ +switch (c->x86_vendor) { +case X86_VENDOR_INTEL : +mce_intel_feature_clear (c); +break ; +default : +break ; + } +} +static void mce_start_timer (unsigned int cpu,struct timer_list *t) {unsigned long iv = check_interval *HZ ;
@@ -1673,6 +1684,25 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c) }/* +* Called for each booted CPU to clear some machine checks opt-ins +*/ +void mcheck_cpu_clear (struct cpuinfo_x86 *c) +{ +if (mca_cfg.disabled) +return ; + +if (!mce_available (c)) +return ; + +/* +* Possibly to clear general settings generic to x86 +* __mcheck_cpu_clear_generic(c); +*/ +__mcheck_cpu_clear_vendor (c); + +} + +/* * mce_chrdev: Character device /dev/mcelog to read and clear the MCE log. */
arch/x86/kernel/cpu/mcheck/mce_intel.c +18 -1
@@ -434,7 +434,7 @@ static void intel_init_cmci(void)cmci_recheck (); } -void intel_init_lmce (void ) +static void intel_init_lmce (void ) {u64 val;
@@ -447,9 +447,26 @@ void intel_init_lmce(void)wrmsrl (MSR_IA32_MCG_EXT_CTL , val |MCG_EXT_CTL_LMCE_EN ); } +static void intel_clear_lmce (void ) +{ +u64 val; + +if (!lmce_supported ()) +return ; + +rdmsrl (MSR_IA32_MCG_EXT_CTL , val); + val &= ~MCG_EXT_CTL_LMCE_EN ; +wrmsrl (MSR_IA32_MCG_EXT_CTL , val); +} +void mce_intel_feature_init (struct cpuinfo_x86 *c) {intel_init_thermal (c);intel_init_cmci ();intel_init_lmce (); } + +void mce_intel_feature_clear (struct cpuinfo_x86 *c) +{ +intel_clear_lmce (); +}
arch/x86/kernel/process.c +2 -0
@@ -29,6 +29,7 @@#include <asm/debugreg.h> #include <asm/nmi.h> #include <asm/tlbflush.h> +#include <asm/mce.h> /* * per-CPU TSS segments. Threads are completely 'soft' on Linux,
@@ -319,6 +320,7 @@ void stop_this_cpu(void *dummy)*/ set_cpu_online (smp_processor_id (), false);disable_local_APIC (); +mcheck_cpu_clear (this_cpu_ptr (&cpu_info));for (;;)halt ();
arch/x86/kernel/smp.c +2 -0
@@ -30,6 +30,7 @@#include <asm/proto.h> #include <asm/apic.h> #include <asm/nmi.h> +#include <asm/mce.h> #include <asm/trace/irq_vectors.h> /* * Some notes on x86 processor bugs affecting SMP operation:
@@ -243,6 +244,7 @@ static void native_stop_other_cpus(int wait) finish:local_irq_save (flags);disable_local_APIC (); +mcheck_cpu_clear (this_cpu_ptr (&cpu_info));local_irq_restore (flags); }
Borislav Petkov
maintainerPATCH 9/13 x86/mce: Reenable CMCI banks when swiching back to interrupt mode
In reply to Borislav PetkovFrom: Xie XiuQi <[email protected]>
Zhang Liguang reported the following issue:
1) System detects a CMCI storm on the current CPU.
2) Kernel disables the CMCI interrupt on banks owned by the current CPU and switches to poll mode
3) After the CMCI storm subsides, kernel switches back to interrupt mode
4) We expect the system to reenable the CMCI interrupt on banks owned by the current CPU
mce_intel_adjust_timer
|-> cmci_reenable
|-> cmci_discover # owned banks are ignored here
static void cmci_discover(int banks)
...
for (i = 0; i < banks; i++) {
...
if (test_bit(i, owned)) # ownd banks is ignore here
continue;So convert cmci_storm_disable_banks() to cmci_toggle_interrupt_mode() which controls whether to enable or disable CMCI interrupts with its argument.
NB: We cannot clear the owned bit because the banks won't be polled, otherwise. See
27f6c573e0f7 ("x86, CMCI: Add proper detection of end of CMCI storms")
for more info.
--- arch/x86/kernel/cpu/mcheck/mce_intel.c | 41 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-)
arch/x86/kernel/cpu/mcheck/mce_intel.c +23 -18
@@ -146,6 +146,27 @@ void mce_intel_hcpu_update(unsigned long cpu)per_cpu (cmci_storm_state, cpu) =CMCI_STORM_NONE ; } +static void cmci_toggle_interrupt_mode (bool on) +{ +unsigned long flags, *owned; +int bank; +u64 val; + +raw_spin_lock_irqsave (&cmci_discover_lock, flags); + owned =this_cpu_ptr (mce_banks_owned); +for_each_set_bit (bank, owned,MAX_NR_BANKS ) { +rdmsrl (MSR_IA32_MCx_CTL2 (bank), val); + +if (on) + val |=MCI_CTL2_CMCI_EN ; +else + val &= ~MCI_CTL2_CMCI_EN ; + +wrmsrl (MSR_IA32_MCx_CTL2 (bank), val); + } +raw_spin_unlock_irqrestore (&cmci_discover_lock, flags); +} +unsigned long cmci_intel_adjust_timer (unsigned long interval) { if ((this_cpu_read(cmci_backoff_cnt) > 0) &&
@@ -175,7 +196,7 @@ unsigned long cmci_intel_adjust_timer(unsigned long interval)*/ if (!atomic_read (&cmci_storm_on_cpus)) {__this_cpu_write (cmci_storm_state,CMCI_STORM_NONE ); -cmci_reenable (); +cmci_toggle_interrupt_mode (true);cmci_recheck (); }return CMCI_POLL_INTERVAL ;
@@ -186,22 +207,6 @@ unsigned long cmci_intel_adjust_timer(unsigned long interval) } } -static void cmci_storm_disable_banks (void ) -{ -unsigned long flags, *owned; -int bank; -u64 val; - -raw_spin_lock_irqsave (&cmci_discover_lock, flags); - owned =this_cpu_ptr (mce_banks_owned); -for_each_set_bit (bank, owned,MAX_NR_BANKS ) { -rdmsrl (MSR_IA32_MCx_CTL2 (bank), val); - val &= ~MCI_CTL2_CMCI_EN ; -wrmsrl (MSR_IA32_MCx_CTL2 (bank), val); - } -raw_spin_unlock_irqrestore (&cmci_discover_lock, flags); -} -static bool cmci_storm_detect (void ) {unsigned int cnt =__this_cpu_read (cmci_storm_cnt);
@@ -223,7 +228,7 @@ static bool cmci_storm_detect(void)if (cnt <=CMCI_STORM_THRESHOLD )return false; -cmci_storm_disable_banks (); +cmci_toggle_interrupt_mode (false);__this_cpu_write (cmci_storm_state,CMCI_STORM_ACTIVE ); r =atomic_add_return (1 , &cmci_storm_on_cpus);mce_timer_kick (CMCI_STORM_INTERVAL );
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Xie XiuQi
merge bot[tip:ras/core] x86/mce: Reenable CMCI banks when swiching back to interrupt mode
x86/mce: Reenable CMCI banks when swiching back to interrupt mode
Commit-ID: 1b48465500611a2dc5e75800c61ac352e22d41c3 Gitweb: http://git.kernel.org/tip/1b48465500611a2dc5e75800c61ac352e22d41c3 Author: Xie XiuQi <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:41 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:52 +0200
x86/mce: Reenable CMCI banks when swiching back to interrupt mode
Zhang Liguang reported the following issue:
1) System detects a CMCI storm on the current CPU.
2) Kernel disables the CMCI interrupt on banks owned by the current CPU and switches to poll mode
3) After the CMCI storm subsides, kernel switches back to interrupt mode
4) We expect the system to reenable the CMCI interrupt on banks owned by the current CPU
mce_intel_adjust_timer
|-> cmci_reenable
|-> cmci_discover # owned banks are ignored here
static void cmci_discover(int banks)
...
for (i = 0; i < banks; i++) {
...
if (test_bit(i, owned)) # ownd banks is ignore here
continue;So convert cmci_storm_disable_banks() to cmci_toggle_interrupt_mode() which controls whether to enable or disable CMCI interrupts with its argument.
NB: We cannot clear the owned bit because the banks won't be polled, otherwise. See:
27f6c573e0f7 ("x86, CMCI: Add proper detection of end of CMCI storms")
for more info.
--- arch/x86/kernel/cpu/mcheck/mce_intel.c | 41 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-)
arch/x86/kernel/cpu/mcheck/mce_intel.c +23 -18
@@ -146,6 +146,27 @@ void mce_intel_hcpu_update(unsigned long cpu)per_cpu (cmci_storm_state, cpu) =CMCI_STORM_NONE ; } +static void cmci_toggle_interrupt_mode (bool on) +{ +unsigned long flags, *owned; +int bank; +u64 val; + +raw_spin_lock_irqsave (&cmci_discover_lock, flags); + owned =this_cpu_ptr (mce_banks_owned); +for_each_set_bit (bank, owned,MAX_NR_BANKS ) { +rdmsrl (MSR_IA32_MCx_CTL2 (bank), val); + +if (on) + val |=MCI_CTL2_CMCI_EN ; +else + val &= ~MCI_CTL2_CMCI_EN ; + +wrmsrl (MSR_IA32_MCx_CTL2 (bank), val); + } +raw_spin_unlock_irqrestore (&cmci_discover_lock, flags); +} +unsigned long cmci_intel_adjust_timer (unsigned long interval) { if ((this_cpu_read(cmci_backoff_cnt) > 0) &&
@@ -175,7 +196,7 @@ unsigned long cmci_intel_adjust_timer(unsigned long interval)*/ if (!atomic_read (&cmci_storm_on_cpus)) {__this_cpu_write (cmci_storm_state,CMCI_STORM_NONE ); -cmci_reenable (); +cmci_toggle_interrupt_mode (true);cmci_recheck (); }return CMCI_POLL_INTERVAL ;
@@ -186,22 +207,6 @@ unsigned long cmci_intel_adjust_timer(unsigned long interval) } } -static void cmci_storm_disable_banks (void ) -{ -unsigned long flags, *owned; -int bank; -u64 val; - -raw_spin_lock_irqsave (&cmci_discover_lock, flags); - owned =this_cpu_ptr (mce_banks_owned); -for_each_set_bit (bank, owned,MAX_NR_BANKS ) { -rdmsrl (MSR_IA32_MCx_CTL2 (bank), val); - val &= ~MCI_CTL2_CMCI_EN ; -wrmsrl (MSR_IA32_MCx_CTL2 (bank), val); - } -raw_spin_unlock_irqrestore (&cmci_discover_lock, flags); -} -static bool cmci_storm_detect (void ) {unsigned int cnt =__this_cpu_read (cmci_storm_cnt);
@@ -223,7 +228,7 @@ static bool cmci_storm_detect(void)if (cnt <=CMCI_STORM_THRESHOLD )return false; -cmci_storm_disable_banks (); +cmci_toggle_interrupt_mode (false);__this_cpu_write (cmci_storm_state,CMCI_STORM_ACTIVE ); r =atomic_add_return (1 , &cmci_storm_on_cpus);mce_timer_kick (CMCI_STORM_INTERVAL );
Borislav Petkov
maintainerPATCH 10/13 RAS: Add a menuconfig option with descriptive text
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
Text taken a previous patch from "Gong Chen" <[email protected]>.
--- drivers/ras/Kconfig | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
drivers/ras/Kconfig +32 -2
@@ -1,2 +1,32 @@ -config RAS - bool +menuconfig RAS + bool "Reliability, Availability, Serviceability features" + help + Reliability, availability, and serviceability (RAS) is a computer + hardware engineering term. Computers designed with higher levels + of RAS have a multitude of features that protect data integrity + and help them stay available for long periods of time without + failure. + + Reliability can be defined as the probability that the system will + produce correct outputs up to some given time. Reliability is + enhanced by features that help to avoid, detect and repair hardware + faults. + + Availability is the probability a system is operational at a given + time, i.e. the amount of time a device is actually operating as the + percentage of total time it should be operating. + + Serviceability or maintainability is the simplicity and speed with + which a system can be repaired or maintained; if the time to repair + a failed system increases, then availability will decrease. + + Note that Reliability and Availability are distinct concepts: + Reliability is a measure of the ability of a system to function + correctly, including avoiding data corruption, whereas Availability + measures how often it is available for use, even though it may not + be functioning correctly. For example, a server may run forever and + so have ideal availability, but may be unreliable, with frequent + data corruption. + +if RAS +endif
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Borislav Petkov
merge bot[tip:ras/core] RAS: Add a menuconfig option with descriptive text
RAS: Add a menuconfig option with descriptive text
Commit-ID: 9b45ef443acde55526485db37440cd3e8f03d544 Gitweb: http://git.kernel.org/tip/9b45ef443acde55526485db37440cd3e8f03d544 Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:42 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:53 +0200
RAS: Add a menuconfig option with descriptive text
Text taken a previous patch from "Gong Chen" <[email protected]>.
--- drivers/ras/Kconfig | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-)
drivers/ras/Kconfig +32 -2
@@ -1,2 +1,32 @@ -config RAS - bool +menuconfig RAS + bool "Reliability, Availability and Serviceability (RAS) features" + help + Reliability, availability and serviceability (RAS) is a computer + hardware engineering term. Computers designed with higher levels + of RAS have a multitude of features that protect data integrity + and help them stay available for long periods of time without + failure. + + Reliability can be defined as the probability that the system will + produce correct outputs up to some given time. Reliability is + enhanced by features that help to avoid, detect and repair hardware + faults. + + Availability is the probability a system is operational at a given + time, i.e. the amount of time a device is actually operating as the + percentage of total time it should be operating. + + Serviceability or maintainability is the simplicity and speed with + which a system can be repaired or maintained; if the time to repair + a failed system increases, then availability will decrease. + + Note that Reliability and Availability are distinct concepts: + Reliability is a measure of the ability of a system to function + correctly, including avoiding data corruption, whereas Availability + measures how often it is available for use, even though it may not + be functioning correctly. For example, a server may run forever and + so have ideal availability, but may be unreliable, with frequent + data corruption. + +if RAS +endif
Borislav Petkov
maintainerPATCH 11/13 x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check()
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
The "rcu_" prefix misleads for it being a proper RCU interface which is not. It basically checks whether we're preemptible or holding the chrdev_read mutex.
Rename it accordingly.
--- arch/x86/kernel/cpu/mcheck/mce.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mcheck/mce.c +4 -4
@@ -52,11 +52,11 @@static DEFINE_MUTEX (mce_chrdev_read_mutex); -#define rcu_dereference_check_mce (p) \ +#define mce_log_get_idx_check (p) \ ({ \ rcu_lockdep_assert(rcu_read_lock_sched_held() || \ lockdep_is_held(&mce_chrdev_read_mutex), \ - "suspicious rcu_dereference_check_mce() usage"); \ + "suspicious mce_log_get_idx_check() usage"); \ smp_load_acquire(&(p)); \ })
@@ -165,7 +165,7 @@ void mce_log(struct mce *mce) mce->finished =0 ;wmb ();for (;;) { - entry =rcu_dereference_check_mce (mcelog.next); + entry =mce_log_get_idx_check (mcelog.next);for (;;) {/*
@@ -1812,7 +1812,7 @@ static ssize_t mce_chrdev_read(struct file *filp, char __user *ubuf, goto out; } - next =rcu_dereference_check_mce (mcelog.next); + next =mce_log_get_idx_check (mcelog.next);/* Only supports full reads right now */ err = -EINVAL ;
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Borislav Petkov
merge bot[tip:ras/core] x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check()
x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check()
Commit-ID: 9a7783d02197f299f71b4fa2364a345c05f92b83 Gitweb: http://git.kernel.org/tip/9a7783d02197f299f71b4fa2364a345c05f92b83 Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:43 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:53 +0200
x86/mce: Rename rcu_dereference_check_mce() to mce_log_get_idx_check()
The "rcu_" prefix misleads for it being a proper RCU interface which is not. It basically checks whether we're preemptible or holding the chrdev_read mutex.
Rename it accordingly.
--- arch/x86/kernel/cpu/mcheck/mce.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/x86/kernel/cpu/mcheck/mce.c +4 -4
@@ -52,11 +52,11 @@static DEFINE_MUTEX (mce_chrdev_read_mutex); -#define rcu_dereference_check_mce (p) \ +#define mce_log_get_idx_check (p) \ ({ \ rcu_lockdep_assert(rcu_read_lock_sched_held() || \ lockdep_is_held(&mce_chrdev_read_mutex), \ - "suspicious rcu_dereference_check_mce() usage"); \ + "suspicious mce_log_get_idx_check() usage"); \ smp_load_acquire(&(p)); \ })
@@ -165,7 +165,7 @@ void mce_log(struct mce *mce) mce->finished =0 ;wmb ();for (;;) { - entry =rcu_dereference_check_mce (mcelog.next); + entry =mce_log_get_idx_check (mcelog.next);for (;;) {/*
@@ -1812,7 +1812,7 @@ static ssize_t mce_chrdev_read(struct file *filp, char __user *ubuf, goto out; } - next =rcu_dereference_check_mce (mcelog.next); + next =mce_log_get_idx_check (mcelog.next);/* Only supports full reads right now */ err = -EINVAL ;
Borislav Petkov
maintainerPATCH 12/13 x86/mce: Add a wrapper around mce_log() for injection
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
Will be used by an injector module in a following patch.
Additionally, add a missing module export reported by 0-DAY kernel test.
--- arch/x86/kernel/cpu/mcheck/mce-internal.h | 2 ++ arch/x86/kernel/cpu/mcheck/mce.c | 8 ++++++++ 2 files changed, 10 insertions(+)
arch/x86/kernel/cpu/mcheck/mce-internal.h +2 -0
@@ -79,3 +79,5 @@ static inline int apei_clear_mce(u64 record_id) return -EINVAL; }#endif + +void mce_inject_log (struct mce *m);
arch/x86/kernel/cpu/mcheck/mce.c +8 -0
@@ -199,6 +199,14 @@ void mce_log(struct mce *mce)set_bit (0 , &mce_need_notify); } +void mce_inject_log (struct mce *m) +{ +mutex_lock (&mce_chrdev_read_mutex); +mce_log (m); +mutex_unlock (&mce_chrdev_read_mutex); +} +EXPORT_SYMBOL_GPL (mce_inject_log); +static struct notifier_block mce_srao_nb;void mce_register_decode_chain (struct notifier_block *nb)
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Borislav Petkov
merge bot[tip:ras/core] x86/mce: Add a wrapper around mce_log() for injection
x86/mce: Add a wrapper around mce_log() for injection
Commit-ID: a79da38494ec23f1a7d6ee734e07e9575fd18b58 Gitweb: http://git.kernel.org/tip/a79da38494ec23f1a7d6ee734e07e9575fd18b58 Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:44 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:53 +0200
x86/mce: Add a wrapper around mce_log() for injection
Will be used by an injector module in a following patch.
Additionally, add a missing module export reported by 0-DAY kernel test.
--- arch/x86/kernel/cpu/mcheck/mce-internal.h | 2 ++ arch/x86/kernel/cpu/mcheck/mce.c | 8 ++++++++ 2 files changed, 10 insertions(+)
arch/x86/kernel/cpu/mcheck/mce-internal.h +2 -0
@@ -79,3 +79,5 @@ static inline int apei_clear_mce(u64 record_id) return -EINVAL; }#endif + +void mce_inject_log (struct mce *m);
arch/x86/kernel/cpu/mcheck/mce.c +8 -0
@@ -199,6 +199,14 @@ void mce_log(struct mce *mce)set_bit (0 , &mce_need_notify); } +void mce_inject_log (struct mce *m) +{ +mutex_lock (&mce_chrdev_read_mutex); +mce_log (m); +mutex_unlock (&mce_chrdev_read_mutex); +} +EXPORT_SYMBOL_GPL (mce_inject_log); +static struct notifier_block mce_srao_nb;void mce_register_decode_chain (struct notifier_block *nb)
Borislav Petkov
maintainerPATCH 13/13 x86/ras: Move AMD MCE injector to arch/x86/ras/
In reply to Borislav PetkovFrom: Borislav Petkov <[email protected]>
This is an x86-specific module and would benefit from being closer to the arch code. Move it there. Update copyright while at it.
---
arch/x86/Makefile | 2 ++
arch/x86/ras/Kconfig | 11 +++++++++++
arch/x86/ras/Makefile | 2 ++
{drivers/edac => arch/x86/ras}/mce_amd_inj.c | 6 +++---
drivers/edac/Kconfig | 10 ----------
drivers/edac/Makefile | 1 -
drivers/ras/Kconfig | 3 +++
7 files changed, 21 insertions(+), 14 deletions(-)
create mode 100644 arch/x86/ras/Kconfig
create mode 100644 arch/x86/ras/Makefile
rename {drivers/edac => arch/x86/ras}/mce_amd_inj.c (98%)arch/x86/Makefile +2 -0
@@ -212,6 +212,8 @@ drivers-$(CONFIG_PM) += arch/x86/power/ drivers-$(CONFIG_FB) += arch/x86/video/ +drivers-$(CONFIG_RAS) += arch/x86/ras/ + #### # boot loader support. Several targets are kept for legacy purposes
arch/x86/ras/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config AMD_MCE_INJ + tristate "Simple MCE injection interface for AMD processors" + depends on RAS && EDAC_DECODE_MCE && DEBUG_FS + default n + help + This is a simple debugfs interface to inject MCEs and test different + aspects of the MCE handling code. + + WARNING: Do not even assume this interface is staying stable! + +
arch/x86/ras/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_AMD_MCE_INJ) += mce_amd_inj.o +
arch/x86/ras/mce_amd_inj.c renamed from drivers/edac/mce_amd_inj.c +3 -3
@@ -6,7 +6,7 @@* This file may be distributed under the terms of the GNU General Public * License version 2. * -* Copyright (c) 2010-14: Borislav Petkov <[email protected]> +* Copyright (c) 2010-15: Borislav Petkov <[email protected]> * Advanced Micro Devices Inc. */
@@ -19,7 +19,7 @@#include <linux/uaccess.h> #include <asm/mce.h> -#include "mce_amd.h" +#include "../kernel/cpu/mcheck/mce-internal.h" /* * Collect all the MCi_XXX settings
@@ -195,7 +195,7 @@ static void do_inject(void) i_mce.status |=MCI_STATUS_MISCV ;if (inj_type ==SW_INJ ) { -amd_decode_mce (NULL ,0 , &i_mce); +mce_inject_log (&i_mce);return ; }
drivers/edac/Kconfig +0 -10
@@ -61,16 +61,6 @@ config EDAC_DECODE_MCE which occur really early upon boot, before the module infrastructure has been initialized. -config EDAC_MCE_INJ - tristate "Simple MCE injection interface" - depends on EDAC_DECODE_MCE && DEBUG_FS - default n - help - This is a simple debugfs interface to inject MCEs and test different - aspects of the MCE handling code. - - WARNING: Do not even assume this interface is staying stable! - config EDAC_MM_EDAC tristate "Main Memory EDAC (Error Detection And Correction) reporting" select RAS
drivers/edac/Makefile +0 -1
@@ -17,7 +17,6 @@ edac_core-y += edac_pci.o edac_pci_sysfs.o endif obj-$(CONFIG_EDAC_GHES) += ghes_edac.o -obj-$(CONFIG_EDAC_MCE_INJ) += mce_amd_inj.o edac_mce_amd-y := mce_amd.o obj-$(CONFIG_EDAC_DECODE_MCE) += edac_mce_amd.o
drivers/ras/Kconfig +3 -0
@@ -29,4 +29,7 @@ menuconfig RAS data corruption. if RAS + +source arch/x86/ras/Kconfig + endif
Signature · 1 line
2.5.0.rc2.28.g6003e7f
tip-bot for Borislav Petkov
merge bot[tip:ras/core] x86/ras: Move AMD MCE injector to arch/x86/ras/
x86/ras: Move AMD MCE injector to arch/x86/ras/
Commit-ID: 6c36dfe949187dc2729abfad4b083758ac5c2e0e Gitweb: http://git.kernel.org/tip/6c36dfe949187dc2729abfad4b083758ac5c2e0e Author: Borislav Petkov <[email protected]> AuthorDate: Wed, 12 Aug 2015 18:29:45 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 13 Aug 2015 10:12:54 +0200
x86/ras: Move AMD MCE injector to arch/x86/ras/
This is an x86-specific module and would benefit from being closer to the arch code. Move it there. Update copyright while at it.
---
arch/x86/Makefile | 2 ++
arch/x86/ras/Kconfig | 11 +++++++++++
arch/x86/ras/Makefile | 2 ++
{drivers/edac => arch/x86/ras}/mce_amd_inj.c | 6 +++---
drivers/edac/Kconfig | 10 ----------
drivers/edac/Makefile | 1 -
drivers/ras/Kconfig | 3 +++
7 files changed, 21 insertions(+), 14 deletions(-)arch/x86/Makefile +2 -0
@@ -212,6 +212,8 @@ drivers-$(CONFIG_PM) += arch/x86/power/ drivers-$(CONFIG_FB) += arch/x86/video/ +drivers-$(CONFIG_RAS) += arch/x86/ras/ + #### # boot loader support. Several targets are kept for legacy purposes
arch/x86/ras/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +config AMD_MCE_INJ + tristate "Simple MCE injection interface for AMD processors" + depends on RAS && EDAC_DECODE_MCE && DEBUG_FS + default n + help + This is a simple debugfs interface to inject MCEs and test different + aspects of the MCE handling code. + + WARNING: Do not even assume this interface is staying stable! + +
arch/x86/ras/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_AMD_MCE_INJ) += mce_amd_inj.o +
arch/x86/ras/mce_amd_inj.c renamed from drivers/edac/mce_amd_inj.c +3 -3
@@ -6,7 +6,7 @@* This file may be distributed under the terms of the GNU General Public * License version 2. * -* Copyright (c) 2010-14: Borislav Petkov <[email protected]> +* Copyright (c) 2010-15: Borislav Petkov <[email protected]> * Advanced Micro Devices Inc. */
@@ -19,7 +19,7 @@#include <linux/uaccess.h> #include <asm/mce.h> -#include "mce_amd.h" +#include "../kernel/cpu/mcheck/mce-internal.h" /* * Collect all the MCi_XXX settings
@@ -195,7 +195,7 @@ static void do_inject(void) i_mce.status |=MCI_STATUS_MISCV ;if (inj_type ==SW_INJ ) { -amd_decode_mce (NULL ,0 , &i_mce); +mce_inject_log (&i_mce);return ; }
drivers/edac/Kconfig +0 -10
@@ -61,16 +61,6 @@ config EDAC_DECODE_MCE which occur really early upon boot, before the module infrastructure has been initialized. -config EDAC_MCE_INJ - tristate "Simple MCE injection interface" - depends on EDAC_DECODE_MCE && DEBUG_FS - default n - help - This is a simple debugfs interface to inject MCEs and test different - aspects of the MCE handling code. - - WARNING: Do not even assume this interface is staying stable! - config EDAC_MM_EDAC tristate "Main Memory EDAC (Error Detection And Correction) reporting" select RAS
drivers/edac/Makefile +0 -1
@@ -17,7 +17,6 @@ edac_core-y += edac_pci.o edac_pci_sysfs.o endif obj-$(CONFIG_EDAC_GHES) += ghes_edac.o -obj-$(CONFIG_EDAC_MCE_INJ) += mce_amd_inj.o edac_mce_amd-y := mce_amd.o obj-$(CONFIG_EDAC_DECODE_MCE) += edac_mce_amd.o
drivers/ras/Kconfig +3 -0
@@ -29,4 +29,7 @@ menuconfig RAS data corruption. if RAS + +source arch/x86/ras/Kconfig + endif