From 523d94dbeab5ccb1cce21b8cad350b700c3d01b2 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 21 Jan 2021 14:54:28 +0200 Subject: 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 --- lib/libc/x86/sys/__vdso_gettc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'lib/libc') 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]; -- cgit v1.2.3