Module Name: src
Committed By: dsl
Date: Sun Feb 23 22:38:40 UTC 2014
Modified Files:
src/sys/arch/x86/include: cpu.h
src/sys/arch/x86/x86: identcpu.c x86_machdep.c
Log Message:
Rename (the recently added) 'x86_xsave_size' to 'x86_fpu_save_size'
and default to 512 (the size of the fxsave structure).
To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/x86/include/cpu.h
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x86/x86/identcpu.c
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/x86/x86/x86_machdep.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/include/cpu.h
diff -u src/sys/arch/x86/include/cpu.h:1.65 src/sys/arch/x86/include/cpu.h:1.66
--- src/sys/arch/x86/include/cpu.h:1.65 Sun Feb 23 12:56:40 2014
+++ src/sys/arch/x86/include/cpu.h Sun Feb 23 22:38:40 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.65 2014/02/23 12:56:40 dsl Exp $ */
+/* $NetBSD: cpu.h,v 1.66 2014/02/23 22:38:40 dsl Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -387,7 +387,7 @@ extern int x86_fpu_save;
#define FPU_SAVE_FXSAVE 1
#define FPU_SAVE_XSAVE 2
#define FPU_SAVE_XSAVEOPT 3
-extern unsigned int x86_xsave_size;
+extern unsigned int x86_fpu_save_size;
extern uint64_t x86_xsave_features;
extern void (*x86_cpu_idle)(void);
Index: src/sys/arch/x86/x86/identcpu.c
diff -u src/sys/arch/x86/x86/identcpu.c:1.41 src/sys/arch/x86/x86/identcpu.c:1.42
--- src/sys/arch/x86/x86/identcpu.c:1.41 Sun Feb 23 12:56:40 2014
+++ src/sys/arch/x86/x86/identcpu.c Sun Feb 23 22:38:40 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: identcpu.c,v 1.41 2014/02/23 12:56:40 dsl Exp $ */
+/* $NetBSD: identcpu.c,v 1.42 2014/02/23 22:38:40 dsl 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.41 2014/02/23 12:56:40 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.42 2014/02/23 22:38:40 dsl Exp $");
#include "opt_xen.h"
@@ -61,7 +61,7 @@ int cpu_vendor;
char cpu_brand_string[49];
int x86_fpu_save = FPU_SAVE_FSAVE;
-unsigned int x86_xsave_size = 0;
+unsigned int x86_fpu_save_size = 512;
uint64_t x86_xsave_features = 0;
/*
@@ -756,7 +756,8 @@ cpu_probe_fpu(struct cpu_info *ci)
/* Get features and maximum size of the save area */
x86_cpuid(0xd, descs);
/* XXX these probably ought to be per-cpu */
- x86_xsave_size = descs[2];
+ if (descs[2] > 512)
+ x86_fpu_save_size = descs[2];
x86_xsave_features = (uint64_t)descs[3] << 32 | descs[0];
}
Index: src/sys/arch/x86/x86/x86_machdep.c
diff -u src/sys/arch/x86/x86/x86_machdep.c:1.62 src/sys/arch/x86/x86/x86_machdep.c:1.63
--- src/sys/arch/x86/x86/x86_machdep.c:1.62 Sun Feb 23 12:56:40 2014
+++ src/sys/arch/x86/x86/x86_machdep.c Sun Feb 23 22:38:40 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_machdep.c,v 1.62 2014/02/23 12:56:40 dsl Exp $ */
+/* $NetBSD: x86_machdep.c,v 1.63 2014/02/23 22:38:40 dsl Exp $ */
/*-
* Copyright (c) 2002, 2006, 2007 YAMAMOTO Takashi,
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.62 2014/02/23 12:56:40 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_machdep.c,v 1.63 2014/02/23 22:38:40 dsl Exp $");
#include "opt_modular.h"
#include "opt_physmem.h"
@@ -1121,7 +1121,7 @@ SYSCTL_SETUP(sysctl_machdep_setup, "sysc
const_sysctl(clog, "sse2", i386_has_sse2, CPU_SSE2);
const_sysctl(clog, "fpu_save", x86_fpu_save, CTL_CREATE);
- const_sysctl(clog, "xsave_size", x86_xsave_size, CTL_CREATE);
+ const_sysctl(clog, "fpu_save_size", x86_fpu_save_size, CTL_CREATE);
const_sysctl(clog, "xsave_features", x86_xsave_features, CTL_CREATE);
#ifndef XEN