From patchwork Tue Aug 15 15:41:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Kuohai X-Patchwork-Id: 13353906 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 96EE3C0015E for ; Tue, 15 Aug 2023 15:22:00 +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=7+C+eqi4mCs3xDoE1v+T6YUW4rci6nCLszicyR+c91s=; b=gSyrVsrE47mJ+d Wsr6zgD03xTKYtOs4TSM7C6tt6EODyj5o1Uy6h/0tUJv6C7GDOeXwIMcMjtifB9jaalU+TwDHohme zIP1bRQxRj8JJWOhh599a/BFd+YKVHtspupvfyZBgJmjwiLb8ux4QR3/r97aqqsRYqoJ+pE6WiCXX R2K2lU7TejaDgdH6pV1eCK8CpGqcuny3HwP8uV5JwP1PDAQeRUrz3syrcQeU9DT3EI9QBDtqckzEa JZh5l+TDgWTYKtdbyrLeuPkmBP7hYpA/YWYWaydVtiI7Fk8ZKWDDua2hq1k6bK+P+ulnYbmcfi8wa cEkAOY7D79bG+3LbRkfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qVvrR-001qN7-0s; Tue, 15 Aug 2023 15:21:33 +0000 Received: from [45.249.212.51] (helo=dggsgout11.his.huawei.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qVvrJ-001qIL-1a for linux-arm-kernel@lists.infradead.org; Tue, 15 Aug 2023 15:21:27 +0000 Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4RQFN24CCXz4f3kpl for ; Tue, 15 Aug 2023 23:21:06 +0800 (CST) Received: from k01.huawei.com (unknown [10.67.174.197]) by APP3 (Coremail) with SMTP id _Ch0CgDH68Pgl9tk7KrwAg--.42348S2; Tue, 15 Aug 2023 23:21:05 +0800 (CST) From: Xu Kuohai To: bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Alexei Starovoitov , Andrii Nakryiko , Catalin Marinas , Daniel Borkmann , Martin KaFai Lau , Will Deacon , Mark Rutland , Yonghong Song , Zi Shen Lim Subject: [PATCH bpf-next 0/7] Support cpu v4 instructions for arm64 Date: Tue, 15 Aug 2023 11:41:51 -0400 Message-Id: <20230815154158.717901-1-xukuohai@huaweicloud.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CM-TRANSID: _Ch0CgDH68Pgl9tk7KrwAg--.42348S2 X-Coremail-Antispam: 1UD129KBjvdXoWruFyfur1xKry3Xr4kAF4DCFg_yoWkXrXEkw saya4v93WrAF1SyFyUC3WxXryDCwsIqry7Gr13trZ2qr1UZw4DAF4kJa40y348Xa4SgrW3 ZF9rK34Fkr43WjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Gr0_Xr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwV A0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x02 67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxV AFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2 j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7x kEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628vn2kIc2xKxwCF04k20xvY 0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I 0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_GFylIxkGc2Ij64vIr41lIxAI cVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcV CF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280 aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU1zuWJUUUUU== X-CM-SenderInfo: 50xn30hkdlqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230815_082125_719075_83E0FB6E X-CRM114-Status: UNSURE ( 7.72 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Xu Kuohai This series adds arm64 support for cpu v4 instructions [1]. [1] https://lore.kernel.org/all/20230728011143.3710005-1-yonghong.song@linux.dev/ Xu Kuohai (7): arm64: insn: Add encoders for LDRSB/LDRSH/LDRSW bpf, arm64: Support sign-extension load instructions bpf, arm64: Support sign-extension mov instructions bpf, arm64: Support unconditional bswap bpf, arm64: Support 32-bit offset jmp instruction bpf, arm64: Support signed div/mod instructions selftests/bpf: Enable cpu v4 tests for arm64 arch/arm64/include/asm/insn.h | 4 + arch/arm64/lib/insn.c | 6 ++ arch/arm64/net/bpf_jit.h | 12 +++ arch/arm64/net/bpf_jit_comp.c | 91 +++++++++++++++---- .../selftests/bpf/progs/test_ldsx_insn.c | 2 +- .../selftests/bpf/progs/verifier_bswap.c | 2 +- .../selftests/bpf/progs/verifier_gotol.c | 2 +- .../selftests/bpf/progs/verifier_ldsx.c | 2 +- .../selftests/bpf/progs/verifier_movsx.c | 2 +- .../selftests/bpf/progs/verifier_sdiv.c | 2 +- 10 files changed, 103 insertions(+), 22 deletions(-) Acked-by: Florent Revest Tested-by: Florent Revest