From owner-dev-commits-src-main@freebsd.org Wed Sep 8 01:32:32 2021 Return-Path: Delivered-To: dev-commits-src-main@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 9B2DC672232; Wed, 8 Sep 2021 01:32:32 +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 4H44Pr3tZ1z3Gp9; Wed, 8 Sep 2021 01:32:32 +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 663F11CD4F; Wed, 8 Sep 2021 01:32:32 +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 1881WWcZ069825; Wed, 8 Sep 2021 01:32:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1881WWPU069824; Wed, 8 Sep 2021 01:32:32 GMT (envelope-from git) Date: Wed, 8 Sep 2021 01:32:32 GMT Message-Id: <202109080132.1881WWPU069824@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 3c253d03d94e - main - Hide acpi_timer_test behind a tunable 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/main X-Git-Reftype: branch X-Git-Commit: 3c253d03d94e89cf1a26716b58fc27653df2a4f3 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2021 01:32:32 -0000 The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=3c253d03d94e89cf1a26716b58fc27653df2a4f3 commit 3c253d03d94e89cf1a26716b58fc27653df2a4f3 Author: Colin Percival AuthorDate: 2021-09-07 23:58:18 +0000 Commit: Colin Percival CommitDate: 2021-09-08 01:31:50 +0000 Hide acpi_timer_test behind a tunable When hw.acpi.timer_test_enabled is set to 0, this makes acpi_timer_test return 1 without actually testing the ACPI timer; this results in the ACPI-fast timecounter always being used rather than potentially using ACPI-safe. The ACPI timer testing was introduced in 2002 as a workaround for errata in Pentium II and Pentium III chipsets, and is unlikely to be needed in 2021. While I'm here, add TSENTER/TSEXIT to make it easier to see the time spent on the test (if it is enabled). Reviewed by: allanjude, imp MFC After: 1 week --- sys/dev/acpica/acpi_timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 763a47a1a959..8be6e0edea7f 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -79,6 +79,8 @@ static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); static void acpi_timer_boot_test(void); static int acpi_timer_test(void); +static int acpi_timer_test_enabled = 1; +TUNABLE_INT("hw.acpi.timer_test_enabled", &acpi_timer_test_enabled); static device_method_t acpi_timer_methods[] = { DEVMETHOD(device_identify, acpi_timer_identify), @@ -404,6 +406,12 @@ acpi_timer_test() int delta, max, max2, min, n; register_t s; + /* Skip the test based on the hw.acpi.timer_test_enabled tunable. */ + if (!acpi_timer_test_enabled) + return (1); + + TSENTER(); + min = INT32_MAX; max = max2 = 0; @@ -434,6 +442,8 @@ acpi_timer_test() if (bootverbose) printf(" %d/%d", n, delta); + TSEXIT(); + return (n); } #undef N