Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6201858rwn; Mon, 12 Sep 2022 23:57:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR52sTJtFRnCW4mes5y6JBJpdHcnyPvNcLp4aW9rlMkHZSdaQyUgIw1K5WKF7rug8n+yF1NR X-Received: by 2002:a17:903:1205:b0:171:4f8d:22a8 with SMTP id l5-20020a170903120500b001714f8d22a8mr30161547plh.11.1663052228738; Mon, 12 Sep 2022 23:57:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663052228; cv=none; d=google.com; s=arc-20160816; b=lAmmBpRF1c6xs8BNnNBOONgMsS+6kMEnCjPplRMg99yMzviehyg7rZt9gnyMqYP3qg 7uP53ih6zDAMy58p39Mgq+K9Kw2jSAXWBMUys01ccPQNaAM+zitkjVQwtqFFHK2/5GJE iMWiDpO/bo5MkmWDjFXuSGPDLmGwcOEEv1iaDpEHclVSqB2wPw3Jm9vF2vvq49ES/NOu mFl8uw46iOT8ERlQicjciP2l4QUHpbanlJx25hnOf86F4xLDtqQk8cgeFazQ0gkRHXkY UAbTtXtbXn+vE68fLO/8/j80lhYAfzEKJwcA76wx/BW0ppOxC258PmcPfa6npIUS+T9O frIg== 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=lwaoRUW6WrQHW1au87X342XR3/5I9qtsur7qHHtANiE=; b=JLqiSh0fOmFwjWzr5Ia1CcTSd5ds6nTKsaajYY1vTAcPPLEGi6XqACN2NTBfXOZLVG EY6GwtnXF1Kl9N5BNaZMpKjCXFCdDj4lAb3hFUE0s7IOwfscLGWpPGt9dTpW+RTMwUU0 d0yTz+TcfOCBl4IxIugOPTm6m2VYOHBV4S6IEfKfsQQAvecTOr+4dQIhNM0ldwZqGtEz Ub64PGzihWp/H8uX7VygVlbF/R9mN/cNGCTNFXDw9n1Grp75l+sZWUMR8gKP7b2AmbEW UmdVoyRv2pQcmHRz9DTAg6mLu7Jym4TZCXMVjp4I/YagiM6wXdd4HHgDtOf8HZheffu6 2xVA== 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 ne16-20020a17090b375000b00200a9235f48si10774365pjb.44.2022.09.12.23.56.57; Mon, 12 Sep 2022 23:57:08 -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 S230248AbiIMGYR (ORCPT + 99 others); Tue, 13 Sep 2022 02:24:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbiIMGYM (ORCPT ); Tue, 13 Sep 2022 02:24:12 -0400 Received: from dggsgout11.his.huawei.com (unknown [45.249.212.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08FB795BC; Mon, 12 Sep 2022 23:24:09 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4MRYKL6d9bzKFS0; Tue, 13 Sep 2022 14:22:14 +0800 (CST) Received: from k01.huawei.com (unknown [10.67.174.197]) by APP4 (Coremail) with SMTP id gCh0CgCHSYkDIiBjT3sKAw--.4735S2; Tue, 13 Sep 2022 14:24:04 +0800 (CST) From: Xu Kuohai To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Cc: Mark Rutland , Florent Revest , Catalin Marinas , Will Deacon , Jean-Philippe Brucker , Steven Rostedt , Ingo Molnar , Oleg Nesterov , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Zi Shen Lim , Pasha Tatashin , Ard Biesheuvel , Marc Zyngier , Guo Ren , Masami Hiramatsu Subject: [PATCH bpf-next 0/4] Add ftrace direct call for arm64 Date: Tue, 13 Sep 2022 02:31:42 -0400 Message-Id: <20220913063146.74750-1-xukuohai@huaweicloud.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgCHSYkDIiBjT3sKAw--.4735S2 X-Coremail-Antispam: 1UD129KBjvJXoW7uFyDGF1fXrW8uw4fWrykKrg_yoW8GrWfpa 9rurnxGr4UCFsakFyfu3Z3ury3Jw4kJry5Ja47A34Fkrn09FyUWrnayrnrCw4UJr9rJ3y2 qFyYvrWrKF4UXa7anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUk2b4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4 vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7Cj xVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x 0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG 6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFV Cjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JM4IIrI8v6xkF7I0E8cxan2IY04v7MxAIw28I cxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2 IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVW8ZVWrXwCIc40Y0x0EwIxGrwCI 42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVW8JVWxJwCI42 IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E 87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvjxUFYFCUUUUU X-CM-SenderInfo: 50xn30hkdlqx5xdzvxpfor3voofrz/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 From: Xu Kuohai This series adds ftrace direct call for arm64, which is required to attach bpf trampoline to fentry. Although there is no agreement on how to support ftrace direct call on arm64, no patch has been posted except the one I posted in [1], so this series continues the work of [1] with the addition of long jump support. Now ftrace direct call works regardless of the distance between the callsite and custom trampoline. [1] https://lore.kernel.org/bpf/20220518131638.3401509-2-xukuohai@huawei.com/ Xu Kuohai (4): ftrace: Allow users to disable ftrace direct call arm64: ftrace: Support long jump for ftrace direct call arm64: ftrace: Add ftrace direct call support ftrace: Fix dead loop caused by direct call in ftrace selftest arch/arm64/Kconfig | 2 + arch/arm64/Makefile | 4 + arch/arm64/include/asm/ftrace.h | 35 ++++-- arch/arm64/include/asm/patching.h | 2 + arch/arm64/include/asm/ptrace.h | 6 +- arch/arm64/kernel/asm-offsets.c | 1 + arch/arm64/kernel/entry-ftrace.S | 39 ++++-- arch/arm64/kernel/ftrace.c | 198 ++++++++++++++++++++++++++++-- arch/arm64/kernel/patching.c | 14 +++ arch/arm64/net/bpf_jit_comp.c | 4 + kernel/trace/Kconfig | 7 +- kernel/trace/ftrace.c | 10 +- kernel/trace/trace_selftest.c | 2 + 13 files changed, 295 insertions(+), 29 deletions(-) -- 2.30.2