From nobody Wed Dec 29 15:47:03 2021 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 C4B821918012; Wed, 29 Dec 2021 15:47:04 +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 4JPG473SHTz4TvM; Wed, 29 Dec 2021 15:47:03 +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 22FE22790C; Wed, 29 Dec 2021 15:47:03 +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 1BTFl3Wg001500; Wed, 29 Dec 2021 15:47:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BTFl3A0001499; Wed, 29 Dec 2021 15:47:03 GMT (envelope-from git) Date: Wed, 29 Dec 2021 15:47:03 GMT Message-Id: <202112291547.1BTFl3A0001499@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 4642ec266c7e - stable/13 - x86: Do not attempt to calibrate the LAPIC timer if no APIC is present 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4642ec266c7e4f539d891e59f713628fe6281ea3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640792823; 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=f04qRv8G6jovbY0R6wGc+0IyQs4x5CIl/Rv0nD3JAOw=; b=Eqgocr/aafJDLLSrh0dxFtybNUmIvstsQ/tFKl5AMf/unPkroGUCj0qXECR8IanjRRNV0i WeYUJjd65K7VxmsHtUHo4Lt0PJ+X0W6QWbkUsKZ3d2R0tUSOrL1R3JGhw47jLgfB7lGQh9 P+Yg61nTRqIcNjNbP+Ambh6TlN8s+7QrdMSeuoQGRPWU4xZySKndowvoIO9TUS4YDPPBBy NZrKo326OHz/EQiJi2rS0fWK74jAHgSBSRiL8MwMaLHUolsPXly3mrs6IgZHjojWOydi+s tyIlzenku+M13PChR/oQTTBLZr2qcJ1fJ7OoRwXfTMrxTur0aWQuQP9oBpSfBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640792823; a=rsa-sha256; cv=none; b=XcPoWmDmKB6hhT2dt1vPuLcMreZDaVHxQ2NAlxPaIovv5hBRGDIVyC1mCDGIadaioeJvJx nJSW4H13dO3YQmN2RDYWR07COmm638VtlsTdrHVY7eWiIBcljY4mc07Die8XkU3bg8tEHq dU+GNES/4ZRpgZU4Sx5+5eCI3h/G7s6lBTkci6qA2UdZyxK0C/aNrNLBem4zmR/RhrldjN V+8xAnTuY4AxEmzALpd4ai39RZQatdY+Y/V4dquwcd1uaeDFvvCMR6Mls//XT+JPmEBISn i24inb0JU1N4mvwXkEXiFIPrZv+0d1en4wQrHtqtG1NAPZ6HQ7rz/MmYhaTXfA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4642ec266c7e4f539d891e59f713628fe6281ea3 commit 4642ec266c7e4f539d891e59f713628fe6281ea3 Author: Mark Johnston AuthorDate: 2021-12-28 22:44:57 +0000 Commit: Mark Johnston CommitDate: 2021-12-29 15:39:41 +0000 x86: Do not attempt to calibrate the LAPIC timer if no APIC is present Reported and tested by: Michael Butler Reviewed by: jhb, kib Fixes: 62d09b46ad75 ("x86: Defer LAPIC calibration until after timecounters are available") Sponsored by: The FreeBSD Foundation (cherry picked from commit 0ecda8d5ae896b229f13bfe73ffa3a7fc81cc550) --- sys/x86/x86/local_apic.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index 85f4ef1a9c6d..22dcfdef55fe 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -906,6 +906,12 @@ native_lapic_calibrate_timer(void) struct lapic *la; register_t intr; +#ifdef DEV_ATPIC + /* Fail if the local APIC is not present. */ + if (!x2apic_mode && lapic_map == NULL) + return; +#endif + intr = intr_disable(); la = &lapics[lapic_id()];