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 X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D709FC433DB for ; Wed, 3 Mar 2021 17:07:30 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAD7264E25 for ; Wed, 3 Mar 2021 17:07:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAD7264E25 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=goodmis.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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=rkm2b4uzE9Cui8BYxHxYuyQca0YFmGzNyt8Mr6x/UDc=; b=BbiTJw+UrKDICuqQ+N6w1goBY 7k6tV00UCt+EhXJ908m62Pe2wQZDTDGbo3LakBl4bDfFx9PHW6GhOUS0iGx81F5DpmEEo2zmB26Px OVYA5rbaV/uiVdJCyny0ajdAEn3swCmGSeLhzOE+JFsGV2RjJdqDJOD8EE4ej5zsUFs1t7Ti62QCv 1gqrEXOlX7Wbea8lA3SbhgWpOixWPhCpJh79xjZNozNNInv7FhOjmrnh5lM6HdPMusCdmZEr+eZHO WdrhdAvVMekKekKrWWgpV47C5N/gpHLMxJztB0aZPSWU7xW33AHqYzM/LIQfxdECd35HlnDxgtPfV eqP8tQDpw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lHUw3-005ivs-0g; Wed, 03 Mar 2021 17:05:19 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHSsY-005EnC-1w for linux-arm-kernel@desiato.infradead.org; Wed, 03 Mar 2021 14:53:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description; bh=WJomYe9q/10Mx53PCMuCZdSKAygZekgXffJio5/vb9M=; b=pkG4o2/X6yR+SUcCZ0IGolCJIE CRXpWjQKBFefpuoMDUazmRPRIC8ZHYahYWKMbzvZXSljwTWGHT93hWNMLO/WXPQtgG9sLfHWpXgvs cVBYBq+P84n+b3nKpp7eu0XJma+lDUSVq02OVaxmIglN2dyt1Esw0ZcQVuHNuQ5IE89Mp4BB01Bjp /D20O84KErCr0Lhr2kvBSJesrg6wXEfIvkde48LDM2Ob9l7vLPqhRVJ1JllMJMrLJ0Jg38l0xMGOo U1Wh00zSNNsbMkuB3PSBRaEr/FXkZA8F1Rm0gGXvV8NudbGH9PKoJLBDbwOzN0XPdS7xtCSN15GVq Jaw+kVxA==; Received: from mail.kernel.org ([198.145.29.99]) by casper.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lHDaH-000WKR-U2 for linux-arm-kernel@lists.infradead.org; Tue, 02 Mar 2021 22:33:42 +0000 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA84464F2D; Tue, 2 Mar 2021 22:33:36 +0000 (UTC) Date: Tue, 2 Mar 2021 17:33:35 -0500 From: Steven Rostedt To: Will Deacon Cc: Li Huafei , gregory.herrero@oracle.com, catalin.marinas@arm.com, christophe.leroy@csgroup.eu, linux-kernel@vger.kernel.org, zhangjinhao2@huawei.com, yangjihong1@huawei.com, xukuohai@huawei.com, linux-arm-kernel@lists.infradead.org, Chen Jun Subject: Re: [PATCH] recordmcount: Fix the wrong use of w* in arm64_is_fake_mcount() Message-ID: <20210302173335.71eded37@gandalf.local.home> In-Reply-To: <20210302173058.28fd3d36@gandalf.local.home> References: <20210225140747.10818-1-lihuafei1@huawei.com> <20210225094426.7729b9cc@gandalf.local.home> <20210225160116.GA13604@willie-the-truck> <20210302173058.28fd3d36@gandalf.local.home> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210302_223342_401637_0AAFF90A X-CRM114-Status: GOOD ( 16.60 ) 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, 2 Mar 2021 17:30:58 -0500 Steven Rostedt wrote: > I just realized that I received this patch twice, and thought it was the > same patch! Chen was three days ahead of you, so he get's the credit ;-) > > https://lore.kernel.org/r/20210222135840.56250-1-chenjun102@huawei.com I'm applying this patch (same one here but came earlier). Will, you still OK with your acked-by on it? -- Steve >From 999340d51174ce4141dd723105d4cef872b13ee9 Mon Sep 17 00:00:00 2001 From: Chen Jun Date: Mon, 22 Feb 2021 13:58:40 +0000 Subject: [PATCH] ftrace: Have recordmcount use w8 to read relp->r_info in arm64_is_fake_mcount On little endian system, Use aarch64_be(gcc v7.3) downloaded from linaro.org to build image with CONFIG_CPU_BIG_ENDIAN = y, CONFIG_FTRACE = y, CONFIG_DYNAMIC_FTRACE = y. gcc will create symbols of _mcount but recordmcount can not create mcount_loc for *.o. aarch64_be-linux-gnu-objdump -r fs/namei.o | grep mcount 00000000000000d0 R_AARCH64_CALL26 _mcount ... 0000000000007190 R_AARCH64_CALL26 _mcount The reason is than funciton arm64_is_fake_mcount can not work correctly. A symbol of _mcount in *.o compiled with big endian compiler likes: 00 00 00 2d 00 00 01 1b w(rp->r_info) will return 0x2d instead of 0x011b. Because w() takes uint32_t as parameter, which truncates rp->r_info. Use w8() instead w() to read relp->r_info Link: https://lkml.kernel.org/r/20210222135840.56250-1-chenjun102@huawei.com Fixes: ea0eada45632 ("recordmcount: only record relocation of type R_AARCH64_CALL26 on arm64.") Acked-by: Will Deacon Signed-off-by: Chen Jun Signed-off-by: Steven Rostedt (VMware) --- scripts/recordmcount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index b9c2ee7ab43f..cce12e1971d8 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c @@ -438,7 +438,7 @@ static int arm_is_fake_mcount(Elf32_Rel const *rp) static int arm64_is_fake_mcount(Elf64_Rel const *rp) { - return ELF64_R_TYPE(w(rp->r_info)) != R_AARCH64_CALL26; + return ELF64_R_TYPE(w8(rp->r_info)) != R_AARCH64_CALL26; } /* 64-bit EM_MIPS has weird ELF64_Rela.r_info. -- 2.25.4 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel