From nobody Tue Dec 28 22:54:50 2021 X-Original-To: dev-commits-src-all@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 A0B42191CF87; Tue, 28 Dec 2021 22:54:50 +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 4JNqcB2LWjz4chg; Tue, 28 Dec 2021 22:54:50 +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 322121A04A; Tue, 28 Dec 2021 22:54:50 +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 1BSMsomp053328; Tue, 28 Dec 2021 22:54:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BSMsoQ1053327; Tue, 28 Dec 2021 22:54:50 GMT (envelope-from git) Date: Tue, 28 Dec 2021 22:54:50 GMT Message-Id: <202112282254.1BSMsoQ1053327@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 0ecda8d5ae89 - main - x86: Do not attempt to calibrate the LAPIC timer if no APIC is present List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/main X-Git-Reftype: branch X-Git-Commit: 0ecda8d5ae896b229f13bfe73ffa3a7fc81cc550 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640732090; 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=jHLNfOtMbiS4NxH3lGwtNnA22f/XvIfFdbO+Gyx5Vec=; b=g+CqTfHTQsI6NUCqH14eMwu5Q00YwT2FGuN6O6CXMENTrNAytcJpNm4WQxWn+nWX9sSWNb zLF6rqRfw4o/l7x19Qt/cM7b97iX0KjuWUlfHJd13W7DcW+dEHaTfr7nS5+eRmrbnzS6DY 3rzU+wTeWRVUq/f+wwbGgBax0retfFNH9uzZ7HQmcRO3PLxelF3TY4rBB8jk5pqUvTpO/M iwlmY3xT9jI7Qg4BIdrnoVr5F1720RdiNw7y7jgWewC9QdXnufaZCI3O1sRfrI5OMb4XoA LH7YHt2HxweZXbiIwy0xJOqfZN87n4YVZRuqak6LDOdyJK3pPdIVNRHf0eY/DQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640732090; a=rsa-sha256; cv=none; b=EDV2676rQJlsJJnbG1XlDQis7zqlh8Uzlnu7kxlv5rlNy45OlTdu4+78/e07Yp52C8qOJY IeSq7uMm9lsEMRJtA9Oaey6kS1cmWCQPfYo4JkUIcW5Tir8vcywmkiuR0aGxwTUDR467b4 rVimxLrK/ab632x5sEcg2AGMqTqMLjQxcjQgBtOgjOjGKr1/m66MpReG0jFgu5q8+tr4Gk vFEDr3vwf69S6+PV49d1EFH/FC0NQYwTl80pqT7XuuITZREVO4ZyhQB73ujf5hKuTWinik fnrIzW/U0KXu/i0/A2rv3qxMRONYg9wdYZdDVuaXCgIoE9GvQa2j8EnzG5LmGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=0ecda8d5ae896b229f13bfe73ffa3a7fc81cc550 commit 0ecda8d5ae896b229f13bfe73ffa3a7fc81cc550 Author: Mark Johnston AuthorDate: 2021-12-28 22:44:57 +0000 Commit: Mark Johnston CommitDate: 2021-12-28 22:47:49 +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") MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33669 --- 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 1264eeaaf7b8..23b780b121e1 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -913,6 +913,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()];