From nobody Mon Feb 19 16:45:04 2024 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 4TdpL85g5Bz5C9KH; Mon, 19 Feb 2024 16:45: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 4TdpL81wtXz4bVx; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361104; 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=msJOQ2clXagAzcQmuP9w/c4Z3LbZntdtlXEMdeQW5N8=; b=EAJAGQZs7BUCD3sYhdIOn793u/iY65gFAzd2AEEblaFd8RFLvxIHlAuetAzHEzMpTKDcOE bET0UTh9LUS0572ApeHeWMQZZ2GoqW4MRHZemlmsdWu6KnXgO+nwqQ/mxhRbBFXuZt2Sll BX0yZQziA2Yo5MO+Kqubc1Gap/w5Msqe0wzTwG8EAWsoq5MWsJis0iGMaYeOJCv1wHQHgY pisaLZSsszAdvaP/V2485yMttIM9WSeVp8NY/UnNYc2P0ZjY/TUrenxeu3uj21J0C4kQrY +JbwT3R7FDwJx2mk3gCqPAmBwHKIjUG5WeW4dZ1q67nygZfStTGyrSWeFAoMDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361104; 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=msJOQ2clXagAzcQmuP9w/c4Z3LbZntdtlXEMdeQW5N8=; b=U/w5ytBY0wJroYNnaLg+D1mFrMNVSOF6e934s8U9jNvUDQyXjbEoms6Qep4MrPGgVQ5x0D bFtr8WJSUJC+bzqcyMgO40SwKvisr5a9kqZzRhtw8C9eI/eWcW1Ca1w0e6M3kdEgfBXJwY j0ibLz/HAu1wu8LllKhKp4LbcNWo0GQiFAWqzQCzqelwXOYIlok//bmfTV5Fq5puHDBn+M BsNoDzUIT5LrQJ1dfS8ShnzrpqWY2IZU8FGY4dkcneWZdxcNGIypxP51MWWDivuMkL3OJK qbqTXT7PQSO3mHypqal9zMzGtzLU16EQ2t6L4goNsVmDb3fGzYRi8U2KGLHkkQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361104; a=rsa-sha256; cv=none; b=bMcz5ybAdqaD3jw0lXV8rtY4SqySXMekxv4fVXj0hKf0SgsyWE0rHylE7dtptVFHe25ebB gu7iz0YAqAoIcD80XObdce4Iv9YMFJjM1Mw2QzXQytYO2L7HzZE+3+X4LpF7PpSjdqGJ1O M+ZdZwczxxr0SnmgannSD9dL6HIKEHC1YEFTHn1/ciHow7zdONoJDNa44Du+wKqwtLzYXV IUOk4LE8VVlH3Ll9fiyiMgCLhlA9KVcG7h7LtLxXg9+wRfpC+GvPsZc9M5GnUUiEVSNJd9 sXJkxpaLTmYG1wiIJiS/irSJPbhKL0+NHwekQ7AMGGnXNzfW8vxkKt/aVk+A1Q== 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 4TdpL812vDzjfY; Mon, 19 Feb 2024 16:45:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41JGj4dD095101; Mon, 19 Feb 2024 16:45:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGj4wl095098; Mon, 19 Feb 2024 16:45:04 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:04 GMT Message-Id: <202402191645.41JGj4wl095098@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: b9b148609abd - stable/13 - arm64: Check if PSCI before calling SMCCC 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: b9b148609abde98b6cf4470f0486ec65137c7282 Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=b9b148609abde98b6cf4470f0486ec65137c7282 commit b9b148609abde98b6cf4470f0486ec65137c7282 Author: Andrew Turner AuthorDate: 2023-10-30 14:33:08 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 12:44:19 +0000 arm64: Check if PSCI before calling SMCCC As SMCCC depends on PSCI check if the latter is present before calling the former. This fixes an issue where we may call into SMCCC when there is no PSCI in the system causing a smccc_version assert to fail. Reported by: stevek Reviewed by: emaste, imp, stevek Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D42404 (cherry picked from commit 5a8417c78f9d51bf1103353bee348eaac83e86e5) --- sys/arm64/arm64/cpu_errata.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/arm64/arm64/cpu_errata.c b/sys/arm64/arm64/cpu_errata.c index fee22240bb0e..a03303d83044 100644 --- a/sys/arm64/arm64/cpu_errata.c +++ b/sys/arm64/arm64/cpu_errata.c @@ -40,6 +40,7 @@ #include +#include #include typedef void (cpu_quirk_install)(void); @@ -117,6 +118,9 @@ static struct cpu_quirks cpu_quirks[] = { static void install_psci_bp_hardening(void) { + /* SMCCC depends on PSCI. If PSCI is missing so is SMCCC */ + if (!psci_present) + return; if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_1) != SMCCC_RET_SUCCESS) return; @@ -140,6 +144,10 @@ install_ssbd_workaround(void) } } + /* SMCCC depends on PSCI. If PSCI is missing so is SMCCC */ + if (!psci_present) + return; + /* Enable the workaround on this CPU if it's enabled in the firmware */ if (smccc_arch_features(SMCCC_ARCH_WORKAROUND_2) != SMCCC_RET_SUCCESS) return;