Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138631
b: refs/heads/master
c: d6b7558
h: refs/heads/master
i:
  138629: 485ad28
  138627: c59a091
  138623: 3d9b685
v: v3
  • Loading branch information
Andi Kleen authored and H. Peter Anvin committed Feb 17, 2009
1 parent 73307d6 commit 9f5074c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5b4408fdaa62474dd9485cddb9126370d90d4b82
refs/heads/master: d6b75584a3eaab8cb2ab3e8cf90c5e57c1928a85
23 changes: 23 additions & 0 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,27 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
cpu_clear(cpu, mce_device_initialized);
}

/* Make sure there are no machine checks on offlined CPUs. */
static void __cpuexit mce_disable_cpu(void *h)
{
int i;

if (!mce_available(&current_cpu_data))
return;
for (i = 0; i < banks; i++)
wrmsrl(MSR_IA32_MC0_CTL + i*4, 0);
}

static void __cpuexit mce_reenable_cpu(void *h)
{
int i;

if (!mce_available(&current_cpu_data))
return;
for (i = 0; i < banks; i++)
wrmsrl(MSR_IA32_MC0_CTL + i*4, bank[i]);
}

/* Get notified when a cpu comes on/off. Be hotplug friendly. */
static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
Expand All @@ -929,11 +950,13 @@ static int __cpuinit mce_cpu_callback(struct notifier_block *nfb,
case CPU_DOWN_PREPARE:
case CPU_DOWN_PREPARE_FROZEN:
del_timer_sync(t);
smp_call_function_single(cpu, mce_disable_cpu, NULL, 1);
break;
case CPU_DOWN_FAILED:
case CPU_DOWN_FAILED_FROZEN:
t->expires = round_jiffies_relative(jiffies + next_interval);
add_timer_on(t, cpu);
smp_call_function_single(cpu, mce_reenable_cpu, NULL, 1);
break;
}
return NOTIFY_OK;
Expand Down

0 comments on commit 9f5074c

Please sign in to comment.