Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48441
b: refs/heads/master
c: 24ce0e9
h: refs/heads/master
i:
  48439: 2dfd6f4
v: v3
  • Loading branch information
Jan Beulich authored and Andi Kleen committed Feb 13, 2007
1 parent 654ecdf commit adf2d86
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 16 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: 9b355897562fe2291248a7aec8e479c2c98cf117
refs/heads/master: 24ce0e96f2dea558762c994d054ea2f3c01fa95a
40 changes: 25 additions & 15 deletions trunk/arch/x86_64/kernel/mce_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
#define THRESHOLD_MAX 0xFFF
#define INT_TYPE_APIC 0x00020000
#define MASK_VALID_HI 0x80000000
#define MASK_CNTP_HI 0x40000000
#define MASK_LOCKED_HI 0x20000000
#define MASK_LVTOFF_HI 0x00F00000
#define MASK_COUNT_EN_HI 0x00080000
#define MASK_INT_TYPE_HI 0x00060000
Expand Down Expand Up @@ -122,14 +124,17 @@ void __cpuinit mce_amd_feature_init(struct cpuinfo_x86 *c)
for (block = 0; block < NR_BLOCKS; ++block) {
if (block == 0)
address = MSR_IA32_MC0_MISC + bank * 4;
else if (block == 1)
address = MCG_XBLK_ADDR
+ ((low & MASK_BLKPTR_LO) >> 21);
else if (block == 1) {
address = (low & MASK_BLKPTR_LO) >> 21;
if (!address)
break;
address += MCG_XBLK_ADDR;
}
else
++address;

if (rdmsr_safe(address, &low, &high))
continue;
break;

if (!(high & MASK_VALID_HI)) {
if (block)
Expand All @@ -138,8 +143,8 @@ void __cpuinit mce_amd_feature_init(struct cpuinfo_x86 *c)
break;
}

if (!(high & MASK_VALID_HI >> 1) ||
(high & MASK_VALID_HI >> 2))
if (!(high & MASK_CNTP_HI) ||
(high & MASK_LOCKED_HI))
continue;

if (!block)
Expand Down Expand Up @@ -187,17 +192,22 @@ asmlinkage void mce_threshold_interrupt(void)

/* assume first bank caused it */
for (bank = 0; bank < NR_BANKS; ++bank) {
if (!(per_cpu(bank_map, m.cpu) & (1 << bank)))
continue;
for (block = 0; block < NR_BLOCKS; ++block) {
if (block == 0)
address = MSR_IA32_MC0_MISC + bank * 4;
else if (block == 1)
address = MCG_XBLK_ADDR
+ ((low & MASK_BLKPTR_LO) >> 21);
else if (block == 1) {
address = (low & MASK_BLKPTR_LO) >> 21;
if (!address)
break;
address += MCG_XBLK_ADDR;
}
else
++address;

if (rdmsr_safe(address, &low, &high))
continue;
break;

if (!(high & MASK_VALID_HI)) {
if (block)
Expand All @@ -206,8 +216,8 @@ asmlinkage void mce_threshold_interrupt(void)
break;
}

if (!(high & MASK_VALID_HI >> 1) ||
(high & MASK_VALID_HI >> 2))
if (!(high & MASK_CNTP_HI) ||
(high & MASK_LOCKED_HI))
continue;

if (high & MASK_OVERFLOW_HI) {
Expand Down Expand Up @@ -385,7 +395,7 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
return 0;

if (rdmsr_safe(address, &low, &high))
goto recurse;
return 0;

if (!(high & MASK_VALID_HI)) {
if (block)
Expand All @@ -394,8 +404,8 @@ static __cpuinit int allocate_threshold_blocks(unsigned int cpu,
return 0;
}

if (!(high & MASK_VALID_HI >> 1) ||
(high & MASK_VALID_HI >> 2))
if (!(high & MASK_CNTP_HI) ||
(high & MASK_LOCKED_HI))
goto recurse;

b = kzalloc(sizeof(struct threshold_block), GFP_KERNEL);
Expand Down

0 comments on commit adf2d86

Please sign in to comment.