Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/acpi As the detection of C1E is not entirely cl...



details:   https://anonhg.NetBSD.org/src/rev/2b4985cb9b1b
branches:  trunk
changeset: 769812:2b4985cb9b1b
user:      jruoho <jruoho%NetBSD.org@localhost>
date:      Sat Sep 24 10:59:02 2011 +0000

description:
As the detection of C1E is not entirely clear-cut, use rdmsr_safe()
when reading the AMD "interrupt pending and CMP-halt register".

diffstat:

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

diffs (28 lines):

diff -r c16a9144b0c6 -r 2b4985cb9b1b sys/arch/x86/acpi/acpi_cpu_md.c
--- a/sys/arch/x86/acpi/acpi_cpu_md.c   Sat Sep 24 10:52:56 2011 +0000
+++ b/sys/arch/x86/acpi/acpi_cpu_md.c   Sat Sep 24 10:59:02 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_cpu_md.c,v 1.64 2011/07/13 07:34:55 jruoho Exp $ */
+/* $NetBSD: acpi_cpu_md.c,v 1.65 2011/09/24 10:59:02 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2010, 2011 Jukka Ruohonen <jruohonen%iki.fi@localhost>
@@ -27,7 +27,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.64 2011/07/13 07:34:55 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: acpi_cpu_md.c,v 1.65 2011/09/24 10:59:02 jruoho Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -336,7 +336,8 @@
        const uint64_t c1e = MSR_CMPHALT_SMI | MSR_CMPHALT_C1E;
        uint64_t val;
 
-       val = rdmsr(MSR_CMPHALT);
+       if (__predict_false(rdmsr_safe(MSR_CMPHALT, &val) == EFAULT))
+               return;
 
        if ((val & c1e) != 0)
                wrmsr(MSR_CMPHALT, val & ~c1e);



Home | Main Index | Thread Index | Old Index