Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/arch/x86/x86 Pull up following revision(s) (requested...
details: https://anonhg.NetBSD.org/src/rev/3a166905c932
branches: netbsd-7
changeset: 798833:3a166905c932
user: snj <snj%NetBSD.org@localhost>
date: Mon Jan 12 21:06:41 2015 +0000
description:
Pull up following revision(s) (requested by christos in ticket #414):
sys/arch/x86/x86/cpu.c: revision 1.113
PR/49104: Jarle Greipsland: Don't touch cr4 in cpus that don't have it.
diffstat:
sys/arch/x86/x86/cpu.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)
diffs (43 lines):
diff -r ce61b311c16d -r 3a166905c932 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c Mon Jan 12 21:03:09 2015 +0000
+++ b/sys/arch/x86/x86/cpu.c Mon Jan 12 21:06:41 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.111 2014/05/12 11:56:02 joerg Exp $ */
+/* $NetBSD: cpu.c,v 1.111.2.1 2015/01/12 21:06:41 snj Exp $ */
/*-
* Copyright (c) 2000-2012 NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.111 2014/05/12 11:56:02 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.111.2.1 2015/01/12 21:06:41 snj Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -552,11 +552,10 @@
void
cpu_init(struct cpu_info *ci)
{
- uint32_t cr4;
+ uint32_t cr4 = 0;
lcr0(rcr0() | CR0_WP);
- cr4 = rcr4();
/*
* On a P6 or above, enable global TLB caching if the
* hardware supports it.
@@ -581,7 +580,10 @@
if (cpu_feature[1] & CPUID2_XSAVE)
cr4 |= CR4_OSXSAVE;
- lcr4(cr4);
+ if (cr4) {
+ cr4 |= rcr4();
+ lcr4(cr4);
+ }
/* If xsave is enabled, enable all fpu features */
if (cr4 & CR4_OSXSAVE)
Home |
Main Index |
Thread Index |
Old Index