Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2057911ioo; Mon, 23 May 2022 09:10:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJze7ifK/Y2lhgEKAT30XrTub+Z1PRB2sF3EgPUBOE3yODGyHqKx8jae1CrBrDXlyniBpT+q X-Received: by 2002:a17:90b:3e8b:b0:1e0:582d:fc23 with SMTP id rj11-20020a17090b3e8b00b001e0582dfc23mr4561023pjb.228.1653322208834; Mon, 23 May 2022 09:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653322208; cv=none; d=google.com; s=arc-20160816; b=dM/ohiwZr7aVdVPzxG8WF8XQQ5/Z+fOtqRbw8sKt9zB/jtivHzOV0YmiVVV3+a49i7 MAYeY/ztIqgPTaNBzSUq/2yy31qsycfCHCpCHPDGRijhboLeJW/PWsF9M5iqAR+fkCqe VFXKlH58OJHwIZQC8OkSVRhGHqNnOzyyY9UggQWyBY0eFEdg14Kw3B5RNzDHrV3Rpft4 mDsYu2C80ysOI/LAwozpXa+ab0e4wjimEqgyL6ReHCqxSsEly94ubdwZJm8FSKbhuYq3 n+ASiCWIFh8tV5hYYBOeWDpJ1B8HGkaHp8uEJQe9kefyRNXDVK/EFH/46ZL2S6cPHdr+ wKtg== 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=PfS8NIcOlfv5TBRVEG4wNVodnKURbMVbwBcHpK+gzGs=; b=aq0ZeiSmDQudBb9rE+xGfe2XfQu09NqwBXY/EksOrJtGbDKc5+bzJIC9x5UphPXEl2 w01LFGRSWPtCqSvYbtz2T/wWjxQm5luMXByzqHsJ4QK8IbrJnZpS7FXA0KZNV/73iROC MBf5GBiZH5qUNi0j7zBP1SdUXDU4lvc6Ho8+kD5gBN28Jyxe9h+0ihI92UMWNnk03Zh7 kkB5lEvka8HFk43NCnH/7Rp0ORYXKS75RFnB/9SCPLl0RtFRqZPgoPoCEp62c8eHtg0L HraJvZdR/nwlfeHajKYfDVJoxBNmiyWicI9ncqlXdA63xJMX1FPYhnHUONBk7QcwMCKC FcOA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p17-20020a170902e75100b001616377802csi10999796plf.88.2022.05.23.09.10.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 09:10:08 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7969F64726; Mon, 23 May 2022 09:10:06 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238567AbiEWQJy (ORCPT + 99 others); Mon, 23 May 2022 12:09:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238408AbiEWQJv (ORCPT ); Mon, 23 May 2022 12:09:51 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F0D06470D; Mon, 23 May 2022 09:09:50 -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 28883139F; Mon, 23 May 2022 09:09:50 -0700 (PDT) Received: from FVFF77S0Q05N (unknown [10.57.9.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 055253F73D; Mon, 23 May 2022 09:09:43 -0700 (PDT) Date: Mon, 23 May 2022 17:09:39 +0100 From: Mark Rutland To: Alexei Starovoitov Cc: Xu Kuohai , bpf , linux-arm-kernel , LKML , Network Development , "open list:KERNEL SELFTEST FRAMEWORK" , Catalin Marinas , Will Deacon , Steven Rostedt , 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 , X86 ML , "H. Peter Anvin" , Shuah Khan , Jakub Kicinski , Jesper Dangaard Brouer , 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 v5 5/6] bpf, arm64: bpf trampoline for arm64 Message-ID: References: <20220518131638.3401509-1-xukuohai@huawei.com> <20220518131638.3401509-6-xukuohai@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Fri, May 20, 2022 at 02:18:20PM -0700, Alexei Starovoitov wrote: > On Wed, May 18, 2022 at 6:54 AM Xu Kuohai wrote: > > > > Add bpf trampoline support for arm64. Most of the logic is the same as > > x86. > > > > Tested on raspberry pi 4b and qemu with KASLR disabled (avoid long jump), > > result: > > #9 /1 bpf_cookie/kprobe:OK > > #9 /2 bpf_cookie/multi_kprobe_link_api:FAIL > > #9 /3 bpf_cookie/multi_kprobe_attach_api:FAIL > > #9 /4 bpf_cookie/uprobe:OK > > #9 /5 bpf_cookie/tracepoint:OK > > #9 /6 bpf_cookie/perf_event:OK > > #9 /7 bpf_cookie/trampoline:OK > > #9 /8 bpf_cookie/lsm:OK > > #9 bpf_cookie:FAIL > > #18 /1 bpf_tcp_ca/dctcp:OK > > #18 /2 bpf_tcp_ca/cubic:OK > > #18 /3 bpf_tcp_ca/invalid_license:OK > > #18 /4 bpf_tcp_ca/dctcp_fallback:OK > > #18 /5 bpf_tcp_ca/rel_setsockopt:OK > > #18 bpf_tcp_ca:OK > > #51 /1 dummy_st_ops/dummy_st_ops_attach:OK > > #51 /2 dummy_st_ops/dummy_init_ret_value:OK > > #51 /3 dummy_st_ops/dummy_init_ptr_arg:OK > > #51 /4 dummy_st_ops/dummy_multiple_args:OK > > #51 dummy_st_ops:OK > > #55 fentry_fexit:OK > > #56 fentry_test:OK > > #57 /1 fexit_bpf2bpf/target_no_callees:OK > > #57 /2 fexit_bpf2bpf/target_yes_callees:OK > > #57 /3 fexit_bpf2bpf/func_replace:OK > > #57 /4 fexit_bpf2bpf/func_replace_verify:OK > > #57 /5 fexit_bpf2bpf/func_sockmap_update:OK > > #57 /6 fexit_bpf2bpf/func_replace_return_code:OK > > #57 /7 fexit_bpf2bpf/func_map_prog_compatibility:OK > > #57 /8 fexit_bpf2bpf/func_replace_multi:OK > > #57 /9 fexit_bpf2bpf/fmod_ret_freplace:OK > > #57 fexit_bpf2bpf:OK > > #58 fexit_sleep:OK > > #59 fexit_stress:OK > > #60 fexit_test:OK > > #67 get_func_args_test:OK > > #68 get_func_ip_test:OK > > #104 modify_return:OK > > #237 xdp_bpf2bpf:OK > > > > bpf_cookie/multi_kprobe_link_api and bpf_cookie/multi_kprobe_attach_api > > failed due to lack of multi_kprobe on arm64. > > > > Signed-off-by: Xu Kuohai > > Acked-by: Song Liu > > Catalin, Will, Mark, > > could you please ack this patch that you don't mind us > taking this set through bpf-next ? This is on my queue of things to review alongside some other ftrace and kprobes patches; I'll try to get that out of the way this week. From a quick glance I'm not too keen on the change to the ftrace trampoline, as to get rid of some existing unsoundness I'd really wanted to move that entirely away from using regs (and had a sketch for how to handle different op handlers). I'd discussed that with Steven and Masami in another thread: https://lore.kernel.org/linux-arm-kernel/YnJUTuOIX9YoJq23@FVFF77S0Q05N/ I'll see if it's possible to make this all work together. It's not entirely clear to me how the FTRACE_DIRECT its are supposed to play with dynamically allocated trampolines, and we might need to take a step back and reconsider. Thanks, Mark.