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 cpuid 7 sub-leaf 1 %ebx, %edx and...



details:   https://anonhg.NetBSD.org/src/rev/4034bc11d8b1
branches:  trunk
changeset: 372841:4034bc11d8b1
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Dec 30 12:21:07 2022 +0000

description:
Print cpuid 7 sub-leaf 1 %ebx, %edx and sub-leaf 2 %edx.

diffstat:

 usr.sbin/cpuctl/arch/i386.c |  20 ++++++++++++++++----
 1 files changed, 16 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r c59a5440c87e -r 4034bc11d8b1 usr.sbin/cpuctl/arch/i386.c
--- a/usr.sbin/cpuctl/arch/i386.c       Fri Dec 30 12:12:54 2022 +0000
+++ b/usr.sbin/cpuctl/arch/i386.c       Fri Dec 30 12:21:07 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386.c,v 1.133 2022/11/17 15:21:31 msaitoh Exp $       */
+/*     $NetBSD: i386.c,v 1.134 2022/12/30 12:21:07 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.133 2022/11/17 15:21:31 msaitoh Exp $");
+__RCSID("$NetBSD: i386.c,v 1.134 2022/12/30 12:21:07 msaitoh Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -2210,13 +2210,25 @@
        if ((ci->ci_max_cpuid >= 7)
            && ((cpu_vendor == CPUVENDOR_INTEL)
                || (cpu_vendor == CPUVENDOR_AMD))) {
+               unsigned int maxsubleaf;
+
                x86_cpuid(7, descs);
+               maxsubleaf = descs[0];
                aprint_verbose("%s: SEF highest subleaf %08x\n",
-                   cpuname, descs[0]);
-               if (descs[0] >= 1) {
+                   cpuname, maxsubleaf);
+               if (maxsubleaf >= 1) {
                        x86_cpuid2(7, 1, descs);
                        print_bits(cpuname, "SEF-subleaf1-eax",
                            CPUID_SEF1_FLAGS_A, descs[0]);
+                       print_bits(cpuname, "SEF-subleaf1-ebx",
+                           CPUID_SEF1_FLAGS_B, descs[1]);
+                       print_bits(cpuname, "SEF-subleaf1-edx",
+                           CPUID_SEF1_FLAGS_D, descs[3]);
+               }
+               if (maxsubleaf >= 2) {
+                       x86_cpuid2(7, 2, descs);
+                       print_bits(cpuname, "SEF-subleaf2-edx",
+                           CPUID_SEF2_FLAGS_D, descs[3]);
                }
        }
 



Home | Main Index | Thread Index | Old Index