From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF0B7C27C4F for ; Tue, 18 Jun 2024 12:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pe+diZo2R3U4x+j12m/F3q6o65jk8JIR1fU2/BBkx3Q=; b=FGY1qSnvJN19W19rw6lf/OyVo9 dEQUcWDexipAjJnHd8/aJpW4gVuTvzOXVVLz9TRcpo+9DBqizZnPn+oGp779f9XRCryW1iO3k3Mks NcCQYVU8DdQQlF+gTQhZjb3b5U90j4WE45CGTY9Wh1BDnXCPQRZovV3YPMzvDV2N4pg3k5roMzV/j 4Pq1zpnOxL+7Y0Ng3yGRYcoIh+CgD5LJh2MrNPGedOmpAMbwWvCofYivesKx3t7PQIAUOxryerXpH D2E3X3cBRvLNzArGSK7j4kkRBsVflKWMO/1mAPebt27ammSEGFlVrVENXMI9Bo5DSSVCkMwd8rBgl M68JpgeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJYAo-0000000Evnj-14gs; Tue, 18 Jun 2024 12:42:54 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJYAl-0000000Evmw-3j6P for linux-arm-kernel@lists.infradead.org; Tue, 18 Jun 2024 12:42:53 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 08A5E618E2; Tue, 18 Jun 2024 12:42:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B559C3277B; Tue, 18 Jun 2024 12:42:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718714570; bh=Dd6pY7xPJEu5e/X4E+ynYc0y6ur0lmwjdRCXfrc2LsU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LxZjxZSyowyDns7M5DPl5T5quF50sV2lD45WpXNPjRJiGETdaeIszS32TxBO0HncJ hv92feMKtHLyWVpq2M6q/DuVL2nNzBElCMOYhZ6fJkVfgp0ZdrQCWj1vg+oXZ2vzei nxQyTkrm22pc+vpfVtoxbKTUbixHMmuRtAVVmcN/J3jpYD07yO6H1lOsGW2dQSg3Ki L/3AUb+29hILHcV60I2mEgxglse1O/P+r76kpwuO3pAFrK6/WjsSOWaGV7GYZ2idjf 1LlLxeGEqqR5ZJYxDo1F/kC5W5obZWh0y0GqTpaDuKJXloCTl2US75Qt05Rn2RpbQz G+rGmm8VnN24A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wei Li , Huisong Li , Will Deacon , Sasha Levin , catalin.marinas@arm.com, j.granados@samsung.com, mcgrof@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.10 10/13] arm64: armv8_deprecated: Fix warning in isndep cpuhp starting process Date: Tue, 18 Jun 2024 08:42:21 -0400 Message-ID: <20240618124231.3304308-10-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240618124231.3304308-1-sashal@kernel.org> References: <20240618124231.3304308-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.10.219 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240618_054252_166226_663F5201 X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Wei Li [ Upstream commit 14951beaec93696b092a906baa0f29322cf34004 ] The function run_all_insn_set_hw_mode() is registered as startup callback of 'CPUHP_AP_ARM64_ISNDEP_STARTING', it invokes set_hw_mode() methods of all emulated instructions. As the STARTING callbacks are not expected to fail, if one of the set_hw_mode() fails, e.g. due to el0 mixed-endian is not supported for 'setend', it will report a warning: ``` CPU[2] cannot support the emulation of setend CPU 2 UP state arm64/isndep:starting (136) failed (-22) CPU2: Booted secondary processor 0x0000000002 [0x414fd0c1] ``` To fix it, add a check for INSN_UNAVAILABLE status and skip the process. Signed-off-by: Wei Li Tested-by: Huisong Li Link: https://lore.kernel.org/r/20240423093501.3460764-1-liwei391@huawei.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/kernel/armv8_deprecated.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/kernel/armv8_deprecated.c b/arch/arm64/kernel/armv8_deprecated.c index f0ba854f0045e..34370be75acd5 100644 --- a/arch/arm64/kernel/armv8_deprecated.c +++ b/arch/arm64/kernel/armv8_deprecated.c @@ -471,6 +471,9 @@ static int run_all_insn_set_hw_mode(unsigned int cpu) for (i = 0; i < ARRAY_SIZE(insn_emulations); i++) { struct insn_emulation *insn = insn_emulations[i]; bool enable = READ_ONCE(insn->current_mode) == INSN_HW; + if (insn->status == INSN_UNAVAILABLE) + continue; + if (insn->set_hw_mode && insn->set_hw_mode(enable)) { pr_warn("CPU[%u] cannot support the emulation of %s", cpu, insn->name); -- 2.43.0