Ingo Molnar 11868a2dc4 x86: mce: Use safer ways to access MCE registers
Use rdmsrl_safe() when accessing MCE registers. While in
theory we always 'know' which ones are safe to access from
the capability bits, there's a lot of hardware variations
and reality might differ from theory, as it did in this case:

   http://bugzilla.kernel.org/show_bug.cgi?id=14204

[    0.010016] mce: CPU supports 5 MCE banks
[    0.011029] general protection fault: 0000 [#1]
[    0.011998] last sysfs file:
[    0.011998] Modules linked in:
[    0.011998]
[    0.011998] Pid: 0, comm: swapper Not tainted (2.6.31_router #1) HP Vectra
[    0.011998] EIP: 0060:[<c100d9b9>] EFLAGS: 00010246 CPU: 0
[    0.011998] EIP is at mce_rdmsrl+0x19/0x60
[    0.011998] EAX: 00000000 EBX: 00000001 ECX: 00000407 EDX: 08000000
[    0.011998] ESI: 00000000 EDI: 8c000000 EBP: 00000405 ESP: c17d5eac

So WARN_ONCE() instead of crashing the box.

( also fix a number of stylistic inconsistencies in the code. )

Note, we might still crash in wrmsrl() if we get that far, but
we shouldnt if the registers are truly inaccessible.

Reported-by: GNUtoo <GNUtoo@no-log.org>
Cc: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <bug-14204-5438@http.bugzilla.kernel.org/>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-09-23 18:08:26 +02:00
..
2009-09-20 20:25:03 +02:00
2009-03-15 07:03:15 +01:00
2009-06-15 15:20:40 +02:00
2009-07-19 18:27:51 +02:00
2009-03-13 11:57:22 +01:00
2009-06-20 17:53:13 +02:00
2009-07-11 10:17:08 +02:00
2009-08-31 11:09:40 +02:00
2009-08-31 11:09:40 +02:00
2009-06-17 21:35:10 -07:00
2009-02-10 13:13:23 +01:00
2009-02-23 00:08:11 +01:00
2009-06-16 19:47:28 -07:00
2009-03-21 16:57:04 +05:30
2009-08-09 22:28:34 +02:00
2009-02-09 12:16:05 +01:00
2009-03-21 16:55:45 +05:30
2009-02-23 00:08:11 +01:00
2009-08-31 11:09:40 +02:00
2009-01-20 17:14:28 +01:00
2009-07-14 16:25:05 +02:00
2009-09-20 20:25:03 +02:00
2009-06-11 23:31:52 +02:00
2009-07-19 18:27:51 +02:00
2009-09-16 10:21:10 +02:00
2009-03-21 16:55:24 +05:30
2009-09-20 16:00:18 +05:30
2009-09-20 20:25:03 +02:00
2009-02-17 17:52:44 +01:00