Received: by 2002:a05:6504:1d0:b0:1de:de76:8684 with SMTP id e16csp876935ltn; Fri, 2 Sep 2022 09:11:59 -0700 (PDT) X-Google-Smtp-Source: AA6agR4X+Hfc/X5uYjLzGFYza9tajgEScXYSjtDtmCQsaynqAvREBNoV4TB0rVm+FyKvL8CRNCtW X-Received: by 2002:a17:90b:2545:b0:1fd:92d6:62da with SMTP id nw5-20020a17090b254500b001fd92d662damr5659144pjb.239.1662135119138; Fri, 02 Sep 2022 09:11:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662135119; cv=none; d=google.com; s=arc-20160816; b=g7JgSYEdCT1N3se+YV0nU66GL6LxWey8PG0z1YOv5WVsmMNFvSUIdSzAjXVi+GwTdO EKLmjXjgpxuVgwkBUhFligHVO2mzL7ctnfp8OAWErozQhcMK8bObMZTucc6Vz+ECe/gm EkGqOhuVVWLRc7H5x3DtBP4f5wDthciT8/D6qmcop60uc04dT7IsxvNZ5aAGWgibSO9B 6E9A9A/DA+s1m6q9rbwKByDY4rlQxpDXUQs5DpltF1xiIK+cLnhueU/z53BX4QTqORzr IdtgKyAcxm3O0qHG9ctQP4gzbAQDZRSmAGiInLt9OLYe4e2y0aSDNzarMB5+tA467CEb 0JfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=sVttLN4X8ztQD0P05z/nw/9xSTihX79SYVXnpPY+2Xg=; b=fYfmoEvq7SSAYB4Yvm7s349cR1/2dQdEJwkscuPojItiWEeB/+uP+xNYJ1uYB05QYz V0/POwBEHtRFUOEfQT+14h60xFoqj+OYjZw4NcVM8iL3Wpf2OmTJR+eoa+M5VuMEXY8d od8Wt7dNcS3QnbrcAEqJrhPl1qIF/b2T9GJQ/oA0B+SQotvg58uvCIP/AyEAIiPATO8q IbOXuYh0DMPtZXmozHW3AXvf6BtFCR/Gxkcp97mhikv7l4faaFXKbdlJ0mK3vB8oObSp IYv96ojC22cgsIS7HVyELtzD0ZmEcob3swVopA+GDTEZzxP4+dffcMviOb4Jdk3shs5R feng== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k8-20020a056a00134800b0052dd9f10a47si2238615pfu.363.2022.09.02.09.11.46; Fri, 02 Sep 2022 09:11:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237033AbiIBPbo (ORCPT + 99 others); Fri, 2 Sep 2022 11:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236395AbiIBPbL (ORCPT ); Fri, 2 Sep 2022 11:31:11 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58BF2F23C9; Fri, 2 Sep 2022 08:12:41 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4MK1ZS1Rw6zKL17; Fri, 2 Sep 2022 23:10:56 +0800 (CST) Received: from k01.huawei.com (unknown [10.67.174.197]) by APP3 (Coremail) with SMTP id _Ch0CgBn4UhlHRJja8YAAQ--.58277S2; Fri, 02 Sep 2022 23:12:39 +0800 (CST) From: Xu Kuohai To: bpf@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Daniel Borkmann , Jean-Philippe Brucker , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Zi Shen Lim , Catalin Marinas , Will Deacon Subject: [PATCH bpf-next 0/2] Jit BPF_CALL to direct call when possible Date: Fri, 2 Sep 2022 11:20:40 -0400 Message-Id: <20220902152043.721806-1-xukuohai@huaweicloud.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _Ch0CgBn4UhlHRJja8YAAQ--.58277S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtrW3ZF15KFW7Kr1ftr13urg_yoW3Jrb_GF WxAFy7A343ZFyUAasYya97AFy8KrWDtr18AFn0qrZ7t34ftw4DAry8XFWkX3WUXrWjkFyr Cwsrur48tr1Y9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb7AYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwV A0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW7JVWDJwA2z4x0Y4vE2Ix0cI8IcVCY1x02 67AKxVWxJVW8Jr1l84ACjcxK6I8E87Iv67AKxVW0oVCq3wA2z4x0Y4vEx4A2jsIEc7CjxV AFwI0_GcCE3s1le2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2 j2WlYx0E2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r1j6r4UMcvjeVCFs4IE7x kEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwACI402YVCY1x02628vn2kIc2xKxwCF04k20xvY 0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c02F40E14v26r1j6r18MI8I3I 0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_GFv_WrylIxkGc2Ij64vIr41lIxAI cVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Gr0_Cr1lIxAIcV CF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280 aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU13rcDUUUUU== X-CM-SenderInfo: 50xn30hkdlqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently BPF_CALL is always jited to indirect call, but when target is in the range of direct call, a BPF_CALL can be jited to direct call. For example, the following BPF_CALL call __htab_map_lookup_elem is always jited to an indirect call: mov x10, #0xffffffffffff18f4 movk x10, #0x821, lsl #16 movk x10, #0x8000, lsl #32 blr x10 When the target is in the range of a direct call, it can be jited to: bl 0xfffffffffd33bc98 This patchset does such jit. Xu Kuohai (2): bpf, arm64: Jit BPF_CALL to direct call when possible bpf, arm64: Eliminate false -EFBIG error in bpf trampoline arch/arm64/net/bpf_jit_comp.c | 136 ++++++++++++++++++++++------------ 1 file changed, 87 insertions(+), 49 deletions(-) -- 2.30.2