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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 204AEC433F5 for ; Sat, 16 Apr 2022 01:58:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:CC:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dUI5bVzOFUWrXYalJ9yWIYpns5nkzODNMvh7YMkrW1Q=; b=V1Jt4BfUW4JSwY 7pGnT1s5cSRvDmtWnGseOfZOQd/Yx7BwWNkdgfMhztKSVFKgNioZb8RU6jwNv3QZCYnlli5hDMbrC m9atl8czDJ82xoG1TRWtteLyvxzLDgsSZb9zueAfdZdFAgRFlw+Fo91KWOQRPmqtWAwogyMxsPx3c zi5dS6xcInN7HDlK1MKGUc/Nm0IZ+ZqCB/SppdeRxDaKowYvtgUC33KWn9swIX+pK9FM0jfmdMoQO 4wDbGFA1S/gOcbH1UPErkUFp6J9hJMTF9O+jE4NASy67BYSlEX1Wz4jRHrMY1M088NlIgHk0Khxz3 q/KpVuDvff6htkRgNOxA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfXgk-00Buuz-N8; Sat, 16 Apr 2022 01:57:26 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfXgh-00BuuW-C6 for linux-arm-kernel@lists.infradead.org; Sat, 16 Apr 2022 01:57:25 +0000 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: 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220415_185723_620485_DF70F413 X-CRM114-Status: GOOD ( 10.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 57D73C4167D for ; Sat, 16 Apr 2022 02:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229613AbiDPCKW (ORCPT ); Fri, 15 Apr 2022 22:10:22 -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: linux-kernel@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.