Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp985912pxb; Fri, 15 Apr 2022 17:27:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzU4tm24z8CNGFsNh6+Ui97V33lF53Nd7KRoe9LOgYuwotWZ83ndZuCXPkkN2pR31pJIJZv X-Received: by 2002:a05:6a00:1a90:b0:506:1e27:a579 with SMTP id e16-20020a056a001a9000b005061e27a579mr1551613pfv.46.1650068870350; Fri, 15 Apr 2022 17:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650068870; cv=none; d=google.com; s=arc-20160816; b=Oiw08dIb7Jw6nHWk5ieS2i1GUbe1gXIc1WD5J1RIWy1dKoRfBse2s0zUnvJkScVXFw 5WVLSZGiT5kWfbstGKXRrQISdNZo4zhFexIZ4pB6NLlHOn0zxUlxIiUVLPQl8Og8AcUn dP3XFWKSGWFeDQqs1Ci6xdLDMoCyFI3Py1As8T3LZtske6ZRdFai3ZlKj4ivq8wUWvnG QPOBnUXll/qgO3L21l99tY6JeOvxqlcJuw6oKtCpRaZWANl+RtxcJTK9K5ZqwiryYRIv iosEvQ4jberZl9PKhJoV9jV0TvhofF1IqjaVNPC0hPyRlmeE9ezb9hC77n29kd2kkrr2 TePA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WrjUGuM6rsjd8l4kfiI/+ZvHzPP7KdnaSgcThC3AV8o=; b=Bv2f8CtS+uDruaOo7odX7vLUpSqJResOQ80xd2/ewo8Pg5nsi8XGo1slqe+9v2UH6M K8MQCqC91hYKD/LzduF/mq0bY07bMPZcX6ipBfGJq9LZ0w9HBzeOyejQ5LgtGlciUhfP PAuugbi+8g9Q6KjX90GXHbzFjnHw5YcbaQHdtbj+cj1V1SYbVis08Rf/oAhhdj/NQCUI gFRbcfVmCSYX4s++3+kot9JEU8VnPhKFgf/ANngjQh+W1ff560f5AX4Z/cHgUnLj35Yy 4k3DwizargnJ8sUjCU4D4QkzU0/1nCRZAObin/BJp11GGBuCvtPS0oTHb7vWlzN1ZSPn 49qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kKdXm1SF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q125-20020a634383000000b0039daac3c6dfsi2791216pga.582.2022.04.15.17.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:27:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kKdXm1SF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E5BEADCE22; Fri, 15 Apr 2022 17:25:36 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344002AbiDORPO (ORCPT + 99 others); Fri, 15 Apr 2022 13:15:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235654AbiDORPM (ORCPT ); Fri, 15 Apr 2022 13:15:12 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A4519BAC5; Fri, 15 Apr 2022 10:12:43 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id c125so1585518iof.9; Fri, 15 Apr 2022 10:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WrjUGuM6rsjd8l4kfiI/+ZvHzPP7KdnaSgcThC3AV8o=; b=kKdXm1SFgaU0iXA2vligFziQ2tI3e4EIcf2e7gI9zKaVVjoJhwqa6nil1gW6QuZQcX yTfkNxFYkQabvpe3wRuWqWHLTF6CpllydvcNWtRCILfdfOR5A63e2ts7V2n6xzxOsJpG Y4aq1E0Z23FtIuzyB8xUYBJg6qyRNu5J43LfRlXIp49m7Rq7gUl0mfxkV0kqxxxk8fly eQRSN0sUhANtHFudZbLuk4Nw/mGjSIBoVboWUuwBJUTqF8wImuscttw8qag/vC/gBaCA v8WKOJzooa3wSHSmQfhzNL7BHJXQum0JWnLtwlIVyivtFiBpBZKILiGPhpyH2fOmH/zr etug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WrjUGuM6rsjd8l4kfiI/+ZvHzPP7KdnaSgcThC3AV8o=; b=NCTZQOpJh6WRWa2wP2fsV+xVT11hFBauk334ATqklZ2TVQz8UyHUEppn1l6HRNW6Ww oD6ddO8AbFu3M8QurbD2nJNGungnK4fcVNCVwBgA9y0OuG0vs+Ql18jRehDmTyVSlxtp o1JtIPphPD/uz6F9lKZYFqsGhD1UOa+8M9+inigJ+WiITc3h7vJi7Oo6j1h5b5FwCX/h RKQDYS1ftaxOrA2qJU7JAXW0V/qKesfB0NJZgJwiHWJg8iyVt92Ya22BnNnCZWB8Xn2B KWekKMnUY+Uh1lT4Vq9yxpAey2nmO6UFnueLDDmAQgPQcdZTDreTvV+zlvzQUzmtiFhl rxbg== X-Gm-Message-State: AOAM5321lRDISJNOIL54u5BC9qF63xma6aBQv3t7KGjuALyCFehOqEhu vNqnWtTUWvOjmzV4wk0KDElmhEIie7KEWdYimI8= X-Received: by 2002:a05:6602:185a:b0:645:d914:35e9 with SMTP id d26-20020a056602185a00b00645d91435e9mr3603490ioi.154.1650042762884; Fri, 15 Apr 2022 10:12:42 -0700 (PDT) MIME-Version: 1.0 References: <20220414162220.1985095-1-xukuohai@huawei.com> <20220414162220.1985095-6-xukuohai@huawei.com> In-Reply-To: <20220414162220.1985095-6-xukuohai@huawei.com> From: Andrii Nakryiko Date: Fri, 15 Apr 2022 10:12:31 -0700 Message-ID: Subject: Re: [PATCH bpf-next v2 5/6] bpf, arm64: bpf trampoline for arm64 To: Xu Kuohai Cc: bpf , linux-arm-kernel , open list , Networking , "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 , hpa@zytor.com, Shuah Khan , Mark Rutland , Ard Biesheuvel , Pasha Tatashin , Peter Collingbourne , Daniel Kiss , Sudeep Holla , Steven Price , Marc Zyngier , Mark Brown , Kumar Kartikeya Dwivedi , Delyan Kratunov Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 Thu, Apr 14, 2022 at 9:10 AM Xu Kuohai wrote: > > Add bpf trampoline support for arm64. Most of the logic is the same as > x86. > > fentry before bpf trampoline hooked: > mov x9, x30 > nop > > fentry after bpf trampoline hooked: > mov x9, x30 > bl > > Tested on qemu, result: > #55 fentry_fexit:OK > #56 fentry_test: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 > #101 modify_return:OK > > Signed-off-by: Xu Kuohai > Acked-by: Song Liu > --- Can you please also take a look at [0], which is an ongoing work to add support for BPF cookie to BPF trampoline-based BPF programs. It's very close to being done, so it would be good if you can implement that at the same time. [0] https://patchwork.kernel.org/project/netdevbpf/patch/20220412165555.4146407-4-kuifeng@fb.com/ > arch/arm64/net/bpf_jit.h | 14 +- > arch/arm64/net/bpf_jit_comp.c | 338 +++++++++++++++++++++++++++++++++- > 2 files changed, 348 insertions(+), 4 deletions(-) > [...]