Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6182855rwn; Mon, 12 Sep 2022 23:30:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR5ejfPmceByG6j1w7LrYylV9lrIjaPQEI73oDUyF/W2bilGdqYmRrik9YwkL1WxFxE1QQNT X-Received: by 2002:a17:907:80b:b0:77a:86a1:db52 with SMTP id wv11-20020a170907080b00b0077a86a1db52mr11794200ejb.294.1663050630129; Mon, 12 Sep 2022 23:30:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663050630; cv=none; d=google.com; s=arc-20160816; b=vPS9zMp2Nw9huwEohfMZiIEIfuarLe+NkjR4Wmn/0ueJHB6UDNO3y0uBdHfdCLtJ0i qCjTaW84OrIKXhXxNDvtJ3I10yt2YGMuVyyk7+oSbFd5vLSsgQikCzG4V16F1ugcxgYs 9ECsrokVF7/ZGIvTk1nhCnvW8Gti2G40+tWz8yFwzA9mAIVDS0v4VcBRwoMx4aqIJWzg 85ZILhMBnZabeqtxM7FwyUSZ8iUhmxYPyAbVE7snxDuVD+r3/qSAcu45x7NctGR6Ovk2 HYYl5EWMwbIX2zBruEZKovdonU7uw0fLz4oitmGYwThBEoUG+xmixg3btOUIPHURS9iB KzSg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=n5HFL2fR1bQ2KStLODgnoye1Prqenulp0kTy90xF2GA=; b=LeZFMks/4vFHUHuly34VPtzyex+Ah9PT+oSblzSMjy91W5UCFzgVGxECDyScLtUA0g cpqqGwqTu1FMNxALuswnpYDAgUhIb6njBRo2FFJhVRkFhJL5u1FqObqtv8zIgjfhNpYy YvAHCbMTIPFMdLud2O6WjNY6JlaciOD5lmh1ftpgqzP9zvtwTJ63oqf84uxwrNmslrWJ Bh2Wh0vBBqanQrfB+FsJL7YMp+tbbGwCtqsq1ztCXNAB7juqrFoRsUzqR53YLD/a6qZ3 dmIlgsp7cOX1lA3RyFUCabFSiiu1CfL2K4+hwiyM48ol4y+y3YoN1pMgVNNYqYlNhpJZ QpGA== 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 di14-20020a170906730e00b00730d207a05esi8798819ejc.32.2022.09.12.23.30.01; Mon, 12 Sep 2022 23:30:30 -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 S230200AbiIMGYO (ORCPT + 99 others); Tue, 13 Sep 2022 02:24:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229892AbiIMGYM (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 49FF7E90; Mon, 12 Sep 2022 23:24:11 -0700 (PDT) Received: from mail02.huawei.com (unknown [172.30.67.169]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4MRYKN5FcyzKJcR; Tue, 13 Sep 2022 14:22:16 +0800 (CST) Received: from k01.huawei.com (unknown [10.67.174.197]) by APP4 (Coremail) with SMTP id gCh0CgCHSYkDIiBjT3sKAw--.4735S3; Tue, 13 Sep 2022 14:24:08 +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 1/4] ftrace: Allow users to disable ftrace direct call Date: Tue, 13 Sep 2022 02:31:43 -0400 Message-Id: <20220913063146.74750-2-xukuohai@huaweicloud.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220913063146.74750-1-xukuohai@huaweicloud.com> References: <20220913063146.74750-1-xukuohai@huaweicloud.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: gCh0CgCHSYkDIiBjT3sKAw--.4735S3 X-Coremail-Antispam: 1UD129KBjvJXoWruFyfCrWfXr4rWr1fXFy7Jrb_yoW8Jr45pF ZxGan7Gw48uFn0kr4S93W8WF98Zws2vryay3WDJ3yF9r98J3yDWrsFq39Fg348tF97G3yU ZF409Fyjk3W7Z37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUBYb4IE77IF4wAFF20E14v26rWj6s0DM7CY07I20VC2zVCF04k2 6cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28IrcIa0xkI8VA2jI8067AKxVWUGw A2048vs2IY020Ec7CjxVAFwI0_Xr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWDJVCq3wA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8Jr0_Cr1UM28EF7xvwVC2z280aVAFwI0_GcCE3s1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6rxl6s0DM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVACY4xI64kE6c02F40Ex7xfMc Ij6xIIjxv20xvE14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_ Jr0_Gr1lF7xvr2IYc2Ij64vIr41lFIxGxcIEc7CjxVA2Y2ka0xkIwI1l42xK82IYc2Ij64 vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r4a6rW5MIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_Jr0_JF4lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42IY6xAI w20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x 0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU1cdbUUUUUU== 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 To support ftrace direct call on arm64, multiple NOP instructions need to be added to the ftrace fentry, which will make the kernel image larger. For users who don't need direct calls, they should not pay this unnecessary price, so they should be allowed to disable this option. Signed-off-by: Xu Kuohai --- kernel/trace/Kconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 1052126bdca2..fc8a22f1a6a0 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -240,9 +240,14 @@ config DYNAMIC_FTRACE_WITH_REGS depends on HAVE_DYNAMIC_FTRACE_WITH_REGS config DYNAMIC_FTRACE_WITH_DIRECT_CALLS - def_bool y + bool "Support for calling custom trampoline from fentry directly" + default y depends on DYNAMIC_FTRACE_WITH_REGS depends on HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS + help + This option enables calling custom trampoline from ftrace fentry + directly, instead of using ftrace regs caller. This may reserve more + space in the fentry, making the kernel image larger. config DYNAMIC_FTRACE_WITH_ARGS def_bool y -- 2.30.2