Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138641
b: refs/heads/master
c: b276268
h: refs/heads/master
i:
  138639: 20ff9ad
v: v3
  • Loading branch information
Andi Kleen authored and H. Peter Anvin committed Feb 24, 2009
1 parent bdd379c commit a17e12b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41fdff322e26c4a86fe65cf577f2556a650cb7bc
refs/heads/master: b276268631af3a1b0df871e10d19d492f0513d4b
5 changes: 5 additions & 0 deletions trunk/arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,11 @@ config X86_MCE_AMD
Additional support for AMD specific MCE features such as
the DRAM Error Threshold.

config X86_MCE_THRESHOLD
depends on X86_MCE_AMD || X86_MCE_INTEL
bool
default y

config X86_MCE_NONFATAL
tristate "Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4"
depends on X86_32 && X86_MCE
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/x86/include/asm/mce.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,7 @@ extern void mcheck_init(struct cpuinfo_x86 *c);
#define mcheck_init(c) do { } while (0)
#endif

extern void (*mce_threshold_vector)(void);

#endif /* __KERNEL__ */
#endif /* _ASM_X86_MCE_H */
1 change: 1 addition & 0 deletions trunk/arch/x86/kernel/cpu/mcheck/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ 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_AMD) += mce_amd_64.o
obj-$(CONFIG_X86_MCE_NONFATAL) += non-fatal.o
obj-$(CONFIG_X86_MCE_THRESHOLD) += threshold.o
15 changes: 6 additions & 9 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_amd_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ static unsigned char shared_bank[NR_BANKS] = {

static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */

static void amd_threshold_interrupt(void);

/*
* CPU Initialization
*/
Expand Down Expand Up @@ -174,6 +176,8 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
tr.reset = 0;
tr.old_limit = 0;
threshold_restart_bank(&tr);

mce_threshold_vector = amd_threshold_interrupt;
}
}
}
Expand All @@ -187,16 +191,12 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
* the interrupt goes off when error_count reaches threshold_limit.
* the handler will simply log mcelog w/ software defined bank number.
*/
asmlinkage void mce_threshold_interrupt(void)
static void amd_threshold_interrupt(void)
{
unsigned int bank, block;
struct mce m;
u32 low = 0, high = 0, address = 0;

ack_APIC_irq();
exit_idle();
irq_enter();

mce_setup(&m);

/* assume first bank caused it */
Expand Down Expand Up @@ -241,13 +241,10 @@ asmlinkage void mce_threshold_interrupt(void)
+ bank * NR_BLOCKS
+ block;
mce_log(&m);
goto out;
return;
}
}
}
out:
inc_irq_stat(irq_threshold_count);
irq_exit();
}

/*
Expand Down
24 changes: 24 additions & 0 deletions trunk/arch/x86/kernel/cpu/mcheck/threshold.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Common corrected MCE threshold handler code */
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <asm/mce.h>
#include <asm/irq_vectors.h>
#include <asm/idle.h>

static void default_threshold_interrupt(void)
{
printk(KERN_ERR "Unexpected threshold interrupt at vector %x\n",
THRESHOLD_APIC_VECTOR);
}

void (*mce_threshold_vector)(void) = default_threshold_interrupt;

asmlinkage void mce_threshold_interrupt(void)
{
ack_APIC_irq();
exit_idle();
irq_enter();
inc_irq_stat(irq_threshold_count);
mce_threshold_vector();
irq_exit();
}

0 comments on commit a17e12b

Please sign in to comment.