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 72944C433FE for ; Mon, 7 Nov 2022 09:23:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbiKGJXz (ORCPT ); Mon, 7 Nov 2022 04:23:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231346AbiKGJXt (ORCPT ); Mon, 7 Nov 2022 04:23:49 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20C70656E; Mon, 7 Nov 2022 01:23:48 -0800 (PST) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N5QlJ0H8NzRnsk; Mon, 7 Nov 2022 17:23:40 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 17:23:46 +0800 Received: from ubuntu1804.huawei.com (10.67.174.61) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 17:23:45 +0800 From: Yang Jihong To: , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH bpf v2 0/5] bpf: Support kernel function call in 32-bit ARM Date: Mon, 7 Nov 2022 17:20:27 +0800 Message-ID: <20221107092032.178235-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.174.61] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 1. Patch1 is dependent patch to fix zext extension error in 32-bit ARM. 2. Patch2 and patch3 solve the problem that the bpf check fails because load's mem size is modified in CO_RE from the kernel and user modes, Currently, there are different opinions and a final solution needs to be selected. 3. Patch4 supports bpf fkunc in 32-bit ARM for EABI. 4. Patch5 is used to add test cases to cover some parameter scenarios states by AAPCS. The following is the test_progs result in the 32-bit ARM environment: # uname -m armv7l # echo 1 > /proc/sys/net/core/bpf_jit_enable # ./test_progs -t kfunc_call #1/1 kfunc_call/kfunc_syscall_test_fail:OK #1/2 kfunc_call/kfunc_syscall_test_null_fail:OK #1/3 kfunc_call/kfunc_call_test_get_mem_fail_rdonly:OK #1/4 kfunc_call/kfunc_call_test_get_mem_fail_use_after_free:OK #1/5 kfunc_call/kfunc_call_test_get_mem_fail_oob:OK #1/6 kfunc_call/kfunc_call_test_get_mem_fail_not_const:OK #1/7 kfunc_call/kfunc_call_test_mem_acquire_fail:OK #1/8 kfunc_call/kfunc_call_test1:OK #1/9 kfunc_call/kfunc_call_test2:OK #1/10 kfunc_call/kfunc_call_test4:OK #1/11 kfunc_call/kfunc_call_test_ref_btf_id:OK #1/12 kfunc_call/kfunc_call_test_get_mem:OK #1/13 kfunc_call/kfunc_syscall_test:OK #1/14 kfunc_call/kfunc_syscall_test_null:OK #1/17 kfunc_call/destructive:OK Yang Jihong (5): bpf: Adapt 32-bit return value kfunc for 32-bit ARM when zext extension bpf: Adjust sk size check for sk in bpf_skb_is_valid_access for CO_RE in 32-bit arch libbpf: Skip adjust mem size for load pointer in 32-bit arch in CO_RE bpf: Add kernel function call support in 32-bit ARM for EABI bpf:selftests: Add kfunc_call test for mixing 32-bit and 64-bit parameters arch/arm/net/bpf_jit_32.c | 142 ++++++++++++++++++ kernel/bpf/verifier.c | 3 + net/bpf/test_run.c | 18 +++ net/core/filter.c | 8 +- tools/lib/bpf/libbpf.c | 34 ++++- .../selftests/bpf/prog_tests/kfunc_call.c | 3 + .../selftests/bpf/progs/kfunc_call_test.c | 52 +++++++ 7 files changed, 254 insertions(+), 6 deletions(-) -- 2.30.GIT 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 81C06C433FE for ; Mon, 7 Nov 2022 09:25:51 +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:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=m90ofuX+HQMFFhG43N4nuh2750jCmq5cKXJ/U6wVo90=; b=YNsHka+djelCr/ CHL7Ql4zpvnKn0Ltt7HC5IdqdMZ8VBnEzF20SaFgqU71FnbwKwE1vEZ+R7SFSOHEoM1Z0eV7gg9VI 0ITax4CwW0ejAhs5u6yOhG6yqa2GFjiE4g0azHam0Jfh4RTg++JOEmCcSDBTwsRXViHZj+Y33t4zu NesdiTRjIqe4xHiR6YXBeuAxmc4p+r6pwvoGeldFmpzjYbB4iBg2ZLBjwlSiEKDOIWHPxhGTChALL s8DaMQS9u19QefY8+KJGZPfXZJ92JR1uiVp8LkGLwRljBXuUvHQnOsF+oLUvGWGFNNjcPfS9iEijy vIqf2E7NANPBlFQ4h1cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oryN5-00DFwO-9V; Mon, 07 Nov 2022 09:24:48 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oryM9-00DFA4-46 for linux-arm-kernel@lists.infradead.org; Mon, 07 Nov 2022 09:23:51 +0000 Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N5QlJ0H8NzRnsk; Mon, 7 Nov 2022 17:23:40 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 17:23:46 +0800 Received: from ubuntu1804.huawei.com (10.67.174.61) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 7 Nov 2022 17:23:45 +0800 From: Yang Jihong To: , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Subject: [PATCH bpf v2 0/5] bpf: Support kernel function call in 32-bit ARM Date: Mon, 7 Nov 2022 17:20:27 +0800 Message-ID: <20221107092032.178235-1-yangjihong1@huawei.com> X-Mailer: git-send-email 2.30.GIT MIME-Version: 1.0 X-Originating-IP: [10.67.174.61] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221107_012349_545808_DC85FDFF X-CRM114-Status: UNSURE ( 8.76 ) X-CRM114-Notice: Please train this message. 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 1. Patch1 is dependent patch to fix zext extension error in 32-bit ARM. 2. Patch2 and patch3 solve the problem that the bpf check fails because load's mem size is modified in CO_RE from the kernel and user modes, Currently, there are different opinions and a final solution needs to be selected. 3. Patch4 supports bpf fkunc in 32-bit ARM for EABI. 4. Patch5 is used to add test cases to cover some parameter scenarios states by AAPCS. The following is the test_progs result in the 32-bit ARM environment: # uname -m armv7l # echo 1 > /proc/sys/net/core/bpf_jit_enable # ./test_progs -t kfunc_call #1/1 kfunc_call/kfunc_syscall_test_fail:OK #1/2 kfunc_call/kfunc_syscall_test_null_fail:OK #1/3 kfunc_call/kfunc_call_test_get_mem_fail_rdonly:OK #1/4 kfunc_call/kfunc_call_test_get_mem_fail_use_after_free:OK #1/5 kfunc_call/kfunc_call_test_get_mem_fail_oob:OK #1/6 kfunc_call/kfunc_call_test_get_mem_fail_not_const:OK #1/7 kfunc_call/kfunc_call_test_mem_acquire_fail:OK #1/8 kfunc_call/kfunc_call_test1:OK #1/9 kfunc_call/kfunc_call_test2:OK #1/10 kfunc_call/kfunc_call_test4:OK #1/11 kfunc_call/kfunc_call_test_ref_btf_id:OK #1/12 kfunc_call/kfunc_call_test_get_mem:OK #1/13 kfunc_call/kfunc_syscall_test:OK #1/14 kfunc_call/kfunc_syscall_test_null:OK #1/17 kfunc_call/destructive:OK Yang Jihong (5): bpf: Adapt 32-bit return value kfunc for 32-bit ARM when zext extension bpf: Adjust sk size check for sk in bpf_skb_is_valid_access for CO_RE in 32-bit arch libbpf: Skip adjust mem size for load pointer in 32-bit arch in CO_RE bpf: Add kernel function call support in 32-bit ARM for EABI bpf:selftests: Add kfunc_call test for mixing 32-bit and 64-bit parameters arch/arm/net/bpf_jit_32.c | 142 ++++++++++++++++++ kernel/bpf/verifier.c | 3 + net/bpf/test_run.c | 18 +++ net/core/filter.c | 8 +- tools/lib/bpf/libbpf.c | 34 ++++- .../selftests/bpf/prog_tests/kfunc_call.c | 3 + .../selftests/bpf/progs/kfunc_call_test.c | 52 +++++++ 7 files changed, 254 insertions(+), 6 deletions(-) -- 2.30.GIT _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel