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 PR/52266: Before access MSR[APICBASE], need...
details: https://anonhg.NetBSD.org/src/rev/aa9eb3a3bf2e
branches: trunk
changeset: 355096:aa9eb3a3bf2e
user: nonaka <nonaka%NetBSD.org@localhost>
date: Thu Jul 13 00:44:14 2017 +0000
description:
PR/52266: Before access MSR[APICBASE], need to check if APIC is present.
diffstat:
sys/arch/x86/x86/lapic.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r 9d0e05d4247f -r aa9eb3a3bf2e sys/arch/x86/x86/lapic.c
--- a/sys/arch/x86/x86/lapic.c Wed Jul 12 19:06:16 2017 +0000
+++ b/sys/arch/x86/x86/lapic.c Thu Jul 13 00:44:14 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lapic.c,v 1.59 2017/07/08 14:35:33 nonaka Exp $ */
+/* $NetBSD: lapic.c,v 1.60 2017/07/13 00:44:14 nonaka Exp $ */
/*-
* Copyright (c) 2000, 2008 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.59 2017/07/08 14:35:33 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.60 2017/07/13 00:44:14 nonaka Exp $");
#include "acpica.h"
#include "ioapic.h"
@@ -237,7 +237,8 @@
{
uint64_t msr;
- if (rdmsr_safe(MSR_APICBASE, &msr) == EFAULT)
+ if (!ISSET(cpu_feature[0], CPUID_APIC) ||
+ rdmsr_safe(MSR_APICBASE, &msr) == EFAULT)
return false;
return (msr & (APICBASE_EN | APICBASE_EXTD)) ==
(APICBASE_EN | APICBASE_EXTD);
Home |
Main Index |
Thread Index |
Old Index