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 Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/b1c169098d35
branches:  netbsd-7
changeset: 799832:b1c169098d35
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Mar 06 17:53:26 2016 +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 0e983d9d7103 -r b1c169098d35 sys/arch/x86/include/cpu.h
--- a/sys/arch/x86/include/cpu.h        Sun Mar 06 17:49:55 2016 +0000
+++ b/sys/arch/x86/include/cpu.h        Sun Mar 06 17:53:26 2016 +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.4.1 2016/03/06 17:53:26 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 0e983d9d7103 -r b1c169098d35 sys/arch/x86/include/cpuvar.h
--- a/sys/arch/x86/include/cpuvar.h     Sun Mar 06 17:49:55 2016 +0000
+++ b/sys/arch/x86/include/cpuvar.h     Sun Mar 06 17:53:26 2016 +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.14.1 2016/03/06 17:53:26 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 0e983d9d7103 -r b1c169098d35 sys/arch/x86/x86/cpu.c
--- a/sys/arch/x86/x86/cpu.c    Sun Mar 06 17:49:55 2016 +0000
+++ b/sys/arch/x86/x86/cpu.c    Sun Mar 06 17:53:26 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.c,v 1.111.2.2 2015/11/06 00:40:02 riz Exp $        */
+/*     $NetBSD: cpu.c,v 1.111.2.3 2016/03/06 17:53:26 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.2 2015/11/06 00:40:02 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.111.2.3 2016/03/06 17:53:26 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 0e983d9d7103 -r b1c169098d35 sys/arch/x86/x86/identcpu.c
--- a/sys/arch/x86/x86/identcpu.c       Sun Mar 06 17:49:55 2016 +0000
+++ b/sys/arch/x86/x86/identcpu.c       Sun Mar 06 17:53:26 2016 +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.2 2016/03/06 17:53:26 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.2 2016/03/06 17:53:26 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