Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7-0]: src/sys/arch/x86 Pull up following revision(s) (requested b...
details: https://anonhg.NetBSD.org/src/rev/7a3f6f340234
branches: netbsd-7-0
changeset: 801460:7a3f6f340234
user: martin <martin%NetBSD.org@localhost>
date: Mon Mar 19 16:54:58 2018 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #1118):
sys/arch/x86/include/cpuvar.h: revision 1.47
sys/arch/x86/x86/cpu.c: revision 1.117
sys/arch/x86/x86/identcpu.c: revision 1.49
sys/arch/x86/include/cpu.h: revision 1.67
Retrieve cpuid7 (Structured Extended Features) into ci_feat_val.
diffstat:
sys/arch/x86/include/cpu.h | 6 ++++--
sys/arch/x86/include/cpuvar.h | 4 ++--
sys/arch/x86/x86/cpu.c | 22 ++++++++++++----------
sys/arch/x86/x86/identcpu.c | 13 +++++++++++--
4 files changed, 29 insertions(+), 16 deletions(-)
diffs (127 lines):
diff -r 6d1c6fa0e0be -r 7a3f6f340234 sys/arch/x86/include/cpu.h
--- a/sys/arch/x86/include/cpu.h Sat Mar 10 16:12:07 2018 +0000
+++ b/sys/arch/x86/include/cpu.h Mon Mar 19 16:54:58 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.66 2014/02/23 22:38:40 dsl Exp $ */
+/* $NetBSD: cpu.h,v 1.66.8.1 2018/03/19 16:54:58 martin Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -157,12 +157,14 @@
uint32_t ci_max_ext_cpuid; /* cpuid.80000000:%eax */
volatile uint32_t ci_lapic_counter;
- uint32_t ci_feat_val[5]; /* X86 CPUID feature bits */
+ uint32_t ci_feat_val[7]; /* X86 CPUID feature bits */
/* [0] basic features cpuid.1:%edx
* [1] basic features cpuid.1:%ecx (CPUID2_xxx bits)
* [2] extended features cpuid:80000001:%edx
* [3] extended features cpuid:80000001:%ecx
* [4] VIA padlock features
+ * [5] structured extended features cpuid.7:%ebx
+ * [6] structured extended features cpuid.7:%ecx
*/
const struct cpu_functions *ci_func; /* start/stop functions */
diff -r 6d1c6fa0e0be -r 7a3f6f340234 sys/arch/x86/include/cpuvar.h
--- a/sys/arch/x86/include/cpuvar.h Sat Mar 10 16:12:07 2018 +0000
+++ b/sys/arch/x86/include/cpuvar.h Mon Mar 19 16:54:58 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuvar.h,v 1.46 2012/04/20 22:23:24 rmind Exp $ */
+/* $NetBSD: cpuvar.h,v 1.46.18.1 2018/03/19 16:54:58 martin Exp $ */
/*-
* Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
extern int cpu_vendor;
extern bool x86_mp_online;
-extern uint32_t cpu_feature[5];
+extern uint32_t cpu_feature[7];
#endif /* _KERNEL */
diff -r 6d1c6fa0e0be -r 7a3f6f340234 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c Sat Mar 10 16:12:07 2018 +0000
+++ b/sys/arch/x86/x86/cpu.c Mon Mar 19 16:54:58 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.111.2.1.2.1 2015/11/08 00:15:47 riz Exp $ */
+/* $NetBSD: cpu.c,v 1.111.2.1.2.2 2018/03/19 16:54:58 martin 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.2.1.2.1 2015/11/08 00:15:47 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.111.2.1.2.2 2018/03/19 16:54:58 martin Exp $");
#include "opt_ddb.h"
#include "opt_mpbios.h" /* for MPDEBUG */
@@ -177,13 +177,15 @@
static void cpu_init_idle_lwp(struct cpu_info *);
-uint32_t cpu_feature[5]; /* X86 CPUID feature bits
- * [0] basic features %edx
- * [1] basic features %ecx
- * [2] extended features %edx
- * [3] extended features %ecx
- * [4] VIA padlock features
- */
+uint32_t cpu_feature[7]; /* X86 CPUID feature bits */
+ /* [0] basic features cpuid.1:%edx
+ * [1] basic features cpuid.1:%ecx (CPUID2_xxx bits)
+ * [2] extended features cpuid:80000001:%edx
+ * [3] extended features cpuid:80000001:%ecx
+ * [4] VIA padlock features
+ * [5] structured extended features cpuid.7:%ebx
+ * [6] structured extended features cpuid.7:%ecx
+ */
extern char x86_64_doubleflt_stack[];
@@ -784,7 +786,7 @@
}
/*
- * The CPU ends up here when its ready to run
+ * The CPU ends up here when it's ready to run.
* This is called from code in mptramp.s; at this point, we are running
* in the idle pcb/idle stack of the new CPU. When this function returns,
* this processor will enter the idle loop and start looking for work.
diff -r 6d1c6fa0e0be -r 7a3f6f340234 sys/arch/x86/x86/identcpu.c
--- a/sys/arch/x86/x86/identcpu.c Sat Mar 10 16:12:07 2018 +0000
+++ b/sys/arch/x86/x86/identcpu.c Mon Mar 19 16:54:58 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: identcpu.c,v 1.45.2.1 2014/10/30 18:58:45 martin Exp $ */
+/* $NetBSD: identcpu.c,v 1.45.2.1.2.1 2018/03/19 16:54:58 martin 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.45.2.1 2014/10/30 18:58:45 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.45.2.1.2.1 2018/03/19 16:54:58 martin Exp $");
#include "opt_xen.h"
@@ -858,6 +858,15 @@
memcpy(cpu_brand_string, ((char *) brand) + i, 48 - i);
}
+ /*
+ * Get the structured extended features.
+ */
+ if (cpuid_level >= 7) {
+ x86_cpuid(7, descs);
+ ci->ci_feat_val[5] = descs[1]; /* %ebx */
+ ci->ci_feat_val[6] = descs[2]; /* %ecx */
+ }
+
cpu_probe_intel(ci);
cpu_probe_k5(ci);
cpu_probe_k678(ci);
Home |
Main Index |
Thread Index |
Old Index