Module Name: src
Committed By: msaitoh
Date: Mon May 15 04:21:14 UTC 2017
Modified Files:
src/sys/arch/x86/x86: procfs_machdep.c
Log Message:
- Print 0x00000007:0 ecx leaf bits.
- Don't print fdiv_bug on amd64.
- Print APIC ID, Initial APIC ID and clflush size.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/x86/procfs_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/procfs_machdep.c
diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.14 src/sys/arch/x86/x86/procfs_machdep.c:1.15
--- src/sys/arch/x86/x86/procfs_machdep.c:1.14 Thu Dec 8 06:28:21 2016
+++ src/sys/arch/x86/x86/procfs_machdep.c Mon May 15 04:21:14 2017
@@ -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 @@ static const char * const x86_features[]
"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 @@ static const char * const x86_features[]
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 @@ procfs_getonecpufeatures(struct cpu_info
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 @@ procfs_getonecpu(int xcpu, struct cpu_in
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;