Skip to contentSkip to conversation

correctly report NR_BANKS in mce_64.c

PATCH Applied Pavel Machek 2 participants 2 messages Jun 6, 2008 – Jun 18, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 correctly report NR_BANKS in mce_64.c

From: Daniel Rahn <[email protected]>

attached is a no-brainer that makes kernel correctly report NR_BANKS for MCE. We are right now limited to NR_BANKS==6, but the error message will use the available number of banks instead of the defined maximum.

For a Nehalem based system it will print:

"MCE: warning: using only 9 banks"

while the correct message would be

"MCE: warning: using only 6 banks"

arch/x86/kernel/cpu/mcheck/mce_64.c +1 -1
index e07e8c0..2fb868e 100644
@@ -445,8 +445,8 @@ static void mce_init(void *dummy)
 	rdmsrl(MSR_IA32_MCG_CAP, cap);
 	banks = cap & 0xff;
 	if (banks > NR_BANKS) {
-		printk(KERN_INFO "MCE: warning: using only %d banks\n", banks);
 		banks = NR_BANKS;
+		printk(KERN_INFO "MCE: warning: using only %d banks\n", banks);
 	}
 	/* Use accurate RIP reporting if available. */
 	if ((cap & (1<<9)) && ((cap >> 16) & 0xff) >= 9)
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Applied
#1 lore raw
Quoted 9 lines · Pavel Machek

From: Daniel Rahn <[email protected]>

attached is a no-brainer that makes kernel correctly report NR_BANKS for MCE. We are right now limited to NR_BANKS==6, but the error message will use the available number of banks instead of the defined maximum.

For a Nehalem based system it will print:

Quoted 7 lines

"MCE: warning: using only 9 banks"

while the correct message would be

"MCE: warning: using only 6 banks"

applied to tip/x86/mce, thanks Pavel.

[ There was a recent crossing commit that made your patch not apply
cleanly (8edc5cc5ec8 from May 12), i fixed up the impact manually. ]

Ingo