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 40BD3C25B78 for ; Tue, 4 Jun 2024 15:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3WfLqC/tFGjeVkyRTuQuFPPYGChGN8vju8LEf6J2bAE=; b=4E24Mal42krgYy FffV/VUzepYCpcGQLfu8LH0Lq9TuP1MRMDmFy1wXtVoREgJCCX0Jv2j/tLnG73GfIflqg+/mE5rCA H2thgKeZYZNU7icYIda/jGdxEb/ixR6ANG0xgcURjioMqz/t36YgNyZnYwvVosmoux/1iZrJWVtsZ aCCO9OfFTi2zsLFKhVQuGAziUM1c54Qqhifrv9OMCZnFSln5B8MLme0HBnolTxRpS2jLqGGjhWtaq /PQA7Ta4cNaI3B/p8h1wYb4wyteQZGEKINS3voTURtPRYgiku7etQQSjtroJu+RwNJx8eahI4uTfV yMM3Px0aastfQK9LGJfg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEVt2-00000002syi-3JoM; Tue, 04 Jun 2024 15:15:44 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEVt0-00000002sxf-19Jd for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 15:15:43 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 643206125B; Tue, 4 Jun 2024 15:15:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE5A2C32786; Tue, 4 Jun 2024 15:15:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717514141; bh=0ReAxMgTO7yBXlAjNOR/pteWBG1jOtmTFgqN2XXNYYU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eYpnwOMvX1M2Y41e+iQQL1zf6Q6TOXBKHQgHX/jyBNleNPsGjYlR5/IZ5XehTSVsw 1BYBHqt+/0KOg5p0r1CSQlFpCeY+ANTVXt1MhmUpAh7rJ38TweUNUjRnP7GlqWD3/x lOGw3R/iQ38yR7AZtmAeSB+sF8ARtlvMax+nPILklg8TVMQNn1yhTVm3qr10gJmfsh 9j+IakzDnNj30jef+L4K/Od9DEeCag5xZkZ1C8lzJXLUZW54IX6oBHbnWmXj0bz11d eCBIAeii00VyGouXuKKy7r0tAiJmtSSGmYwu8d3xDcijaUJzaDXDDP0/qA3B4zWPHj L7xHlBTgCVrPQ== Date: Tue, 4 Jun 2024 16:15:36 +0100 From: Will Deacon To: "liwei (GF)" Cc: Catalin Marinas , Joel Granados , Luis Chamberlain , xiexiuqi@huawei.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] arm64: armv8_deprecated: Fix warning in isndep cpuhp starting process Message-ID: <20240604151535.GA20574@willie-the-truck> References: <20240423093501.3460764-1-liwei391@huawei.com> <20240430150638.GB14187@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_081542_399449_603CF651 X-CRM114-Status: GOOD ( 23.18 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, May 21, 2024 at 11:10:43AM +0800, liwei (GF) wrote: > > > On 2024/4/30 23:06, Will Deacon wrote: > > On Tue, Apr 23, 2024 at 05:35:01PM +0800, Wei Li wrote: > >> 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 > >> --- > >> 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 dd6ce86d4332..b776e7424fe9 100644 > >> --- a/arch/arm64/kernel/armv8_deprecated.c > >> +++ b/arch/arm64/kernel/armv8_deprecated.c > >> @@ -462,6 +462,9 @@ static int run_all_insn_set_hw_mode(unsigned int cpu) > >> for (int 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); > > > > Isn't this part of the warning useful, though? ^^^ > > > > Sorry I missed your replay, I think the warning here is unexpected. > > As far as setend is concerned, the 'INSN_UNAVAILABLE' state is marked in > armv8_deprecated_init(), with a prompt message, and skipped in following > register process too. So the warning here should be intended to indicate > the situation where set_hw_mode() should succeed. Thanks, I agree with you. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel