git: 523d94dbeab5 - main - x86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs

Konstantin Belousov kib at FreeBSD.org
Thu Jan 21 12:58:10 UTC 2021


The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=523d94dbeab5ccb1cce21b8cad350b700c3d01b2

commit 523d94dbeab5ccb1cce21b8cad350b700c3d01b2
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-01-21 12:54:28 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-01-21 12:55:31 +0000

    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(-)

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];


More information about the dev-commits-src-all mailing list