Module Name:    src
Committed By:   riz
Date:           Tue Oct 28 17:44:47 UTC 2014

Modified Files:
        src/sys/arch/x86/x86: identcpu.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/x86/x86/identcpu.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.46 src/sys/arch/x86/x86/identcpu.c:1.47
--- src/sys/arch/x86/x86/identcpu.c:1.46	Tue Oct 14 03:16:56 2014
+++ src/sys/arch/x86/x86/identcpu.c	Tue Oct 28 17:44:47 2014
@@ -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 @@ cpu_probe_fpu(struct cpu_info *ci)
 	/* 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

Reply via email to