Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2270107rwb; Mon, 19 Sep 2022 02:25:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM69GGzQxmMN/V8Eritb2mCNxRwduaOBf0ZkfpVxpsRbM40nTTMA+iTTVNZcozRXPYeFPUuS X-Received: by 2002:a05:6a02:205:b0:420:8b7e:3ff with SMTP id bh5-20020a056a02020500b004208b7e03ffmr14677386pgb.427.1663579558112; Mon, 19 Sep 2022 02:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663579558; cv=none; d=google.com; s=arc-20160816; b=wdcBJNvpsvUHavklcWtTyc4oULQxM5PEParaX+rj+hqzqInArSR3FgLOhN41EakIbH S6RisOumB5GXvzlkO7t2ZJXuy0CBbdJ55EDJeJ2DpE88WZLpBGCkJJWLnp3WI4Byip92 AlrQjDwXu4bh3+iVutkjyDFd+0h7gb0cEM6zsMBYEqT69JICYch5Tlls4S+lfq4yxYiq dSqyiMLMqcIK761AwkUW8/ttGtInPtIVD7KgA0A3kxE6B56YQQdVAwZqkY+OSMK3iTu6 MQ0HD68pD4PFLtqN2DMfUTeDSwcgUqpdvt9mj7J3WDBCp+xbhVyyj3vtp+fOqosBce65 WSbw== 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=jpJT5fE5vDXCosj+HrLoHJVDsigEoG7iP+lK/fKBmGcZ/XsTrC8gqo8Zy6wuf8+L+I UcISgR25ot6mRu463yT/D0fmOG24n4ojU7/2kzAtGVZhLu7G3K1ApzAyldNG9N7opeex 5LIkfL7+BbMxT8LS/Zi0Jl5QjKiLRKWBs1G+1gHbEYiY5SB6l/5FhCqiPsEo5qMAbPZR 2dvfExQqdvfth2I3QVTPrqOc0VeplimAIdlst8ByKb3ovKiLHQ18QOzzwMLfdbvRzt1y 72ZxZVT4/5C0d6nVoo64x/IP2CLpl3iNGoe1mRHtdcW1v5xn8LPm/EzvllNzNy57mwTT NzBA== 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 il9-20020a17090b164900b001f021b4f1d5si11949106pjb.1.2022.09.19.02.25.47; Mon, 19 Sep 2022 02:25:58 -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 S229918AbiISJEj (ORCPT + 99 others); Mon, 19 Sep 2022 05:04:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229667AbiISJEg (ORCPT ); Mon, 19 Sep 2022 05:04:36 -0400 Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D22AB67; Mon, 19 Sep 2022 02:04:31 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.143]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4MWJbt0ckPzl6GL; Mon, 19 Sep 2022 17:02:50 +0800 (CST) Received: from k01.huawei.com (unknown [10.67.174.197]) by APP2 (Coremail) with SMTP id Syh0CgDHY22cMChjI49JBA--.48437S2; Mon, 19 Sep 2022 17:04:29 +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: [RESEND PATCH bpf-next 0/2] Jit BPF_CALL to direct call when possible Date: Mon, 19 Sep 2022 05:21:36 -0400 Message-Id: <20220919092138.1027353-1-xukuohai@huaweicloud.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: Syh0CgDHY22cMChjI49JBA--.48437S2 X-Coremail-Antispam: 1UD129KBjvdXoWrtrW3ZF15KFW7Kr1ftr13urg_yoW3Jrb_GF WxAFy7A343ZFyUAasYya97AFy8KrWDtr18AFn0qrZ7t34ftw4DAry8XFWkX3WUXrWjkFyr Cwsrur48tr1Y9jkaLaAFLSUrUUUUjb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb2xYFVCjjxCrM7AC8VAFwI0_Xr0_Wr1l1xkIjI8I6I8E6xAIw20E Y4v20xvaj40_Wr0E3s1l1IIY67AEw4v_Jr0_Jr4l8cAvFVAK0II2c7xJM28CjxkF64kEwV A0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x02 67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I 0E14v26rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40E x7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x 0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l42xK82IY c2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s 026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF 0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0x vE42xK8VAvwI8IcIk0rVWrJr0_WFyUJwCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E 87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUo0eHDUUUU 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 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