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 B8DF3C433F5 for ; Mon, 25 Apr 2022 15:06:45 +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: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=JwksC802VrqoV0q96DXWGX+KA9EZx3NPZuxyYkTHtUw=; b=mWA/mz17FuA6Gy cCsuT0DTRrR5JhxIdK5H1y29NB6a+D5FSSm6ZaCb3XYiIUBd3K2ik4SCvaZCE7b/d8RYoA/y/4D/F fLyhLW5sqcGQZncPdt7dI8i7y0ebVc13nZjsRgB2cWBh9QkL6hkKf1qQ79i6wiXaC+43z2aQK/fxU CDPTGYqMzly+1Ug2NZojfiLum+tDlZCquBoMv1X9nCYdFdiDF5AZdjnNsTDzonkCodSDz+aBKyojn UeNS6CeVCGo4Exm4InV2uIDNaqm0aRgAzMnKauw0NK9Wcf/DMPxEtQvFr8gCePQXQ0dL8JfbXyRtM 3hXKPH0rhIH0mW+C84Dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj0HC-00A2Q5-OG; Mon, 25 Apr 2022 15:05:22 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nj0H9-00A2Oo-PS for linux-arm-kernel@lists.infradead.org; Mon, 25 Apr 2022 15:05:21 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E007760AF1; Mon, 25 Apr 2022 15:05:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65958C385A4; Mon, 25 Apr 2022 15:05:14 +0000 (UTC) Date: Mon, 25 Apr 2022 11:05:12 -0400 From: Steven Rostedt To: Xu Kuohai Cc: , , , , , Catalin Marinas , Will Deacon , Ingo Molnar , Daniel Borkmann , Alexei Starovoitov , Zi Shen Lim , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , "David S . Miller" , Hideaki YOSHIFUJI , David Ahern , Thomas Gleixner , Borislav Petkov , Dave Hansen , , , Shuah Khan , Jakub Kicinski , Jesper Dangaard Brouer , Mark Rutland , Pasha Tatashin , Ard Biesheuvel , Daniel Kiss , Steven Price , Sudeep Holla , Marc Zyngier , Peter Collingbourne , Mark Brown , Delyan Kratunov , Kumar Kartikeya Dwivedi Subject: Re: [PATCH bpf-next v3 2/7] ftrace: Fix deadloop caused by direct call in ftrace selftest Message-ID: <20220425110512.538ce0bf@gandalf.local.home> In-Reply-To: <20220424154028.1698685-3-xukuohai@huawei.com> References: <20220424154028.1698685-1-xukuohai@huawei.com> <20220424154028.1698685-3-xukuohai@huawei.com> 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-20220425_080519_908150_5A385ED1 X-CRM114-Status: GOOD ( 17.33 ) 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 Sun, 24 Apr 2022 11:40:23 -0400 Xu Kuohai wrote: > diff --git a/kernel/trace/trace_selftest.c b/kernel/trace/trace_selftest.c > index abcadbe933bb..d2eff2b1d743 100644 > --- a/kernel/trace/trace_selftest.c > +++ b/kernel/trace/trace_selftest.c > @@ -785,8 +785,24 @@ static struct fgraph_ops fgraph_ops __initdata = { > }; > > #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS > +#ifdef CONFIG_ARM64 Please find a way to add this in arm specific code. Do not add architecture defines in generic code. You could add: #ifndef ARCH_HAVE_FTRACE_DIRECT_TEST_FUNC noinline __noclone static void trace_direct_tramp(void) { } #endif here, and in arch/arm64/include/ftrace.h #define ARCH_HAVE_FTRACE_DIRECT_TEST_FUNC and define your test function in the arm64 specific code. -- Steve > +extern void trace_direct_tramp(void); > + > +asm ( > +" .pushsection .text, \"ax\", @progbits\n" > +" .type trace_direct_tramp, %function\n" > +" .global trace_direct_tramp\n" > +"trace_direct_tramp:" > +" mov x10, x30\n" > +" mov x30, x9\n" > +" ret x10\n" > +" .size trace_direct_tramp, .-trace_direct_tramp\n" > +" .popsection\n" > +); > +#else > noinline __noclone static void trace_direct_tramp(void) { } > #endif > +#endif > > /* > * Pretty much the same than for the function tracer from which the selftest _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel