From owner-dev-commits-src-all@freebsd.org Thu Jan 21 12:58:10 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BCDC4F4747; Thu, 21 Jan 2021 12:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DM2W60qzWz3sBl; Thu, 21 Jan 2021 12:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 100A5470F; Thu, 21 Jan 2021 12:58:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 10LCw9Qw053615; Thu, 21 Jan 2021 12:58:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 10LCw9wA053614; Thu, 21 Jan 2021 12:58:09 GMT (envelope-from git) Date: Thu, 21 Jan 2021 12:58:09 GMT Message-Id: <202101211258.10LCw9wA053614@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 523d94dbeab5 - main - x86: switch vdso TSC timecounter to RDTSCP on AMD Zen CPUs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 523d94dbeab5ccb1cce21b8cad350b700c3d01b2 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Jan 2021 12:58:10 -0000 The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=523d94dbeab5ccb1cce21b8cad350b700c3d01b2 commit 523d94dbeab5ccb1cce21b8cad350b700c3d01b2 Author: Konstantin Belousov AuthorDate: 2021-01-21 12:54:28 +0000 Commit: Konstantin Belousov 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];