Add AVX512_VP2INTERSECT, SERIALIZE and TSXLDTRK(TSX suspend load addr tracking)diff -r1.158 -r1.159 src/sys/arch/x86/include/specialreg.h
(msaitoh)
--- src/sys/arch/x86/include/specialreg.h 2019/11/17 15:31:05 1.158
+++ src/sys/arch/x86/include/specialreg.h 2020/04/01 08:21:38 1.159
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: specialreg.h,v 1.158 2019/11/17 15:31:05 msaitoh Exp $ */ | 1 | /* $NetBSD: specialreg.h,v 1.159 2020/04/01 08:21:38 msaitoh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2014-2019 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 2014-2019 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without | |
8 | * modification, are permitted provided that the following conditions | 8 | * modification, are permitted provided that the following conditions | |
9 | * are met: | 9 | * are met: | |
10 | * 1. Redistributions of source code must retain the above copyright | 10 | * 1. Redistributions of source code must retain the above copyright | |
11 | * notice, this list of conditions and the following disclaimer. | 11 | * notice, this list of conditions and the following disclaimer. | |
12 | * 2. Redistributions in binary form must reproduce the above copyright | 12 | * 2. Redistributions in binary form must reproduce the above copyright | |
13 | * notice, this list of conditions and the following disclaimer in the | 13 | * notice, this list of conditions and the following disclaimer in the | |
14 | * documentation and/or other materials provided with the distribution. | 14 | * documentation and/or other materials provided with the distribution. | |
@@ -465,42 +465,46 @@ | @@ -465,42 +465,46 @@ | |||
465 | "b\0PREFETCHWT1\0" "b\1AVX512_VBMI\0" "b\2UMIP\0" "b\3PKU\0" \ | 465 | "b\0PREFETCHWT1\0" "b\1AVX512_VBMI\0" "b\2UMIP\0" "b\3PKU\0" \ | |
466 | "b\4OSPKE\0" "b\5WAITPKG\0" "b\6AVX512_VBMI2\0" "b\7CET_SS\0" \ | 466 | "b\4OSPKE\0" "b\5WAITPKG\0" "b\6AVX512_VBMI2\0" "b\7CET_SS\0" \ | |
467 | "b\10GFNI\0" "b\11VAES\0" "b\12VPCLMULQDQ\0" "b\13AVX512_VNNI\0"\ | 467 | "b\10GFNI\0" "b\11VAES\0" "b\12VPCLMULQDQ\0" "b\13AVX512_VNNI\0"\ | |
468 | "b\14AVX512_BITALG\0" "b\16AVX512_VPOPCNTDQ\0" \ | 468 | "b\14AVX512_BITALG\0" "b\16AVX512_VPOPCNTDQ\0" \ | |
469 | "f\21\5MAWAU\0" \ | 469 | "f\21\5MAWAU\0" \ | |
470 | "b\26RDPID\0" \ | 470 | "b\26RDPID\0" \ | |
471 | "b\31CLDEMOTE\0" "b\33MOVDIRI\0" \ | 471 | "b\31CLDEMOTE\0" "b\33MOVDIRI\0" \ | |
472 | "b\34MOVDIR64B\0" "b\36SGXLC\0" | 472 | "b\34MOVDIR64B\0" "b\36SGXLC\0" | |
473 | 473 | |||
474 | /* %edx */ | 474 | /* %edx */ | |
475 | #define CPUID_SEF_AVX512_4VNNIW __BIT(2) | 475 | #define CPUID_SEF_AVX512_4VNNIW __BIT(2) | |
476 | #define CPUID_SEF_AVX512_4FMAPS __BIT(3) | 476 | #define CPUID_SEF_AVX512_4FMAPS __BIT(3) | |
477 | #define CPUID_SEF_FSREP_MOV __BIT(4) /* Fast Short REP MOV */ | 477 | #define CPUID_SEF_FSREP_MOV __BIT(4) /* Fast Short REP MOV */ | |
478 | #define CPUID_SEF_AVX512_VP2INTERSECT __BIT(8) | |||
478 | #define CPUID_SEF_MD_CLEAR __BIT(10) | 479 | #define CPUID_SEF_MD_CLEAR __BIT(10) | |
479 | #define CPUID_SEF_TSX_FORCE_ABORT __BIT(13) /* MSR_TSX_FORCE_ABORT bit 0 */ | 480 | #define CPUID_SEF_TSX_FORCE_ABORT __BIT(13) /* MSR_TSX_FORCE_ABORT bit 0 */ | |
481 | #define CPUID_SEF_SERIALIZE __BIT(14) | |||
480 | #define CPUID_SEF_HYBRID __BIT(15) /* Hybrid part */ | 482 | #define CPUID_SEF_HYBRID __BIT(15) /* Hybrid part */ | |
483 | #define CPUID_SEF_TSXLDTRK __BIT(16) /* TSX suspend load addr tracking */ | |||
481 | #define CPUID_SEF_CET_IBT __BIT(20) /* CET Indirect Branch Tracking */ | 484 | #define CPUID_SEF_CET_IBT __BIT(20) /* CET Indirect Branch Tracking */ | |
482 | #define CPUID_SEF_IBRS __BIT(26) /* IBRS / IBPB Speculation Control */ | 485 | #define CPUID_SEF_IBRS __BIT(26) /* IBRS / IBPB Speculation Control */ | |
483 | #define CPUID_SEF_STIBP __BIT(27) /* STIBP Speculation Control */ | 486 | #define CPUID_SEF_STIBP __BIT(27) /* STIBP Speculation Control */ | |
484 | #define CPUID_SEF_L1D_FLUSH __BIT(28) /* IA32_FLUSH_CMD MSR */ | 487 | #define CPUID_SEF_L1D_FLUSH __BIT(28) /* IA32_FLUSH_CMD MSR */ | |
485 | #define CPUID_SEF_ARCH_CAP __BIT(29) /* IA32_ARCH_CAPABILITIES */ | 488 | #define CPUID_SEF_ARCH_CAP __BIT(29) /* IA32_ARCH_CAPABILITIES */ | |
486 | #define CPUID_SEF_CORE_CAP __BIT(30) /* IA32_CORE_CAPABILITIES */ | 489 | #define CPUID_SEF_CORE_CAP __BIT(30) /* IA32_CORE_CAPABILITIES */ | |
487 | #define CPUID_SEF_SSBD __BIT(31) /* Speculative Store Bypass Disable */ | 490 | #define CPUID_SEF_SSBD __BIT(31) /* Speculative Store Bypass Disable */ | |
488 | 491 | |||
489 | #define CPUID_SEF_FLAGS2 "\20" \ | 492 | #define CPUID_SEF_FLAGS2 "\20" \ | |
490 | "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \ | 493 | "\3" "AVX512_4VNNIW" "\4" "AVX512_4FMAPS" \ | |
491 | "\5" "FSREP_MOV" \ | 494 | "\5" "FSREP_MOV" \ | |
492 | "\13" "MD_CLEAR" \ | 495 | "\11" "VP2INTERSECT" "\13" "MD_CLEAR" \ | |
493 | "\16" "TSX_FORCE_ABORT" "\20" "HYBRID" \ | 496 | "\16TSX_FORCE_ABORT" "\17SERIALIZE" "\20HYBRID" \ | |
497 | "\21" "TSXLDTRK" \ | |||
494 | "\25" "CET_IBT" \ | 498 | "\25" "CET_IBT" \ | |
495 | "\33" "IBRS" "\34" "STIBP" \ | 499 | "\33" "IBRS" "\34" "STIBP" \ | |
496 | "\35" "L1D_FLUSH" "\36" "ARCH_CAP" "\37CORE_CAP" "\40" "SSBD" | 500 | "\35" "L1D_FLUSH" "\36" "ARCH_CAP" "\37CORE_CAP" "\40" "SSBD" | |
497 | 501 | |||
498 | /* | 502 | /* | |
499 | * Intel CPUID Architectural Performance Monitoring Fn0000000a | 503 | * Intel CPUID Architectural Performance Monitoring Fn0000000a | |
500 | * | 504 | * | |
501 | * See also src/usr.sbin/tprof/arch/tprof_x86.c | 505 | * See also src/usr.sbin/tprof/arch/tprof_x86.c | |
502 | */ | 506 | */ | |
503 | 507 | |||
504 | /* %eax */ | 508 | /* %eax */ | |
505 | #define CPUID_PERF_VERSION __BITS(7, 0) /* Version ID */ | 509 | #define CPUID_PERF_VERSION __BITS(7, 0) /* Version ID */ | |
506 | #define CPUID_PERF_NGPPC __BITS(15, 8) /* Num of G.P. perf counter */ | 510 | #define CPUID_PERF_NGPPC __BITS(15, 8) /* Num of G.P. perf counter */ |
--- src/sys/arch/x86/x86/procfs_machdep.c 2020/01/17 04:48:21 1.35
+++ src/sys/arch/x86/x86/procfs_machdep.c 2020/04/01 08:21:38 1.36
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: procfs_machdep.c,v 1.35 2020/01/17 04:48:21 msaitoh Exp $ */ | 1 | /* $NetBSD: procfs_machdep.c,v 1.36 2020/04/01 08:21:38 msaitoh Exp $ */ | |
2 | 2 | |||
3 | /* | 3 | /* | |
4 | * Copyright (c) 2001 Wasabi Systems, Inc. | 4 | * Copyright (c) 2001 Wasabi Systems, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * Written by Frank van der Linden and Jason R. Thorpe for | 7 | * Written by Frank van der Linden and Jason R. Thorpe for | |
8 | * Wasabi Systems, Inc. | 8 | * Wasabi Systems, Inc. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -32,27 +32,27 @@ | @@ -32,27 +32,27 @@ | |||
32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
36 | * POSSIBILITY OF SUCH DAMAGE. | 36 | * POSSIBILITY OF SUCH DAMAGE. | |
37 | */ | 37 | */ | |
38 | 38 | |||
39 | /* | 39 | /* | |
40 | * NOTE: We simply use the primary CPU's cpuid_level and tsc_freq | 40 | * NOTE: We simply use the primary CPU's cpuid_level and tsc_freq | |
41 | * here. Might want to change this later. | 41 | * here. Might want to change this later. | |
42 | */ | 42 | */ | |
43 | 43 | |||
44 | #include <sys/cdefs.h> | 44 | #include <sys/cdefs.h> | |
45 | __KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.35 2020/01/17 04:48:21 msaitoh Exp $"); | 45 | __KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.36 2020/04/01 08:21:38 msaitoh Exp $"); | |
46 | 46 | |||
47 | #include <sys/param.h> | 47 | #include <sys/param.h> | |
48 | #include <sys/systm.h> | 48 | #include <sys/systm.h> | |
49 | #include <sys/mount.h> | 49 | #include <sys/mount.h> | |
50 | #include <sys/stat.h> | 50 | #include <sys/stat.h> | |
51 | #include <sys/vnode.h> | 51 | #include <sys/vnode.h> | |
52 | 52 | |||
53 | #include <miscfs/procfs/procfs.h> | 53 | #include <miscfs/procfs/procfs.h> | |
54 | 54 | |||
55 | #include <machine/cpu.h> | 55 | #include <machine/cpu.h> | |
56 | #include <machine/reg.h> | 56 | #include <machine/reg.h> | |
57 | #include <machine/specialreg.h> | 57 | #include <machine/specialreg.h> | |
58 | #include <x86/cputypes.h> | 58 | #include <x86/cputypes.h> | |
@@ -179,27 +179,27 @@ static const char * const x86_features[] | @@ -179,27 +179,27 @@ static const char * const x86_features[] | |||
179 | "gfni", "vaes", "vpclmulqdq", "avx512_vnni", | 179 | "gfni", "vaes", "vpclmulqdq", "avx512_vnni", | |
180 | "avx512_bitalg", "tme", "avx512_vpopcntdq", NULL, | 180 | "avx512_bitalg", "tme", "avx512_vpopcntdq", NULL, | |
181 | "la57", NULL, NULL, NULL, NULL, NULL, "rdpid", NULL, | 181 | "la57", NULL, NULL, NULL, NULL, NULL, "rdpid", NULL, | |
182 | NULL, "cldemote", NULL, "movdiri", "movdir64b", NULL, NULL, NULL}, | 182 | NULL, "cldemote", NULL, "movdiri", "movdir64b", NULL, NULL, NULL}, | |
183 | 183 | |||
184 | { /* (17) 0x80000007 ebx */ | 184 | { /* (17) 0x80000007 ebx */ | |
185 | "overflow_recov", "succor", NULL, "smca", NULL, NULL, NULL, NULL, | 185 | "overflow_recov", "succor", NULL, "smca", NULL, NULL, NULL, NULL, | |
186 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 186 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
187 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 187 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
188 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, | 188 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, | |
189 | 189 | |||
190 | { /* (18) Intel 0x00000007 edx */ | 190 | { /* (18) Intel 0x00000007 edx */ | |
191 | NULL, NULL, "avx512_4vnniw", "avx512_4fmaps", "fsrm", NULL, NULL, NULL, | 191 | NULL, NULL, "avx512_4vnniw", "avx512_4fmaps", "fsrm", NULL, NULL, NULL, | |
192 | NULL, NULL, "md_clear", NULL, NULL, NULL, NULL, NULL, | 192 | "vp2intersect", NULL, "md_clear", NULL, NULL, NULL, NULL, NULL, | |
193 | NULL, NULL, "pconfig", NULL, NULL, NULL, NULL, NULL, | 193 | NULL, NULL, "pconfig", NULL, NULL, NULL, NULL, NULL, | |
194 | NULL, NULL, NULL, NULL, | 194 | NULL, NULL, NULL, NULL, | |
195 | "flush_l1d", "arch_capabilities", NULL, "ssbd"}, | 195 | "flush_l1d", "arch_capabilities", NULL, "ssbd"}, | |
196 | }; | 196 | }; | |
197 | 197 | |||
198 | static int procfs_getonecpu(int, struct cpu_info *, char *, size_t *); | 198 | static int procfs_getonecpu(int, struct cpu_info *, char *, size_t *); | |
199 | 199 | |||
200 | /* | 200 | /* | |
201 | * Linux-style /proc/cpuinfo. | 201 | * Linux-style /proc/cpuinfo. | |
202 | * Only used when procfs is mounted with -o linux. | 202 | * Only used when procfs is mounted with -o linux. | |
203 | * | 203 | * | |
204 | * In the multiprocessor case, this should be a loop over all CPUs. | 204 | * In the multiprocessor case, this should be a loop over all CPUs. | |
205 | */ | 205 | */ |