From nobody Mon Feb 19 16:45:26 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 4TdpLZ3WHZz5C9JD; Mon, 19 Feb 2024 16:45:26 +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 4TdpLZ1lcbz4c4L; Mon, 19 Feb 2024 16:45:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361126; 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=upi38Ep4yrZTPQGBcUwE2TVnjHxo1P2IXM9M8KYtGDk=; b=abY/+P91pdCk8+akT082RmK3XjBFktPg+GXS+hZD8kyK+q4U5D8SlJ1l9n5G3Bchx5+stx D9Pcclxq9NUJ9ZQG0XaIcO36DSMpYJrPYcmUkMZfYI4m8kQB5DLXjQMSBqVKAicWfRUlib zU0zC7cEvBVrbYu0M5eUPn/OpLL94BtfknMb4IkOdkLlDFGnbCUlLTo7HhRqaWw6t7fsxI voM3s39EzUIbrEpFwZFIx3bT4bySToQ5+93Yr+ZcY9tkaxlG2C2Qj5Qy7VvCvpxyAZ18GO tGBgSr2cC96mc7WfQXDVdVWxkC4jKd7BinkKdBXkq0WoagEf51VxBkMG887cNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708361126; 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=upi38Ep4yrZTPQGBcUwE2TVnjHxo1P2IXM9M8KYtGDk=; b=Dxp0FtI4caXrOws5K01eMSS7vOEuD7u+YmRyP5WlI/POC2yu5K5FUcDmvHKpmbvsrMJL7n wU/lSMsZFisfgCB7LOE2ECAfNSoUrzlm75OgwdF3XmU+9b9CFcVpWLgEnGrwQSGs67CRsV cI8YhvL4egferQgZwLzRt/sXzveCNKQJXexROnk61w8HkFrR3++JmucTR4FEtzJMXlPaOG MCGp84oXmRDyeIFr2HeE38trFyYoVO4+rbEnizX/InwaoysH4kHB7WkOKAN6wLVuUctQcl xkI7j4CVvc+gfCAO2s7v3kmE+TgQLO0WR0as5EtPNuAX61Zp4vZa8hK3zkEktg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708361126; a=rsa-sha256; cv=none; b=y3Gx4iM5vNaXZXG6Fv6huVP0dcIe3iWuzXOa8zPFWKSG08yN7jXZHIy5Yci77K5VRzNPAu v2IWnAnQtIbsQDh4wwBCH2wSYyxFqU75BSJMdIqUiYm0QqeyGcoeBSvu4+I1GKxBk6ppXg ik5t4nHLYfn/Qh+muSTbwq9IYDOQDKgXGw4Bshz770y3woSYcOoSTUOqchE7NNwmL+EPL+ OZOa88hQVwo5PeB3v/9kDEYxaMoRx3pvoyNparfU236FsEfN+H4Qop1WCK0wbg/klFRGzR oc9hz5dbsrJO+wZ0QmYQMTB8X8XlBvgY4FROWmIxZKzKy08FY+0ot65SIWrQBw== 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 4TdpLZ0sf9zjDR; Mon, 19 Feb 2024 16:45:26 +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 41JGjQ7i096374; Mon, 19 Feb 2024 16:45:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41JGjQFE096371; Mon, 19 Feb 2024 16:45:26 GMT (envelope-from git) Date: Mon, 19 Feb 2024 16:45:26 GMT Message-Id: <202402191645.41JGjQFE096371@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: eaa247c7f3df - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: eaa247c7f3dfe36cfe6a251019d416b418659cde Auto-Submitted: auto-generated The branch stable/14 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=eaa247c7f3dfe36cfe6a251019d416b418659cde commit eaa247c7f3dfe36cfe6a251019d416b418659cde Author: Andrew Turner AuthorDate: 2023-10-30 14:33:08 +0000 Commit: Andrew Turner CommitDate: 2024-02-19 13:14:10 +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;