Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Like the comment says, also MSR_IA32_EXT_CO...



details:   https://anonhg.NetBSD.org/src/rev/9a7a3bfce310
branches:  trunk
changeset: 770163:9a7a3bfce310
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Thu Oct 06 14:05:26 2011 +0000

description:
Like the comment says, also MSR_IA32_EXT_CONFIG is unsafe; use rdmsr_safe().
Fixes the panic reported by njoly@.

diffstat:

 sys/arch/x86/x86/coretemp.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r e1202083b163 -r 9a7a3bfce310 sys/arch/x86/x86/coretemp.c
--- a/sys/arch/x86/x86/coretemp.c       Thu Oct 06 13:06:14 2011 +0000
+++ b/sys/arch/x86/x86/coretemp.c       Thu Oct 06 14:05:26 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: coretemp.c,v 1.27 2011/09/24 10:52:56 jruoho Exp $ */
+/* $NetBSD: coretemp.c,v 1.28 2011/10/06 14:05:26 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.27 2011/09/24 10:52:56 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: coretemp.c,v 1.28 2011/10/06 14:05:26 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -281,7 +281,8 @@
        if ((model == 0x0F && stepping >= 2) ||
            (model == 0x0E && extmodel != 1)) {
 
-               msr = rdmsr(MSR_IA32_EXT_CONFIG);
+               if (rdmsr_safe(MSR_IA32_EXT_CONFIG, &msr) == EFAULT)
+                       return;
 
                if ((msr & __BIT(30)) != 0) {
                        sc->sc_tjmax = 85;



Home | Main Index | Thread Index | Old Index