From e514692ad11685fd6324a688f17ed0eee36d018b Mon Sep 17 00:00:00 2001 From: jruoho Date: Sat, 24 Sep 2011 10:59:02 +0000 Subject: [PATCH] As the detection of C1E is not entirely clear-cut, use rdmsr_safe() when reading the AMD "interrupt pending and CMP-halt register". --- sys/arch/x86/acpi/acpi_cpu_md.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/arch/x86/acpi/acpi_cpu_md.c b/sys/arch/x86/acpi/acpi_cpu_md.c index 7dfb3f527dda..c0e9a387524f 100644 --- a/sys/arch/x86/acpi/acpi_cpu_md.c +++ b/sys/arch/x86/acpi/acpi_cpu_md.c @@ -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 @@ -27,7 +27,7 @@ * SUCH DAMAGE. */ #include -__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 #include @@ -336,7 +336,8 @@ acpicpu_md_quirk_c1e(void) 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);