-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 148868 b: refs/heads/master c: a65d086 h: refs/heads/master v: v3
- Loading branch information
Thomas Gleixner
authored and
H. Peter Anvin
committed
May 28, 2009
1 parent
7d0a28f
commit 14eb17a
Showing
6 changed files
with
90 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: 6cc6f3ebd19fea722c19630af5ad68af7f51d493 | ||
refs/heads/master: a65d086235208a3b3546e209d2210048549099b2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
obj-y = mce_$(BITS).o therm_throt.o | ||
|
||
obj-$(CONFIG_X86_32) += k7.o p4.o p5.o p6.o winchip.o | ||
obj-$(CONFIG_X86_MCE_INTEL) += mce_intel_64.o | ||
obj-$(CONFIG_X86_MCE_P4THERMAL) += mce_intel.o | ||
obj-$(CONFIG_X86_MCE_INTEL) += mce_intel_64.o mce_intel.o | ||
obj-$(CONFIG_X86_MCE_AMD) += mce_amd_64.o | ||
obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o | ||
obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/* | ||
* Common code for Intel machine checks | ||
*/ | ||
#include <linux/interrupt.h> | ||
#include <linux/kernel.h> | ||
#include <linux/types.h> | ||
#include <linux/init.h> | ||
#include <linux/smp.h> | ||
|
||
#include <asm/therm_throt.h> | ||
#include <asm/processor.h> | ||
#include <asm/system.h> | ||
#include <asm/apic.h> | ||
#include <asm/msr.h> | ||
|
||
#include "mce.h" | ||
|
||
void intel_init_thermal(struct cpuinfo_x86 *c) | ||
{ | ||
unsigned int cpu = smp_processor_id(); | ||
int tm2 = 0; | ||
u32 l, h; | ||
|
||
/* Thermal monitoring depends on ACPI and clock modulation*/ | ||
if (!cpu_has(c, X86_FEATURE_ACPI) || !cpu_has(c, X86_FEATURE_ACC)) | ||
return; | ||
|
||
/* | ||
* First check if its enabled already, in which case there might | ||
* be some SMM goo which handles it, so we can't even put a handler | ||
* since it might be delivered via SMI already: | ||
*/ | ||
rdmsr(MSR_IA32_MISC_ENABLE, l, h); | ||
h = apic_read(APIC_LVTTHMR); | ||
if ((l & (1 << 3)) && (h & APIC_DM_SMI)) { | ||
printk(KERN_DEBUG | ||
"CPU%d: Thermal monitoring handled by SMI\n", cpu); | ||
return; | ||
} | ||
|
||
if (cpu_has(c, X86_FEATURE_TM2) && (l & (1 << 13))) | ||
tm2 = 1; | ||
|
||
/* 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; | ||
} | ||
|
||
/* We'll mask the thermal vector in the lapic till we're ready: */ | ||
h = THERMAL_APIC_VECTOR | APIC_DM_FIXED | APIC_LVT_MASKED; | ||
apic_write(APIC_LVTTHMR, h); | ||
|
||
rdmsr(MSR_IA32_THERM_INTERRUPT, l, h); | ||
wrmsr(MSR_IA32_THERM_INTERRUPT, l | 0x03, h); | ||
|
||
intel_set_thermal_handler(); | ||
|
||
rdmsr(MSR_IA32_MISC_ENABLE, l, h); | ||
wrmsr(MSR_IA32_MISC_ENABLE, l | (1 << 3), h); | ||
|
||
/* Unmask the thermal vector: */ | ||
l = apic_read(APIC_LVTTHMR); | ||
apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED); | ||
|
||
printk(KERN_INFO "CPU%d: Thermal monitoring enabled (%s)\n", | ||
cpu, tm2 ? "TM2" : "TM1"); | ||
|
||
/* enable thermal throttle processing */ | ||
atomic_set(&therm_throt_en, 1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters