Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/cpuctl/arch Print Intel cpuid 7 %edx.



details:   https://anonhg.NetBSD.org/src/rev/f9a1265e8ee3
branches:  trunk
changeset: 358620:f9a1265e8ee3
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Jan 10 07:08:35 2018 +0000

description:
Print Intel cpuid 7 %edx.

Example output of cpuctl -v identify 0:

+cpu0: 00000007: 00000000 000027ab 00000000 0c000000
(snip)
+cpu0: SEF edx 0xc000000<IBRS,STIBP>

diffstat:

 usr.sbin/cpuctl/arch/i386.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r 65eb0ce51293 -r f9a1265e8ee3 usr.sbin/cpuctl/arch/i386.c
--- a/usr.sbin/cpuctl/arch/i386.c       Wed Jan 10 07:04:54 2018 +0000
+++ b/usr.sbin/cpuctl/arch/i386.c       Wed Jan 10 07:08:35 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386.c,v 1.78 2017/10/19 03:09:55 msaitoh Exp $        */
+/*     $NetBSD: i386.c,v 1.79 2018/01/10 07:08:35 msaitoh Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.78 2017/10/19 03:09:55 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.79 2018/01/10 07:08:35 msaitoh Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -1900,6 +1900,12 @@
        if (cpu_vendor == CPUVENDOR_INTEL)
                print_bits(cpuname, "features6", CPUID_SEF_FLAGS1,
                    ci->ci_feat_val[6]);
+
+       if ((cpu_vendor == CPUVENDOR_INTEL) && (ci->ci_cpuid_level >= 7)) {
+               x86_cpuid(7, descs);
+               print_bits(cpuname, "SEF edx", CPUID_SEF_FLAGS2, descs[3]);
+       }
+
        print_bits(cpuname, "xsave features", XCR0_FLAGS1, ci->ci_feat_val[7]);
        print_bits(cpuname, "xsave instructions", CPUID_PES1_FLAGS,
            ci->ci_feat_val[8]);



Home | Main Index | Thread Index | Old Index