Skip to content

Commit df58bee

Browse files
committed
Merge branch 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-mce-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (21 commits) x86, mce: Fix compilation with !CONFIG_DEBUG_FS in mce-severity.c x86, mce: CE in last bank prevents panic by unknown MCE x86, mce: Fake panic support for MCE testing x86, mce: Move debugfs mce dir creating to mce.c x86, mce: Support specifying raise mode for software MCE injection x86, mce: Support specifying context for software mce injection x86, mce: fix reporting of Thermal Monitoring mechanism enabled x86, mce: remove never executed code x86, mce: add missing __cpuinit tags x86, mce: fix "mce" boot option handling for CONFIG_X86_NEW_MCE x86, mce: don't log boot MCEs on Pentium M (model == 13) CPUs x86: mce: Lower maximum number of banks to architecture limit x86: mce: macros to compute banks MSRs x86: mce: Move per bank data in a single datastructure x86: mce: Move code in mce.c x86: mce: Rename CONFIG_X86_NEW_MCE to CONFIG_X86_MCE x86: mce: Remove old i386 machine check code x86: mce: Update X86_MCE description in x86/Kconfig x86: mce: Make CONFIG_X86_ANCIENT_MCE dependent on CONFIG_X86_MCE x86, mce: use atomic_inc_return() instead of add by 1 ... Manually fixed up trivial conflicts: Documentation/feature-removal-schedule.txt arch/x86/kernel/cpu/mcheck/mce.c
2 parents dcbf77b + e34e77c commit df58bee

File tree

20 files changed

+363
-777
lines changed

20 files changed

+363
-777
lines changed

Documentation/feature-removal-schedule.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -428,16 +428,6 @@ Who: Johannes Berg <johannes@sipsolutions.net>
428428

429429
----------------------------
430430

431-
What: CONFIG_X86_OLD_MCE
432-
When: 2.6.32
433-
Why: Remove the old legacy 32bit machine check code. This has been
434-
superseded by the newer machine check code from the 64bit port,
435-
but the old version has been kept around for easier testing. Note this
436-
doesn't impact the old P5 and WinChip machine check handlers.
437-
Who: Andi Kleen <andi@firstfloor.org>
438-
439-
----------------------------
440-
441431
What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be
442432
exported interface anymore.
443433
When: 2.6.33

arch/x86/Kconfig

Lines changed: 9 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -783,56 +783,32 @@ config X86_REROUTE_FOR_BROKEN_BOOT_IRQS
783783
increased on these systems.
784784

785785
config X86_MCE
786-
bool "Machine Check Exception"
786+
bool "Machine Check / overheating reporting"
787787
---help---
788-
Machine Check Exception support allows the processor to notify the
789-
kernel if it detects a problem (e.g. overheating, component failure).
788+
Machine Check support allows the processor to notify the
789+
kernel if it detects a problem (e.g. overheating, data corruption).
790790
The action the kernel takes depends on the severity of the problem,
791-
ranging from a warning message on the console, to halting the machine.
792-
Your processor must be a Pentium or newer to support this - check the
793-
flags in /proc/cpuinfo for mce. Note that some older Pentium systems
794-
have a design flaw which leads to false MCE events - hence MCE is
795-
disabled on all P5 processors, unless explicitly enabled with "mce"
796-
as a boot argument. Similarly, if MCE is built in and creates a
797-
problem on some new non-standard machine, you can boot with "nomce"
798-
to disable it. MCE support simply ignores non-MCE processors like
799-
the 386 and 486, so nearly everyone can say Y here.
800-
801-
config X86_OLD_MCE
802-
depends on X86_32 && X86_MCE
803-
bool "Use legacy machine check code (will go away)"
804-
default n
805-
select X86_ANCIENT_MCE
806-
---help---
807-
Use the old i386 machine check code. This is merely intended for
808-
testing in a transition period. Try this if you run into any machine
809-
check related software problems, but report the problem to
810-
linux-kernel. When in doubt say no.
811-
812-
config X86_NEW_MCE
813-
depends on X86_MCE
814-
bool
815-
default y if (!X86_OLD_MCE && X86_32) || X86_64
791+
ranging from warning messages to halting the machine.
816792

817793
config X86_MCE_INTEL
818794
def_bool y
819795
prompt "Intel MCE features"
820-
depends on X86_NEW_MCE && X86_LOCAL_APIC
796+
depends on X86_MCE && X86_LOCAL_APIC
821797
---help---
822798
Additional support for intel specific MCE features such as
823799
the thermal monitor.
824800

