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 53904C433F5 for ; Sat, 16 Apr 2022 02:08:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229537AbiDPCKL (ORCPT ); Fri, 15 Apr 2022 22:10:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbiDPCGY (ORCPT ); Fri, 15 Apr 2022 22:06:24 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D222765827; Fri, 15 Apr 2022 18:57:16 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4KgGX26D0Pz1HBhn; Sat, 16 Apr 2022 09:56:34 +0800 (CST) Received: from [10.67.111.192] (10.67.111.192) by kwepemi500013.china.huawei.com (7.221.188.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 16 Apr 2022 09:57:12 +0800 Message-ID: <6c18a27f-c983-58f3-1dc0-5192f7df232a@huawei.com> Date: Sat, 16 Apr 2022 09:57:12 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH bpf-next v2 5/6] bpf, arm64: bpf trampoline for arm64 Content-Language: en-US To: Andrii Nakryiko 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 , , 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 References: <20220414162220.1985095-1-xukuohai@huawei.com> <20220414162220.1985095-6-xukuohai@huawei.com> From: Xu Kuohai In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.111.192] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemi500013.china.huawei.com (7.221.188.120) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 4/16/2022 1:12 AM, Andrii Nakryiko wrote: > 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. OK, I'll take a look and try to implemnt it.