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 47A06C433EF for ; Wed, 20 Apr 2022 07:44:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376352AbiDTHrE (ORCPT ); Wed, 20 Apr 2022 03:47:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376348AbiDTHqz (ORCPT ); Wed, 20 Apr 2022 03:46:55 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCE483BFA3; Wed, 20 Apr 2022 00:44:03 -0700 (PDT) Received: from kwepemi500013.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Kjt2x1R9KzhXY4; Wed, 20 Apr 2022 15:43:53 +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; Wed, 20 Apr 2022 15:43:59 +0800 Message-ID: <82e7faec-7f0c-573f-4945-de7072744dcb@huawei.com> Date: Wed, 20 Apr 2022 15:43:59 +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 From: Xu Kuohai 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> <6c18a27f-c983-58f3-1dc0-5192f7df232a@huawei.com> In-Reply-To: <6c18a27f-c983-58f3-1dc0-5192f7df232a@huawei.com> 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: linux-kernel@vger.kernel.org On 4/16/2022 9:57 AM, Xu Kuohai wrote: > 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. already implemented, but there are some conflicts between these two series, will send v3 after trampoline cookie are merged.