Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/arch/x86/x86 Pull up following revision(s) (requested...
details: https://anonhg.NetBSD.org/src/rev/5f07df0edd21
branches: netbsd-8
changeset: 850816:5f07df0edd21
user: martin <martin%NetBSD.org@localhost>
date: Mon Jul 10 12:26:21 2017 +0000
description:
Pull up following revision(s) (requested by nonaka in ticket #110):
sys/arch/x86/x86/lapic.c: revision 1.59
PR/52266: use rdmsr_safe(9) instead of rdmsr(9) for old machine.
tested by simonb@
diffstat:
sys/arch/x86/x86/lapic.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (34 lines):
diff -r fdd2a6c08d32 -r 5f07df0edd21 sys/arch/x86/x86/lapic.c
--- a/sys/arch/x86/x86/lapic.c Fri Jul 07 14:12:21 2017 +0000
+++ b/sys/arch/x86/x86/lapic.c Mon Jul 10 12:26:21 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lapic.c,v 1.58 2017/05/23 08:54:39 nonaka Exp $ */
+/* $NetBSD: lapic.c,v 1.58.2.1 2017/07/10 12:26:21 martin 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.58 2017/05/23 08:54:39 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lapic.c,v 1.58.2.1 2017/07/10 12:26:21 martin Exp $");
#include "acpica.h"
#include "ioapic.h"
@@ -235,10 +235,12 @@
bool
lapic_is_x2apic(void)
{
- uint64_t r;
+ uint64_t msr;
- r = rdmsr(MSR_APICBASE);
- return (r & (APICBASE_EN | APICBASE_EXTD)) == (APICBASE_EN | APICBASE_EXTD);
+ if (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