From d541c7bfd32e007d9556befac2f26776a8dccc10 Mon Sep 17 00:00:00 2001 From: Sigrid Date: Thu, 29 Oct 2020 11:27:26 +0100 Subject: aux/cpuid: decode leaf 7; extend leaf 13 decoding --- sys/src/cmd/aux/cpuid.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/sys/src/cmd/aux/cpuid.c b/sys/src/cmd/aux/cpuid.c index 8d74d2ddc..3b81f53d5 100644 --- a/sys/src/cmd/aux/cpuid.c +++ b/sys/src/cmd/aux/cpuid.c @@ -106,12 +106,54 @@ func1(ulong) printbits("features", r.cx, bitscx); } +void +func7(ulong) +{ + Res r; + static char *bitebx[32] = { + [0] "fsgsbase", nil, "sgx", "bmi1", + [4] "hle", "avx2", nil, "smep", + [8] "bmi2", "erms", "invpcid", "rtm", + [12] "pqm", nil, "mpx", "pqe", + [16] "avx512", "avx512dq", "rdseed", "adx", + [20] "smap", "avx512ifma", "pcommit", "clflushopt", + [24] "clwb", "intelpt", "avx512pf", "avx512er", + [28] "avx512cd", "sha", "avx512bw", "avx512vl", + }; + static char *bitecx[32] = { + [0] "prefetchwt1", "avx512vbmi", "umip", "pku", + [4] "ospke", "waitpkg", "avx512vbmi2", "cetss", + [8] "gfni", "vaes", "vpclmulqdq", "avx512vnni", + [12] "avx512bitalg", nil, "avx512vpopcntdq", nil, + [16] nil, nil, nil, nil, + [20] nil, nil, "rdpid", nil, + [24] nil, "cldemote", nil, "movdiri", + [28] "movdir64b", "enqcmd", "sgxlc", "pks", + }; + static char *bitedx[32] = { + [0] nil, nil, "avx512vnniw4", "avx512fmaps4", + [4] "fsrm", nil, nil, nil, + [8] "avx512vp2i", nil, nil, nil, + }; + static char *biteax[32] = { + [0] nil, nil, nil, nil, + [4] nil, "avx512bf16", nil, nil, + }; + + r = cpuid(7, 0); + printbits("features", r.bx, bitebx); + printbits("features", r.cx, bitecx); + printbits("features", r.dx, bitedx); + r = cpuid(7, 1); + printbits("features", r.ax, biteax); +} + void func13(ulong) { Res r; static char *bitsax[32] = { - [0] "xsaveopt", + [0] "xsaveopt", "xsavec", "xgetbv1", "xsaves", }; r = cpuid(13, 1); @@ -188,6 +230,7 @@ extfunc8(ulong ax) void (*funcs[])(ulong) = { [0] func0, [1] func1, + [7] func7, [13] func13, }; -- cgit v1.2.3