Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Jan 2021 12:58:09 GMT
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 523d94dbeab5 - main - x86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs
Message-ID:  <202101211258.10LCw9wA053614@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kib:

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

commit 523d94dbeab5ccb1cce21b8cad350b700c3d01b2
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-01-21 12:54:28 +0000
Commit:     Konstantin Belousov <kib@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];



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101211258.10LCw9wA053614>