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 0D5AAC25B77 for ; Tue, 21 May 2024 03:11:19 +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:From:References:CC:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hE3dFUwZBuQSI1LjC01jY6ELhvccBcvcFunO/P3YOPM=; b=tCjOqUhVynQf+L Jy2fazLPbosOhrpylqVHOUheT9jqvz3lYpvW2J7TUwfI9lfgD7fhhh+xhkNed/q65gbhqLUqu5fvD IdIyxK8NcWNMR+34SuNBNdlOKUtTxrZk6kgM0FhWAWHaTYr/LcA/WtVhnowDLr/N/dXJn8dQOaRv2 bZdGH7mCDTbGDs9PtJrG0sgmQWs7gkspixyRHE0eNFKP+So5fXJBVnO/e0r/1/1heDj5PX+KA+2Xb s62DUwxk4P3mxadL/8p8FI4n1hzy/UgYgs4pxf5MU7+B45uRxHHh4ZC0TlbAyQrDwKgn/hYhoYwWQ LDieq+JaYhTtaBFQ9voQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9FuB-0000000G9Qd-1Jtc; Tue, 21 May 2024 03:11:11 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9Fu7-0000000G9Pr-0ZK0 for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2024 03:11:09 +0000 Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Vjzr849rBz1S5rH; Tue, 21 May 2024 11:07:20 +0800 (CST) Received: from canpemm500002.china.huawei.com (unknown [7.192.104.244]) by mail.maildlp.com (Postfix) with ESMTPS id E576B1400DD; Tue, 21 May 2024 11:10:56 +0800 (CST) Received: from [10.174.179.211] (10.174.179.211) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 21 May 2024 11:10:56 +0800 Message-ID: Date: Tue, 21 May 2024 11:10:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] arm64: armv8_deprecated: Fix warning in isndep cpuhp starting process To: Will Deacon CC: Catalin Marinas , Joel Granados , Luis Chamberlain , , References: <20240423093501.3460764-1-liwei391@huawei.com> <20240430150638.GB14187@willie-the-truck> From: "liwei (GF)" In-Reply-To: <20240430150638.GB14187@willie-the-truck> X-Originating-IP: [10.174.179.211] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240520_201107_385273_F20D7CF9 X-CRM114-Status: GOOD ( 14.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: , 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 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, Wei _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel