Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 - Print 0x00000007:0 ecx leaf bits.



details:   https://anonhg.NetBSD.org/src/rev/7cdcb53dd1cf
branches:  trunk
changeset: 353631:7cdcb53dd1cf
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon May 15 04:21:14 2017 +0000

description:
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.

diffstat:

 sys/arch/x86/x86/procfs_machdep.c |  72 +++++++++++++++++++++++++++++++++++---
 1 files changed, 66 insertions(+), 6 deletions(-)

diffs (125 lines):

diff -r dd8ddccea626 -r 7cdcb53dd1cf sys/arch/x86/x86/procfs_machdep.c
--- a/sys/arch/x86/x86/procfs_machdep.c Mon May 15 04:02:52 2017 +0000
+++ b/sys/arch/x86/x86/procfs_machdep.c Mon May 15 04:21:14 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_machdep.c,v 1.14 2016/12/08 06:28:21 msaitoh Exp $ */
+/*     $NetBSD: procfs_machdep.c,v 1.15 2017/05/15 04:21:14 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.14 2016/12/08 06:28:21 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.15 2017/05/15 04:21:14 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -131,7 +131,7 @@
        "clwb", NULL, "avx512pf", "avx512er",
        "avx512cd", "sha_ni", "avx512bw", "avx512vl"},
 
-       { /* (10) 0000000d eax */
+       { /* (10) 0x0000000d eax */
        "xsaveopt", "xsavec", "xgetbv1", "xsaves", NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
@@ -148,6 +148,38 @@
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+
+       { /* (13) 0x80000008 ebx */
+       "clzero", "irperf", NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+
+       { /* (14) 0x00000006 eax */
+       "dtherm", "ida", "arat", NULL, "pln", NULL, "pts", "hwp",
+       "hwp_notify", "hwp_act_window", "hwp_epp","hwp_pkg_req",
+       NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+
+       { /* (15) 0x8000000a edx */
+       "npt", "lbrv", "svm_lock", "nrip_save",
+       "tsc_scale", "vmcb_clean", "flushbyasid", "decodeassists",
+       NULL, NULL, "pausefilter", NULL, "pfthreshold", "avic", NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+
+       { /* (16) 0x00000007:0 ecx */
+       NULL, "avx512vbmi", NULL, "pku", "ospke", NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, "avx512_vpopcntdq", NULL,
+       "la57", NULL, NULL, NULL, NULL, NULL, "rdpid", NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
+
+       { /* (17) 0x80000007 ebx */
+       "overflow_recov", "succor", "smca", NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 };
 
 static int     procfs_getonecpu(int, struct cpu_info *, char *, size_t *);
@@ -246,9 +278,18 @@
            left);
        diff = last - *left;
 
-       /* (10) 0000000d eax */
+       /* (10) 0x0000000d eax */
        /* (11) 0x0000000f(ecx=0) edx */
        /* (12) 0x0000000f(ecx=1) edx */
+       /* (13) 0x80000008 ebx */
+       /* (14) 0x00000006 eax */
+       /* (15) 0x8000000a edx */
+
+       procfs_getonefeatreg(ci->ci_feat_val[6], x86_features[16], p + diff,
+           left);
+       diff = last - *left;
+
+       /* (17) 0x80000007 ebx */
 
        return 0; /* XXX */
 }
@@ -318,17 +359,36 @@
                left = 0;
 
        l = snprintf(p, left,
+           "apicid\t\t: %d\n"
+           "initial apicid\t: %d\n",
+           ci->ci_acpiid,
+           ci->ci_initapicid
+       );
+       size += l;
+       if (l < left) {
+               left -= l;
+               p += l;
+       } else
+               left = 0;
+
+       l = snprintf(p, left,
+#ifdef __i386__
            "fdiv_bug\t: %s\n"
+#endif
            "fpu\t\t: %s\n"
            "fpu_exception\t: yes\n"
            "cpuid level\t: %d\n"
            "wp\t\t: %s\n"
-           "flags\t\t: %s\n",
+           "flags\t\t: %s\n"
+           "clflush size\t: %d\n",
+#ifdef __i386__
            i386_fpu_fdivbug ? "yes" : "no",    /* an old pentium */
+#endif
            i386_fpu_present ? "yes" : "no",    /* not a 486SX */
            cpuid_level,
            (rcr0() & CR0_WP) ? "yes" : "no",
-           featurebuf
+           featurebuf,
+           ci->ci_cflush_lsize
        );
        size += l;
 



Home | Main Index | Thread Index | Old Index