From nobody Tue Dec 28 22:54:49 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 003BC191CE0C; 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 4JNqc91YTnz4cWR; Tue, 28 Dec 2021 22:54:49 +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 1567819E5F; Tue, 28 Dec 2021 22:54:49 +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 1BSMsn2I053304; Tue, 28 Dec 2021 22:54:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BSMsnNa053303; Tue, 28 Dec 2021 22:54:49 GMT (envelope-from git) Date: Tue, 28 Dec 2021 22:54:49 GMT Message-Id: <202112282254.1BSMsnNa053303@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: deca0138dc65 - main - x86: Check for APIC presence only if DEV_ATPIC is defined 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: deca0138dc659747c9edd4648690cdfdb01f58e8 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640732089; 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=dVm6eiVjTb8UM9Sls66U1jmK8g/Zoogi/IBq2oWgzjE=; b=mpbPZ7NFXKmdkec/kBmiMOKNCgaTtljfX59QA5jVrM7xx5RENJmdZp8BoVsV5ryLwr9xc6 0o2AT5zVpMD52kLA4wRRlZnKtd+b4pADXCRhlw6g/Xwcbj1QMGdX+29d1LexTnp+EsSbP6 VmkFTJ3lnajCC/+ayzpxO4wx3xqVYkvV1wpSI8Q3ko1fM9eTEEuXYD949Rb5VJhnY3U/Mv b92X7m4Fw/5G2ClR5EIeaWsAMn417tXQeymP5mjjWb9pWeBe1/pP4dgo6Z3dNhFQk7Zzn0 usNjwgA4/s0Hu+cOcwX59g3obQSsQRgFVc/SaW3HaPpCC1eJsAssFtN5weuItw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640732089; a=rsa-sha256; cv=none; b=ewh5nfbEwVImfSxWr7g5mTa+YMTRFzflN/Lao1ciPWWANWVY6EVbZPkZPUP5nDpPLf4Pv6 2QkcdEEsQkL4fAcg0BKCe6BarxuXiqKJ3vk1zxF43uAlP/tLEqu76gJov5FoVfWdMrbada 8q9qrUIxdS8B4lNLnErD3IUmEs3UJDoAieKiBjAIN2OqGzaT3syMv8bhkRFvUaIpJqEvsq iAETpxGC8UV/S/yhpvKKFpHo77GuqtdobbTFVSWyQo7gwwelplhWBED1gsq7VAJiFT9gce wppnuddf6rsIhK836vAeg0OPaptMaapxlwm7TDnQwoaJKwChMLXZnli6HFsQxA== 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=deca0138dc659747c9edd4648690cdfdb01f58e8 commit deca0138dc659747c9edd4648690cdfdb01f58e8 Author: Mark Johnston AuthorDate: 2021-12-28 22:42:12 +0000 Commit: Mark Johnston CommitDate: 2021-12-28 22:47:49 +0000 x86: Check for APIC presence only if DEV_ATPIC is defined We only attempt to gracefully handle absence of an APIC if "device atpic" is defined in the kernel configuration. Suggested by: kib Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation --- sys/x86/x86/local_apic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/x86/x86/local_apic.c b/sys/x86/x86/local_apic.c index ac3dfa4ca1d3..1264eeaaf7b8 100644 --- a/sys/x86/x86/local_apic.c +++ b/sys/x86/x86/local_apic.c @@ -932,9 +932,11 @@ native_lapic_enable_pmc(void) #ifdef HWPMC_HOOKS u_int32_t maxlvt; +#ifdef DEV_ATPIC /* Fail if the local APIC is not present. */ if (!x2apic_mode && lapic_map == NULL) return (0); +#endif /* Fail if the PMC LVT is not present. */ maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT; @@ -971,9 +973,11 @@ native_lapic_disable_pmc(void) #ifdef HWPMC_HOOKS u_int32_t maxlvt; +#ifdef DEV_ATPIC /* Fail if the local APIC is not present. */ if (!x2apic_mode && lapic_map == NULL) return; +#endif /* Fail if the PMC LVT is not present. */ maxlvt = (lapic_read32(LAPIC_VERSION) & APIC_VER_MAXLVT) >> MAXLVTSHIFT;