Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp267241rwb; Mon, 26 Sep 2022 12:04:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6oUKvnvPsRA78AGkShaj7kXZplnu/IPSS3liXFUd35cQU0XH2uzsZulgMwNfvoWwqgqQpY X-Received: by 2002:a63:8b4b:0:b0:43c:afc0:b72a with SMTP id j72-20020a638b4b000000b0043cafc0b72amr6830328pge.50.1664219068727; Mon, 26 Sep 2022 12:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664219068; cv=none; d=google.com; s=arc-20160816; b=XD4sjr6sVJ1NBg74LW+1ZpFtShfEb8cFq0l+Z6r+b4CwvBtQa0wvpZLVVJGL+8j9YB KhHlM6Fi56SxsbclWmOnGqGLXkI6VbWrq2c6axNczmnBqMTVpblMcfqZL4mHkfQUQoR8 z/32GDBdQ85PTyLqKpOCtR5AO5wzRe/Iql5SJwrRXtPuB40NsqRnCM4YBij9jvFMTDhO izklxS/p72JHhM5OlEUDmohbtysco1u+AIUl45pdO4sUsKD/lbh3+axJeMtrL8crxaXp 1N36BoF9nK8tXVgcJNqq79x4A6owrKraBVSEqEtP90ABXLws1CmaoBbRHhif7cHgVDvv NrCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=8dwEw+sGvjxwq3mxVDhw2FYDr5WRTWss+TJJmPRKuOU=; b=sUh2MpxgEKLQWj4bLgSvPJjPJ4YtwtCGxXL+B4m1kX9a8jnS6SzKUHU1xY+qkKK1kJ Y8e0ZoXxltM3VDaGxZjbyEyfdAzGxCKOFQfmyGnzi9MrjIaKF15Pd5v47UDZueRymWBm qHVMLsaklI7v+jUufauAX4OfOW4s7VvtDSuVNEwNFmYwMLS26Il5EVxxqSf4Cg0VGdIm SdTFYwcq2uzuQK/CAA0Rh+xzrdZL4qhEZ9KPENiFYtpJuQN3VEU81oSJNfc2dRtxkPB5 2tv8h2+Poc6WJ0FB+plKDP7wzxUA1LV8jPYbcM3jwRN/ptAHmqv4dgwH3oA7pXo8rhMz OnjQ== 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=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a170902eb8100b001755f43df36si12647220plg.479.2022.09.26.12.04.14; Mon, 26 Sep 2022 12:04:28 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbiIZSD5 (ORCPT + 99 others); Mon, 26 Sep 2022 14:03:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbiIZSDI (ORCPT ); Mon, 26 Sep 2022 14:03:08 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3133CDF7A; Mon, 26 Sep 2022 10:44:02 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4F7921CE2; Mon, 26 Sep 2022 10:44:08 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.81.104]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9DA163F73B; Mon, 26 Sep 2022 10:43:57 -0700 (PDT) Date: Mon, 26 Sep 2022 18:43:51 +0100 From: Mark Rutland To: Catalin Marinas Cc: Daniel Borkmann , Xu Kuohai , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Florent Revest , 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 Subject: Re: [PATCH bpf-next v2 0/4] Add ftrace direct call for arm64 Message-ID: References: <20220913162732.163631-1-xukuohai@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE 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 Mon, Sep 26, 2022 at 03:40:20PM +0100, Catalin Marinas wrote: > On Thu, Sep 22, 2022 at 08:01:16PM +0200, Daniel Borkmann wrote: > > 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)? > > I think it makes sense for the series to go via the arm64 tree but I'd > like Mark to have a look at the ftrace changes first. From a quick scan, I still don't think this is quite right, and as it stands I believe this will break backtracing (as the instructions before the function entry point will not be symbolized correctly, getting in the way of RELIABLE_STACKTRACE). I think I was insufficiently clear with my earlier feedback there, as I have a mechanism in mind that wa a little simpler. I'll try to reply with some more detail tomorrow, but I don't think this is the right approach, and as mentioned previously (and e.g. at LPC) I'd strongly prefer to *not* implement direct calls, so that we can have more consistent entry/exit handling. Thanks, Mark.