aboutsummaryrefslogtreecommitdiff
path: root/lib/libc
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-01-21 12:54:28 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-01-21 12:55:31 +0000
commit523d94dbeab5ccb1cce21b8cad350b700c3d01b2 (patch)
tree9765e2474afd4bc3313007e5009d1a29164db6b9 /lib/libc
parent9f47eeffa3cfdcb512e2011fb00fc23c7c1a7d75 (diff)
downloadsrc-523d94dbeab5ccb1cce21b8cad350b700c3d01b2.tar.gz
src-523d94dbeab5ccb1cce21b8cad350b700c3d01b2.zip
x86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs
Reported by: many Tested by: gallatin, mikael, rhurlin MFC after: 1 week Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/x86/sys/__vdso_gettc.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/libc/x86/sys/__vdso_gettc.c b/lib/libc/x86/sys/__vdso_gettc.c
index 7f224f8758cb..7a64f2a0b556 100644
--- a/lib/libc/x86/sys/__vdso_gettc.c
+++ b/lib/libc/x86/sys/__vdso_gettc.c
@@ -125,7 +125,7 @@ struct tsc_selector_tag {
};
static const struct tsc_selector_tag tsc_selector[] = {
- [0] = { /* Intel or AMD Zen+, LFENCE */
+ [0] = { /* Intel, LFENCE */
.ts_rdtsc32 = rdtsc32_mb_lfence,
.ts_rdtsc_low = rdtsc_low_mb_lfence,
},
@@ -164,9 +164,6 @@ tsc_selector_idx(u_int cpu_feature)
do_cpuid(1, p);
cpu_id = p[0];
- if (amd_cpu && CPUID_TO_FAMILY(cpu_id) >= 0x17)
- return (0);
-
if (cpu_feature != 0) {
do_cpuid(0x80000000, p);
cpu_exthigh = p[0];