Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1188224rwb; Thu, 22 Sep 2022 11:16:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7stHmWZ7h/FQz1kFFGbmbl+lxjRbNqNAtzNSkBjR4+uI9NdUR5jEw6UI0PSRo6fH1jObAK X-Received: by 2002:a63:2a08:0:b0:439:36bc:6320 with SMTP id q8-20020a632a08000000b0043936bc6320mr4068821pgq.43.1663870580683; Thu, 22 Sep 2022 11:16:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663870580; cv=none; d=google.com; s=arc-20160816; b=pRazyq+teg6+uR7wg/oz1lohUIdXVb1mz1GmgrfTCniSRzizbL9rKXLCJ1F0bxvfxr EJhZfIq7kcnivWl1crNUIX/PsZRcRxYadgLAPf4OZlirl8QXxIGOeHeMz7U5p2yyRgLY mBZxDzqpzNchQvQNX8L5vjZUzAg4cWVzzLhkdRymfWDgNry4y+4V6TQlTldRrpdpnQwu DaPCiuFmSLiNlKppEbzzgefNWoGIAPvy8yrWkmP8Y9395PTL8YDw5i1wMKSBm+LUKlzG slmnsO8fv2qyJd0UyAFZD8aXy8/aTvZntfXFWN8GRPqe/0GyC82/6MdvBC0zD7kNRAbF fzpA== 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=mDzmtz+8chdGXh8cQASyERMxQuIl5B3hXko8H7yq4vw=; b=VQqcHtkAMewBObM3hnfElZe977ah6O07s7oruliEEr3iJu5xjHcIPEwK9Mq9IA34+5 +QBxPNsNrKi5lHdzqlWgtpntriRrHNhDDOrbHxA2erMtMzaXUrFPfOYUk+Pg79y11hQF h/7TfMlRn8X3tT8GTvCHaeL/8o/8b5G+N239KQoV8Fe9+A65uUPU4SBX2Gg5ubj6NPIE W4/jjZFndRdhPH40titjtxIpEvFYnSQ0xgpWYwdanUIqJPT99sAfWZAWnF3Wn0KemqKQ K2UqMG6Lmcv7MiuxgCraNpJMLxsk7UwuJiAI5QHRWbQynO/wYi+TF0LZOQ+7sIIOGYpM Oyeg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h15-20020a62830f000000b0053b5a4cfd4dsi6709149pfe.69.2022.09.22.11.16.08; Thu, 22 Sep 2022 11:16:20 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232416AbiIVSCb (ORCPT + 99 others); Thu, 22 Sep 2022 14:02:31 -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) X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,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 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