Andi Kleen
203abd67b7
x86: mce: Handle banks == 0 case in K7 quirk
Vegard Nossum reported:
> I get an MCE-related crash like this in latest linus tree:
>
> [ 0.115341] CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
> [ 0.116396] CPU: L2 Cache: 512K (64 bytes/line)
> [ 0.120570] mce: CPU supports 0 MCE banks
> [ 0.124870] BUG: unable to handle kernel NULL pointer dereference at 00000000 00000010
> [ 0.128001] IP: [<ffffffff813b98ad>] mcheck_init+0x278/0x320
> [ 0.128001] PGD 0
> [ 0.128001] Thread overran stack, or stack corrupted
> [ 0.128001] Oops: 0002 [#1] PREEMPT SMP
> [ 0.128001] last sysfs file:
> [ 0.128001] CPU 0
> [ 0.128001] Modules linked in:
> [ 0.128001] Pid: 0, comm: swapper Not tainted 2.6.30 #426
> [ 0.128001] RIP: 0010:[<ffffffff813b98ad>] [<ffffffff813b98ad>] mcheck_init+0x278/0x320
> [ 0.128001] RSP: 0018:ffffffff81595e38 EFLAGS: 00000246
> [ 0.128001] RAX: 0000000000000010 RBX: ffffffff8158f900 RCX: 0000000000000000
> [ 0.128001] RDX: 0000000000000000 RSI: 00000000000000ff RDI: 0000000000000010
> [ 0.128001] RBP: ffffffff81595e68 R08: 0000000000000001 R09: 0000000000000000
> [ 0.128001] R10: 0000000000000010 R11: 0000000000000000 R12: 0000000000000000
> [ 0.128001] R13: 00000000ffffffff R14: 0000000000000000 R15: 0000000000000000
> [ 0.128001] FS: 0000000000000000(0000) GS:ffff880002288000(0000) knlGS:00000
> 00000000000
> [ 0.128001] CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
> [ 0.128001] CR2: 0000000000000010 CR3: 0000000001001000 CR4: 00000000000006b0
> [ 0.128001] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 0.128001] DR3: 0000000000000000 DR6: 0000000000000000 DR7: 0000000000000000
> [ 0.128001] Process swapper (pid: 0, threadinfo ffffffff81594000, task ffffff
> ff8152a4a0)
> [ 0.128001] Stack:
> [ 0.128001] 0000000081595e68 5aa50ed3b4ddbe6e ffffffff8158f900 ffffffff8158f
> 914
> [ 0.128001] ffffffff8158f948 0000000000000000 ffffffff81595eb8 ffffffff813b8
> 69c
> [ 0.128001] 5aa50ed3b4ddbe6e 00000001078bfbfd 0000062300000800 5aa50ed3b4ddb
> e6e
> [ 0.128001] Call Trace:
> [ 0.128001] [<ffffffff813b869c>] identify_cpu+0x331/0x392
> [ 0.128001] [<ffffffff815a1445>] identify_boot_cpu+0x23/0x6e
> [ 0.128001] [<ffffffff815a14ac>] check_bugs+0x1c/0x60
> [ 0.128001] [<ffffffff8159c075>] start_kernel+0x403/0x46e
> [ 0.128001] [<ffffffff8159b2ac>] x86_64_start_reservations+0xac/0xd5
> [ 0.128001] [<ffffffff8159b3ea>] x86_64_start_kernel+0x115/0x14b
> [ 0.128001] [<ffffffff8159b140>] ? early_idt_handler+0x0/0x71
This happens on QEMU which reports MCA capability, but no banks.
Without this patch there is a buffer overrun and boot ops because
the code would try to initialize the 0 element of a zero length
kmalloc() buffer.
Reported-by: Vegard Nossum <vegard.nossum@gmail.com>
Tested-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
LKML-Reference: <20090615125200.GD31969@one.firstfloor.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-06-17 08:59:45 +02:00
..
2009-06-12 21:32:29 +02:00
2009-06-15 10:06:19 -07:00
2009-06-17 08:59:45 +02:00
2009-03-10 16:24:23 +01:00
2009-06-16 10:19:16 +02:00
2009-06-15 15:42:00 +02:00
2008-11-28 15:24:39 +01:00
2009-06-12 21:32:31 +02:00
2009-06-12 22:27:03 +09:30
2009-05-11 17:44:39 -07:00
2009-04-03 19:25:57 +02:00
2009-03-15 07:03:15 +01:00
2009-01-03 12:04:39 -08:00
2009-06-15 15:20:40 +02:00
2009-04-24 10:18:51 +02:00
2009-03-13 11:57:22 +01:00
2009-04-07 13:36:36 +02:00
2008-12-03 08:56:25 +01:00
2009-01-19 00:38:58 +09:00
2009-03-30 14:04:53 +11:00
2009-04-14 11:45:33 +02:00
2009-05-11 09:45:14 +02:00
2009-03-13 02:37:18 +01:00
2009-04-08 14:16:32 +02:00
2009-03-27 17:28:43 +01:00
2009-02-25 08:27:46 +01:00
2009-02-24 18:08:40 +01:00
2009-06-16 17:47:32 -07:00
2009-03-14 09:42:51 +01:00
2009-06-11 23:31:52 +02:00
2009-05-13 13:52:19 -04:00
2009-03-14 17:23:47 -07:00
2009-03-14 15:37:14 -07:00
2009-04-29 10:20:31 +02:00
2009-02-24 18:08:38 +01:00
2008-12-12 11:08:42 +01:00
2009-06-14 18:24:29 +02:00
2009-03-04 20:33:16 +01:00
2009-02-10 13:13:23 +01:00
2009-04-21 13:41:47 -07:00
2009-02-23 00:08:11 +01:00
2008-12-31 18:07:42 -05:00
2009-03-21 16:57:04 +05:30
2009-03-02 12:07:48 +01:00
2009-02-24 21:52:45 +01:00
2009-02-09 12:16:05 +01:00
2009-06-11 23:31:52 +02:00
2009-06-11 23:31:52 +02:00
2009-03-21 16:55:45 +05:30
2009-06-10 15:49:10 -07:00
2009-04-02 00:49:02 +02:00
2009-06-11 10:03:30 -07:00
2009-04-21 13:41:47 -07:00
2009-01-02 17:46:24 +01:00
2009-05-07 22:01:05 -07:00
2009-05-07 22:01:05 -07:00
2009-06-12 21:47:01 +09:30
2009-02-23 00:08:11 +01:00
2009-03-30 22:05:14 +10:30
2009-06-07 16:35:11 +02:00
2009-05-12 10:36:44 +02:00
2009-05-12 10:36:44 +02:00
2009-03-12 13:13:07 +01:00
2009-06-12 21:47:05 +09:30
2009-05-18 09:33:29 +02:00
2009-01-12 11:22:50 +01:00
2009-02-14 23:05:25 +01:00
2009-01-30 14:51:44 -08:00
2009-01-30 14:51:44 -08:00
2009-01-20 17:14:28 +01:00
2009-06-10 16:16:27 -07:00
2009-04-14 13:03:36 +02:00
2009-06-15 15:20:40 +02:00
2009-06-06 09:42:09 +02:00
2009-04-07 08:31:11 -07:00
2009-05-11 14:44:31 +02:00
2009-01-29 14:16:51 +01:00
2009-06-10 19:53:40 -07:00
2009-06-10 19:53:40 -07:00
2009-06-10 19:53:40 -07:00
2009-04-24 10:18:52 +02:00
2009-06-07 12:22:15 +02:00
2009-06-07 15:51:20 +02:00
2009-03-10 18:13:25 -07:00
2009-03-10 18:13:25 -07:00
2009-03-21 16:56:37 +05:30
2009-06-10 16:13:20 -07:00
2009-06-11 15:19:13 -07:00
2009-06-11 23:31:52 +02:00
2009-06-11 23:31:52 +02:00
2009-06-12 13:50:24 +03:00
2009-05-14 23:19:09 -04:00
2009-04-30 21:16:49 +02:00
2009-02-23 00:08:11 +01:00
2009-03-30 22:05:14 +10:30
2009-06-10 16:15:14 -07:00
2009-03-21 16:55:24 +05:30
2009-02-13 11:35:01 -08:00
2009-02-13 11:35:01 -08:00
2008-12-08 13:49:45 +01:00
2009-06-11 23:31:52 +02:00
2009-05-07 09:32:10 +02:00
2009-06-10 16:15:59 -07:00
2009-02-17 17:52:44 +01:00
2009-04-08 14:58:10 +02:00
2009-04-22 17:41:25 +02:00
2009-03-11 09:49:01 +01:00
2009-06-10 16:15:14 -07:00
2009-04-07 13:34:16 -07:00
2009-04-21 13:41:47 -07:00
2009-06-12 09:21:33 +02:00
2009-03-25 21:34:28 +01:00
2009-05-28 14:15:54 +02:00
2009-01-16 14:20:22 +01:00
2009-04-20 14:33:00 -07:00