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 Add v_spec_ctrl, avx512_fp16, sme, sev and ...



details:   https://anonhg.NetBSD.org/src/rev/dc5271dbd577
branches:  trunk
changeset: 1022247:dc5271dbd577
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Sat Jul 10 17:33:28 2021 +0000

description:
Add v_spec_ctrl, avx512_fp16, sme, sev and sev_es. Tested by nonaka@.

diffstat:

 sys/arch/x86/x86/procfs_machdep.c |  38 +++++++++++++++++++++++++++-----------
 1 files changed, 27 insertions(+), 11 deletions(-)

diffs (93 lines):

diff -r 88eab6bfda81 -r dc5271dbd577 sys/arch/x86/x86/procfs_machdep.c
--- a/sys/arch/x86/x86/procfs_machdep.c Sat Jul 10 17:18:05 2021 +0000
+++ b/sys/arch/x86/x86/procfs_machdep.c Sat Jul 10 17:33:28 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_machdep.c,v 1.40 2020/11/30 00:04:02 msaitoh Exp $ */
+/*     $NetBSD: procfs_machdep.c,v 1.41 2021/07/10 17:33:28 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.40 2020/11/30 00:04:02 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.41 2021/07/10 17:33:28 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -82,11 +82,13 @@
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
        { /* (3) Linux mapping */
-       "cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL,
-       "constant_tsc", 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},
+       "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", NULL, NULL, NULL, NULL,
+       "constant_tsc", "up", "art", "arch_perfmon",
+       "pebs", "bts", NULL, NULL,
+       "rep_good", NULL, NULL, "acc_power",
+       "nopl", NULL, "xtopology", "tsc_reliable",
+       "nonstop_tsc", "cpuid", "extd_apicid", "amd_dcm",
+       "aperfmperf", "rapl", "nonstop_tsc_s3", "tsc_known_freq"},
 
        { /* (4) Intel-defined: 0x00000001 ecx */
        "pni", "pclmulqdq", "dtes64", "monitor", "ds_cpl", "vmx", "smx", "est",
@@ -112,7 +114,7 @@
 
        { /* (7) Linux mapping */
        NULL, NULL, "cpb", "ebp", NULL, "pln", "pts", "dtherm",
-       "hw_pstate", "proc_feedback", "sme", NULL,
+       "hw_pstate", "proc_feedback", NULL, NULL,
        NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, "ibrs", "ibpb", "stibp", NULL, NULL, NULL, NULL},
@@ -165,12 +167,12 @@
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
-       { /* (15) 0x8000000a edx */
+       { /* (15) AMD 0x8000000a edx */
        "npt", "lbrv", "svm_lock", "nrip_save",
        "tsc_scale", "vmcb_clean", "flushbyasid", "decodeassists",
        NULL, NULL, "pausefilter", NULL, "pfthreshold", "avic", NULL,
        "v_vmsave_vmload",
-       "vgif", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+       "vgif", NULL, NULL, NULL, "v_spec_ctrl", NULL, NULL, NULL,
        NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL},
 
        { /* (16) 0x00000007:0 ecx */
@@ -190,9 +192,15 @@
        { /* (18) Intel 0x00000007 edx */
        NULL, NULL, "avx512_4vnniw", "avx512_4fmaps", "fsrm", NULL, NULL, NULL,
        "vp2intersect", NULL, "md_clear", NULL, NULL, NULL, "serialize", NULL,
-       "tsxldtrk", NULL, "pconfig", NULL, NULL, NULL, NULL, NULL,
+       "tsxldtrk", NULL, "pconfig", NULL, NULL, NULL, NULL, "avx512_fp16",
        NULL, NULL, NULL, NULL,
        "flush_l1d", "arch_capabilities", NULL, "ssbd"},
+
+       { /* (19) AMD 0x8000001f eax */
+       "sme", "sev", NULL, "sev_es", 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 *);
@@ -354,6 +362,14 @@
                diff = last - *left;
        }
 
+       if ((cpu_vendor == CPUVENDOR_AMD)
+           && (ci->ci_max_ext_cpuid >= 0x80000019)) {
+               x86_cpuid(0x8000001f, descs);
+               procfs_getonefeatreg(descs[0], x86_features[19], p + diff,
+                   left);
+               diff = last - *left;
+       }
+
        return 0; /* XXX */
 }
 



Home | Main Index | Thread Index | Old Index