Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2745265rwb; Fri, 16 Dec 2022 06:06:45 -0800 (PST) X-Google-Smtp-Source: AMrXdXserXLjd19RjF5o0T3y6hXIjYwrSY0wio3qWDmTe8TlKblkuXuLImpp1Ahn+s9lli4updeV X-Received: by 2002:a17:906:1444:b0:7c3:15cc:76d0 with SMTP id q4-20020a170906144400b007c315cc76d0mr1202613ejc.47.1671199605668; Fri, 16 Dec 2022 06:06:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671199605; cv=none; d=google.com; s=arc-20160816; b=G/DZZBipExiupMEeETwbGqKV4ap+hjNOSERmc/tYDcTPoMHp/zeaXlgC30ZnHm4JMC TL5FUyq8nIWWXcBSVOjfF8D2GNP3o6fsbg/OH6aBYF9B88S4wQVBY8yVTn20N0WU/APk 00Osg8e1z8VmuDdzQs+pE5668A6lNmQ3iabzR94ZOnwV0vVzDugfrA4LG4rdFjxq5+5u ahPCv8lAXKs9VDaBnyd6c7xZP63GQsq6lmerRQe7d+xhyUxqN6hDy31COItAbX9pNtN5 v/CAP1bKC24Grnbvxu2owNkt9zS6l8EDCjCIvFR7rWWGQGq4i9ngjoPwiSqS/qgTpvCm EZYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=T/v+uXFE7rTQwiAiD34XNbSgS3pReycleLobepzrmWs=; b=BVnyeS49UvxisQ7Ff9AlyE0ceyN9v7ai2+UsMrCrzp9H+Zu7tKeSWxkFqT1wC3ntAu nZ7umHw0wmaNfCJr4Te8Kbuta7b8fBHsJvc1VopmW6aslOcDig5wCEziO9BjgEFuv1wZ jweBedaBSIxiUDcs7b+IN8LQdtkLmtZIXYWKUyf5MKBX2S1Kor/R14wfs8tRVwMn2Jps IFZlnSTvR4i3VRXelQP24vEMbh1wfA2x5KK/ht5EIKY0SJm2z+h1uh2NGcpTptgKOlxu MeQL7195oMwH1OLTPXu8VaYxppdJae12rgImrsIZZiroLnNotVXGFrh4/+5UtZA8aM7f fEdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb32-20020a1709077ea000b0078db6f488cesi2660446ejc.112.2022.12.16.06.06.25; Fri, 16 Dec 2022 06:06:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbiLPNbN (ORCPT + 68 others); Fri, 16 Dec 2022 08:31:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230103AbiLPNbK (ORCPT ); Fri, 16 Dec 2022 08:31:10 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11114EE0D; Fri, 16 Dec 2022 05:31:08 -0800 (PST) Received: from dggpemm500006.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NYVHp5R52zqTB8; Fri, 16 Dec 2022 21:26:46 +0800 (CST) Received: from [10.174.178.55] (10.174.178.55) by dggpemm500006.china.huawei.com (7.185.36.236) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Fri, 16 Dec 2022 21:31:05 +0800 Subject: Re: [PATCH v9] kallsyms: Add self-test facility To: Andreas Schwab CC: Geert Uytterhoeven , Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Petr Mladek , Joe Lawrence , , , Masahiro Yamada , Alexei Starovoitov , Jiri Olsa , Kees Cook , Andrew Morton , Luis Chamberlain , , Steven Rostedt , Ingo Molnar , David Laight , linux-m68k , "Jason A. Donenfeld" References: <20221115083349.1662-1-thunder.leizhen@huawei.com> <49070ac3-02bb-a3b3-b929-ede07e3b2c95@huawei.com> <4aaede14-8bd3-6071-f17b-7efcb5f0de42@huawei.com> <66ec4021-b633-09ba-73ee-b24cdb3fa25a@huawei.com> <87h6xvk1dc.fsf@igel.home> From: "Leizhen (ThunderTown)" Message-ID: <1739960e-7f95-88ef-9b91-31c7504bb7fd@huawei.com> Date: Fri, 16 Dec 2022 21:31:04 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <87h6xvk1dc.fsf@igel.home> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.55] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm500006.china.huawei.com (7.185.36.236) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/12/16 19:57, Andreas Schwab wrote: > On Dez 16 2022, Leizhen (ThunderTown) wrote: > >> It seems that the problem is still strcmp(). After I commented strcmp() in >> arch/m68k/include/asm/string.h, and force it to use the one in lib/string.c, >> it works well. > > Does that help? It still needs to add 'volatile' to prevent compiler optimizations. Otherwise, Tested-by: Zhen Lei > > diff --git a/arch/m68k/include/asm/string.h b/arch/m68k/include/asm/string.h > index f759d944c449..cdafd67774e0 100644 > --- a/arch/m68k/include/asm/string.h > +++ b/arch/m68k/include/asm/string.h > @@ -42,18 +42,19 @@ static inline char *strncpy(char *dest, const char *src, size_t n) > #define __HAVE_ARCH_STRCMP > static inline int strcmp(const char *cs, const char *ct) > { > - char res; > + int res = 0, tmp = 0; > > asm ("\n" - asm ("\n" + asm volatile ("\n" > "1: move.b (%0)+,%2\n" /* get *cs */ > - " cmp.b (%1)+,%2\n" /* compare a byte */ > + " move.b (%1)+,%3\n" /* get *ct */ > + " cmp.b %3,%2\n" /* compare a byte */ > " jne 2f\n" /* not equal, break out */ > " tst.b %2\n" /* at end of cs? */ > " jne 1b\n" /* no, keep going */ > " jra 3f\n" /* strings are equal */ > - "2: sub.b -(%1),%2\n" /* *cs - *ct */ > + "2: sub.l %3,%2\n" /* *cs - *ct */ > "3:" > - : "+a" (cs), "+a" (ct), "=d" (res)); > + : "+a" (cs), "+a" (ct), "+d" (res), "+d" (tmp)); > return res; > } > #endif /* CONFIG_COLDFIRE */ > -- Regards, Zhen Lei