825801
config X86_MCE_AMD
826802
def_bool y
827803
prompt "AMD MCE features"
828-
depends on X86_NEW_MCE && X86_LOCAL_APIC
804+
depends on X86_MCE && X86_LOCAL_APIC
829805
---help---
830806
Additional support for AMD specific MCE features such as
831807
the DRAM Error Threshold.
832808

833809
config X86_ANCIENT_MCE
834810
def_bool n
835-
depends on X86_32
811+
depends on X86_32 && X86_MCE
836812
prompt "Support for old Pentium 5 / WinChip machine checks"
837813
---help---
838814
Include support for machine check handling on old Pentium 5 or WinChip
@@ -845,36 +821,16 @@ config X86_MCE_THRESHOLD
845821
default y
846822

847823
config X86_MCE_INJECT
848-
depends on X86_NEW_MCE
824+
depends on X86_MCE
849825
tristate "Machine check injector support"
850826
---help---
851827
Provide support for injecting machine checks for testing purposes.
852828
If you don't know what a machine check is and you don't do kernel
853829
QA it is safe to say n.
854830

855-
config X86_MCE_NONFATAL
856-
tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
857-
depends on X86_OLD_MCE
858-
---help---
859-
Enabling this feature starts a timer that triggers every 5 seconds which
860-
will look at the machine check registers to see if anything happened.
861-
Non-fatal problems automatically get corrected (but still logged).
862-
Disable this if you don't want to see these messages.
863-
Seeing the messages this option prints out may be indicative of dying
864-
or out-of-spec (ie, overclocked) hardware.
865-
This option only does something on certain CPUs.
866-
(AMD Athlon/Duron and Intel Pentium 4)
867-
868-
config X86_MCE_P4THERMAL
869-
bool "check for P4 thermal throttling interrupt."
870-
depends on X86_OLD_MCE && X86_MCE && (X86_UP_APIC || SMP)
871-
---help---
872-
Enabling this feature will cause a message to be printed when the P4
873-
enters thermal throttling.
874-
875831
config X86_THERMAL_VECTOR
876832
def_bool y
877-
depends on X86_MCE_P4THERMAL || X86_MCE_INTEL
833+
depends on X86_MCE_INTEL
878834

879835
config VM86
880836
bool "Enable VM86 support" if EMBEDDED

arch/x86/include/asm/entry_arch.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ BUILD_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
6161
BUILD_INTERRUPT(threshold_interrupt,THRESHOLD_APIC_VECTOR)
6262
#endif
6363

64-
#ifdef CONFIG_X86_NEW_MCE
64+
#ifdef CONFIG_X86_MCE
6565
BUILD_INTERRUPT(mce_self_interrupt,MCE_SELF_VECTOR)
6666
#endif
6767

arch/x86/include/asm/mce.h

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010

1111
#define MCG_BANKCNT_MASK 0xff /* Number of Banks */
12-
#define MCG_CTL_P (1ULL<<8) /* MCG_CAP register available */
12+
#define MCG_CTL_P (1ULL<<8) /* MCG_CTL register available */
1313
#define MCG_EXT_P (1ULL<<9) /* Extended registers available */
1414
#define MCG_CMCI_P (1ULL<<10) /* CMCI supported */
1515
#define MCG_EXT_CNT_MASK 0xff0000 /* Number of Extended registers */
@@ -38,6 +38,14 @@
3838
#define MCM_ADDR_MEM 3 /* memory address */
3939
#define MCM_ADDR_GENERIC 7 /* generic */
4040

41+
#define MCJ_CTX_MASK 3
42+
#define MCJ_CTX(flags) ((flags) & MCJ_CTX_MASK)
43+
#define MCJ_CTX_RANDOM 0 /* inject context: random */
44+
#define MCJ_CTX_PROCESS 1 /* inject context: process */
45+
#define MCJ_CTX_IRQ 2 /* inject context: IRQ */
46+
#define MCJ_NMI_BROADCAST 4 /* do NMI broadcasting */
47+
#define MCJ_EXCEPTION 8 /* raise as exception */
48+
4149
/* Fields are zero when not available */
4250
struct mce {
4351
__u64 status;
@@ -48,8 +56,8 @@ struct mce {
4856
__u64 tsc; /* cpu time stamp counter */
4957
__u64 time; /* wall time_t when error was detected */
5058
__u8 cpuvendor; /* cpu vendor as encoded in system.h */
51-
__u8 pad1;
52-
__u16 pad2;
59+
__u8 inject_flags; /* software inject flags */
60+
__u16 pad;
5361
__u32 cpuid; /* CPUID 1 EAX */
5462
__u8 cs; /* code segment */
5563
__u8 bank; /* machine check bank */
@@ -115,13 +123,6 @@ void mcheck_init(struct cpuinfo_x86 *c);
115123
static inline void mcheck_init(struct cpuinfo_x86 *c) {}
116124
#endif
117125

118-
#ifdef CONFIG_X86_OLD_MCE
119-
extern int nr_mce_banks;
120-
void amd_mcheck_init(struct cpuinfo_x86 *c);
121-
void intel_p4_mcheck_init(struct cpuinfo_x86 *c);
122-
void intel_p6_mcheck_init(struct cpuinfo_x86 *c);
123-
#endif
124-
125126
#ifdef CONFIG_X86_ANCIENT_MCE
126127
void intel_p5_mcheck_init(struct cpuinfo_x86 *c);
127128
void winchip_mcheck_init(struct cpuinfo_x86 *c);
@@ -137,10 +138,11 @@ void mce_log(struct mce *m);
137138
DECLARE_PER_CPU(struct sys_device, mce_dev);
138139

139140
/*
140-
* To support more than 128 would need to escape the predefined
141-
* Linux defined extended banks first.
141+
* Maximum banks number.
142+
* This is the limit of the current register layout on
143+
* Intel CPUs.
142144
*/
143-
#define MAX_NR_BANKS (MCE_EXTENDED_BANK - 1)
145+
#define MAX_NR_BANKS 32
144146

145147
#ifdef CONFIG_X86_MCE_INTEL
146148
extern int mce_cmci_disabled;
@@ -208,11 +210,7 @@ extern void (*threshold_cpu_callback)(unsigned long action, unsigned int cpu);
208210

209211
void intel_init_thermal(struct cpuinfo_x86 *c);
210212

211-
#ifdef CONFIG_X86_NEW_MCE
212213
void mce_log_therm_throt_event(__u64 status);
213-
#else
214-
static inline void mce_log_therm_throt_event(__u64 status) {}
215-
#endif
216214

217215
#endif /* __KERNEL__ */
218216
#endif /* _ASM_X86_MCE_H */

arch/x86/include/asm/msr-index.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,15 @@
8181
#define MSR_IA32_MC0_ADDR 0x00000402
8282
#define MSR_IA32_MC0_MISC 0x00000403
8383

84+
#define MSR_IA32_MCx_CTL(x) (MSR_IA32_MC0_CTL + 4*(x))
85+
#define MSR_IA32_MCx_STATUS(x) (MSR_IA32_MC0_STATUS + 4*(x))
86+
#define MSR_IA32_MCx_ADDR(x) (MSR_IA32_MC0_ADDR + 4*(x))
87+
#define MSR_IA32_MCx_MISC(x) (MSR_IA32_MC0_MISC + 4*(x))
88+
8489
/* These are consecutive and not in the normal 4er MCE bank block */
8590
#define MSR_IA32_MC0_CTL2 0x00000280
91+
#define MSR_IA32_MCx_CTL2(x) (MSR_IA32_MC0_CTL2 + (x))
92+
8693
#define CMCI_EN (1ULL << 30)
8794
#define CMCI_THRESHOLD_MASK 0xffffULL
8895

@@ -215,6 +222,10 @@
215222

216223
#define THERM_STATUS_PROCHOT (1 << 0)
217224

225+
#define MSR_THERM2_CTL 0x0000019d
226+
227+
#define MSR_THERM2_CTL_TM_SELECT (1ULL << 16)
228+
218229
#define MSR_IA32_MISC_ENABLE 0x000001a0
219230

220231
/* MISC_ENABLE bits: architectural */

arch/x86/kernel/apic/nmi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static inline unsigned int get_nmi_count(int cpu)
6666

6767
static inline int mce_in_progress(void)
6868
{
69-
#if defined(CONFIG_X86_NEW_MCE)
69+
#if defined(CONFIG_X86_MCE)
7070
return atomic_read(&mce_entry) > 0;
7171
#endif
7272
return 0;

arch/x86/kernel/cpu/mcheck/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
obj-y = mce.o
1+
obj-y = mce.o mce-severity.o
22

3-
obj-$(CONFIG_X86_NEW_MCE) += mce-severity.o
4-
obj-$(CONFIG_X86_OLD_MCE) += k7.o p4.o p6.o
53
obj-$(CONFIG_X86_ANCIENT_MCE) += winchip.o p5.o
64
obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o
75
obj-$(CONFIG_X86_MCE_AMD) += mce_amd.o
8-
obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o
96
obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
107
obj-$(CONFIG_X86_MCE_INJECT) += mce-inject.o
118

arch/x86/kernel/cpu/mcheck/k7.c

Lines changed: 0 additions & 116 deletions
This file was deleted.

0 commit comments

Comments
 (0)