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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 944B9ECAAD8 for ; Thu, 22 Sep 2022 18:02:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232418AbiIVSCc (ORCPT ); Thu, 22 Sep 2022 14:02:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232173AbiIVSBj (ORCPT ); Thu, 22 Sep 2022 14:01:39 -0400 Received: from www62.your-server.de (www62.your-server.de [213.133.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B26B0DE87; Thu, 22 Sep 2022 11:01:34 -0700 (PDT) Received: from sslproxy05.your-server.de ([78.46.172.2]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1obQVj-0004Vk-0x; Thu, 22 Sep 2022 20:01:19 +0200 Received: from [85.1.206.226] (helo=linux.home) by sslproxy05.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1obQVi-000Ov5-9d; Thu, 22 Sep 2022 20:01:18 +0200 Subject: Re: [PATCH bpf-next v2 0/4] Add ftrace direct call for arm64 To: Xu Kuohai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Cc: Mark Rutland , Florent Revest , Catalin Marinas , Will Deacon , Jean-Philippe Brucker , Steven Rostedt , Ingo Molnar , Oleg Nesterov , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Zi Shen Lim , Pasha Tatashin , Ard Biesheuvel , Marc Zyngier , Guo Ren , Masami Hiramatsu References: <20220913162732.163631-1-xukuohai@huaweicloud.com> From: Daniel Borkmann Message-ID: Date: Thu, 22 Sep 2022 20:01:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20220913162732.163631-1-xukuohai@huaweicloud.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.6/26666/Thu Sep 22 09:54:12 2022) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/13/22 6:27 PM, Xu Kuohai wrote: > This series adds ftrace direct call for arm64, which is required to attach > bpf trampoline to fentry. > > Although there is no agreement on how to support ftrace direct call on arm64, > no patch has been posted except the one I posted in [1], so this series > continues the work of [1] with the addition of long jump support. Now ftrace > direct call works regardless of the distance between the callsite and custom > trampoline. > > [1] https://lore.kernel.org/bpf/20220518131638.3401509-2-xukuohai@huawei.com/ > > v2: > - Fix compile and runtime errors caused by ftrace_rec_arch_init > > v1: https://lore.kernel.org/bpf/20220913063146.74750-1-xukuohai@huaweicloud.com/ > > Xu Kuohai (4): > ftrace: Allow users to disable ftrace direct call > arm64: ftrace: Support long jump for ftrace direct call > arm64: ftrace: Add ftrace direct call support > ftrace: Fix dead loop caused by direct call in ftrace selftest Given there's just a tiny fraction touching BPF JIT and most are around core arm64, it probably makes sense that this series goes via Catalin/Will through arm64 tree instead of bpf-next if it looks good to them. Catalin/Will, thoughts (Ack + bpf-next could work too, but I'd presume this just results in merge conflicts)? > arch/arm64/Kconfig | 2 + > arch/arm64/Makefile | 4 + > arch/arm64/include/asm/ftrace.h | 35 ++++-- > arch/arm64/include/asm/patching.h | 2 + > arch/arm64/include/asm/ptrace.h | 6 +- > arch/arm64/kernel/asm-offsets.c | 1 + > arch/arm64/kernel/entry-ftrace.S | 39 ++++-- > arch/arm64/kernel/ftrace.c | 198 ++++++++++++++++++++++++++++-- > arch/arm64/kernel/patching.c | 14 +++ > arch/arm64/net/bpf_jit_comp.c | 4 + > include/linux/ftrace.h | 2 + > kernel/trace/Kconfig | 7 +- > kernel/trace/ftrace.c | 9 +- > kernel/trace/trace_selftest.c | 2 + > 14 files changed, 296 insertions(+), 29 deletions(-) Thanks, Daniel