diff options
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_64.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c index 4e2b1bc5131c..1db94c0d5aaf 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_64.c +++ b/arch/x86/kernel/cpu/mcheck/mce_64.c | |||
@@ -906,6 +906,27 @@ static __cpuinit void mce_remove_device(unsigned int cpu) | |||
906 | cpu_clear(cpu, mce_device_initialized); | 906 | cpu_clear(cpu, mce_device_initialized); |
907 | } | 907 | } |
908 | 908 | ||
909 | /* Make sure there are no machine checks on offlined CPUs. */ | ||
910 | static void __cpuexit mce_disable_cpu(void *h) | ||
911 | { | ||
912 | int i; | ||
913 | |||
914 | if (!mce_available(¤t_cpu_data)) | ||
915 | return; | ||
916 | for (i = 0; i < banks; i++) | ||
917 | wrmsrl(MSR_IA32_MC0_CTL + i*4, 0); | ||
918 | } | ||
919 | |||
920 | static void __cpuexit mce_reenable_cpu(void *h) | ||
921 | { | ||
922 | int i; | ||
923 | |||
924 | if (!mce_available(¤t_cpu_data)) | ||
925 | return; | ||
926 | for (i = 0; i < banks; i++) | ||
927 | wrmsrl(MSR_IA32_MC0_CTL + i*4, bank[i]); | ||
928 | } | ||
929 | |||
909 | /* Get notified when a cpu comes on/off. Be hotplug friendly. */ | 930 | /* Get notified when a cpu comes on/off. Be hotplug friendly. */ |
910 | static int __cpuinit mce_cpu_callback(struct notifier_block *nfb, | 931 | static int __cpuinit mce_cpu_callback(struct notifier_block *nfb, |
911 | unsigned long action, void *hcpu) | 932 | unsigned long action, void *hcpu) |
@@ -929,11 +950,13 @@ static int __cpuinit mce_cpu_callback(struct notifier_block *nfb, | |||
929 | case CPU_DOWN_PREPARE: | 950 | case CPU_DOWN_PREPARE: |
930 | case CPU_DOWN_PREPARE_FROZEN: | 951 | case CPU_DOWN_PREPARE_FROZEN: |
931 | del_timer_sync(t); | 952 | del_timer_sync(t); |
953 | smp_call_function_single(cpu, mce_disable_cpu, NULL, 1); | ||
932 | break; | 954 | break; |
933 | case CPU_DOWN_FAILED: | 955 | case CPU_DOWN_FAILED: |
934 | case CPU_DOWN_FAILED_FROZEN: | 956 | case CPU_DOWN_FAILED_FROZEN: |
935 | t->expires = round_jiffies_relative(jiffies + next_interval); | 957 | t->expires = round_jiffies_relative(jiffies + next_interval); |
936 | add_timer_on(t, cpu); | 958 | add_timer_on(t, cpu); |
959 | smp_call_function_single(cpu, mce_reenable_cpu, NULL, 1); | ||
937 | break; | 960 | break; |
938 | } | 961 | } |
939 | return NOTIFY_OK; | 962 | return NOTIFY_OK; |