lkml.org 
[lkml]   [2009]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: linux-next: Tree for May 29 (__rdmsr_on_cpu() OOPS)
Date

next-20090529 oopses in __rdmsr_on_cpu() on my Pentium M laptop.

.jpg + .config:
http://www.kernel.org/pub/linux/kernel/people/bart/next-20090529-oops.*

(gdb) l *0xc023410f
0xc023410f is in __rdmsr_on_cpu (arch/x86/lib/msr.c:25).
20 if (rv->msrs)
21 reg = &rv->msrs[this_cpu - rv->off];
22 else
23 reg = &rv->reg;
24
25 rdmsr(rv->msr_no, reg->l, reg->h);
26 }
27
28 static void __wrmsr_on_cpu(void *info)
29 {

Thus the problem seems to be introduced by:

commit 23d19840368b2787d2da97ad0f0f29248503648a
Author: Borislav Petkov <borislav.petkov@amd.com>
Date: Fri May 22 13:52:19 2009 +0200

x86: MSR: add methods for writing of an MSR on several CPUs
...

and indeed the following patch fixes it:

[ Borislav, feel free to fold it into the above change or replace by
a more complete one if needed (there may be more rv fields needing
initialization). ]

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] x86: MSR: fix __rdmsr_on_cpu() OOPS

{rd,wr}msr_on_cpu() need to explicitly initalize rv.msrs
(since rv is allocated on the stack).

Cc: Borislav Petkov <borislav.petkov@amd.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
arch/x86/lib/msr.c | 2 ++
1 file changed, 2 insertions(+)

Index: b/arch/x86/lib/msr.c
===================================================================
--- a/arch/x86/lib/msr.c
+++ b/arch/x86/lib/msr.c
@@ -44,6 +44,7 @@ int rdmsr_on_cpu(unsigned int cpu, u32 m
int err;
struct msr_info rv;

+ rv.msrs = NULL;
rv.msr_no = msr_no;
err = smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 1);
*l = rv.reg.l;
@@ -58,6 +59,7 @@ int wrmsr_on_cpu(unsigned int cpu, u32 m
int err;
struct msr_info rv;

+ rv.msrs = NULL;
rv.msr_no = msr_no;
rv.reg.l = l;
rv.reg.h = h;

\
 
 \ /
  Last update: 2009-05-30 21:37    [W:0.047 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site