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 Work around the problem in PR port-amd64/49...



details:   https://anonhg.NetBSD.org/src/rev/cfef0e83497c
branches:  trunk
changeset: 333301:cfef0e83497c
user:      riz <riz%NetBSD.org@localhost>
date:      Tue Oct 28 17:44:47 2014 +0000

description:
Work around the problem in PR port-amd64/49150 for all CPUs under Xen.

The problem (calling xrstor, which is privileged in Xen) has appeared
on some Intel CPUs as well, so implement the workaround (ensure that
x86_xsave_features is 0) for all CPUs, not just AMD CPUs.

XXX pullup to 7

diffstat:

 sys/arch/x86/x86/identcpu.c |  9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r fe484f931533 -r cfef0e83497c sys/arch/x86/x86/identcpu.c
--- a/sys/arch/x86/x86/identcpu.c       Tue Oct 28 16:54:11 2014 +0000
+++ b/sys/arch/x86/x86/identcpu.c       Tue Oct 28 17:44:47 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: identcpu.c,v 1.46 2014/10/14 03:16:56 jnemeth Exp $    */
+/*     $NetBSD: identcpu.c,v 1.47 2014/10/28 17:44:47 riz Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.46 2014/10/14 03:16:56 jnemeth Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.47 2014/10/28 17:44:47 riz Exp $");
 
 #include "opt_xen.h"
 
@@ -757,10 +757,9 @@
        /* XXX these probably ought to be per-cpu */
        if (descs[2] > 512)
            x86_fpu_save_size = descs[2];
-#ifdef XEN
-       if (cpu_vendor != CPUVENDOR_AMD)
+#ifndef XEN
+       x86_xsave_features = (uint64_t)descs[3] << 32 | descs[0];
 #endif
-               x86_xsave_features = (uint64_t)descs[3] << 32 | descs[0];
 }
 
 void



Home | Main Index | Thread Index | Old Index