From nobody Sun Jan 16 05:34:20 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 7ACC61949FA6; Sun, 16 Jan 2022 05:34:20 +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 4Jc3cr23Ngz4ZpP; Sun, 16 Jan 2022 05:34:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642311260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jqXPUCahmcJ0zBI7V9s6FFAWIwyaGYX1fdV8WUg7YfY=; b=O9Y/GSw+EeHwix2K3WYkKMo4WHiqSy1GC9D1St365YPdKkFFSEm+F4eSWPEGiFXtOSyskq OZK4PC0RPGmhVeoCPy0UVOikIrkpV1JseqqtzkdYMzcFQwlH7i2Av2TUofDvX1mDPHvIWW 7pYoVe9ymY1O6H/YkT0Dps7gMVLdSXqcdJyvyBr++W2393C16X9y3YkkbfaV+ELmWgGP7C GrMlQFtdjec+i0XAb2LZ/oPKsyKTpxbSLSRdaJGdvC62JQcfJ/XYLNZVCx3bQqUSs+/UAt Nespj78K+rYY5S/TNHw0eZBMJQPb6NEneuEUnSJT/YdCC0wFcWAWJeU9Kk91Ow== 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 1EA7614FBA; Sun, 16 Jan 2022 05:34:20 +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 20G5YKTc028145; Sun, 16 Jan 2022 05:34:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20G5YKtN028144; Sun, 16 Jan 2022 05:34:20 GMT (envelope-from git) Date: Sun, 16 Jan 2022 05:34:20 GMT Message-Id: <202201160534.20G5YKtN028144@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 7299cefe3949 - stable/13 - Skip TSC calibration if exact value known List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7299cefe39493490b378ead0118ed2dbe3d36ebb Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642311260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jqXPUCahmcJ0zBI7V9s6FFAWIwyaGYX1fdV8WUg7YfY=; b=E37mKrKKYpp9LNDJ5eCrMFPo5qkG15xd0a2VSFLUD80RVaiazwP6wnqKo8claH17Qp1IMU vRcAHvU5OH9A8nNMkdg9+WNT39d1pEJSta2O6zt4CWMrfbWci3ytnZT5Jzq2ZCyjzee5qo dIT4GL4Vx26xH+iAhbPHXwwYCqIQ672h+kE6WMdM6u+APdrSwMdV08r8MmhkTS9LCruwJn xI1G5yElwQZmPy0xjaCYfwVvaXhvC0uvhB7QBsaqhZVKwF63ZJVMHDQfM6rohzNoSWf28Q dDVDSrjDLvWQ4JzKHlqnlv89Pv1CWnVG6M2uipf6L/TGh7GInU6mDp6ZammKNQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642311260; a=rsa-sha256; cv=none; b=LGqVOipyZsISDuVKlc3c4xXcTEGB+G687Zm+H+v3jw0fB4zQwxmcHh/wqf8zwWvEoCEt0U l1bbgbccJ2E9zA02vM1cnohp/us1XT6xrXiy1wD/mTPROzqT+pETBbqxWjQ22zPL4QQI2o XbFIGJT8NkE38duyTbDt+R5sOe65MST4CpBwtM3MbSf/i1SUB6q2onE7nwQLYqnLdn5R+G JeqwkhKlzH/F8e0FBTYRjzskogdBuGbAJ8MBnGxlahJyIt48G2otZDCGtjk2o2MotAk3D3 +er14LbkIK08zS/waflJfuo9b6mZc5lZ76jfJcGROIlllAH+T/vYmULFyYctrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=7299cefe39493490b378ead0118ed2dbe3d36ebb commit 7299cefe39493490b378ead0118ed2dbe3d36ebb Author: Colin Percival AuthorDate: 2021-12-30 19:43:15 +0000 Commit: Colin Percival CommitDate: 2022-01-16 05:33:33 +0000 Skip TSC calibration if exact value known It's possible that the "early" TSC calibration gave us a value which is known to be exact; in that case, skip the later re-calibration. Differential Revision: https://reviews.freebsd.org/D33695 (cherry picked from commit 9cb3288287ba1b3c1d0ec891c552fc4b9472027e) --- sys/x86/x86/tsc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/x86/x86/tsc.c b/sys/x86/x86/tsc.c index b752ad18f058..7c4375979b3d 100644 --- a/sys/x86/x86/tsc.c +++ b/sys/x86/x86/tsc.c @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); uint64_t tsc_freq; int tsc_is_invariant; int tsc_perf_stat; +static int tsc_early_calib_exact; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; @@ -133,6 +134,7 @@ tsc_freq_vmware(void) tsc_freq = regs[0] | ((uint64_t)regs[1] << 32); } tsc_is_invariant = 1; + tsc_early_calib_exact = 1; } /* @@ -707,6 +709,8 @@ tsc_calibrate(void) if (tsc_disabled) return; + if (tsc_early_calib_exact) + goto calibrated; /* * Avoid using a low-quality timecounter to re-calibrate. In