From patchwork Mon Oct 17 14:53:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 3500 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp1493108wrs; Mon, 17 Oct 2022 07:55:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ScvzJfG2Ole/1Rk+EFycMe946gte4UaMEg7PwGpTHGCJg5OPK35UWVaji3YJ2hRct8Hft X-Received: by 2002:a17:907:3fa3:b0:78d:d11c:389f with SMTP id hr35-20020a1709073fa300b0078dd11c389fmr8914577ejc.415.1666018541520; Mon, 17 Oct 2022 07:55:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666018541; cv=none; d=google.com; s=arc-20160816; b=te+BFyo4DtFfEzty2skzcL9LJZ/598PFujJLU8kid4JcGIiq19ON/xSidptPoDuogo D3wI12O/B3DD84GVezQj9ypAgPTeHKoTf9liF/zPUH+zrq0zvRdrwzbf1mUIT7q+xdoG z6zfSxMdv6Qd2PUSOQYjROHycd1XTVIB6qrpjwVK9UeMxvT9mO3ysc+kURJ/8laYL+H5 r4CAu4YVXjYkPyrNy0g4keNNRQOTm6slpobRDy6Zyd6JciaNghscTHEKrSMIdlwuKZeB 3Mna3/c9bSIlge03JK2HG+U95mcTvTggYcRSyHBDGiNjVHhf4JsWJ91HH9B1W2mvRe/7 XVbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=fT5/BcvC6Qp5TgWLuIIniP7KCiPJ7NyILpuDuar90fU=; b=GbXAM5fekvR8voxBvo2seEx6j+FKN8llXVYBiKD2vqgYbTDng/adePH5aqlilHOuqi P8urQU19y9lBipCsfuv2xENILJ8sWHklcKhgXd3R+05d0ss/v8dP3Pd+qFk7RoDMhfNM pTpaVpHkHNrF6IaUFoFJu1p4MAeqRc0CMf5EVlyqKGNwjgQTu3/pBl7QmBArz+OlHi6+ YMzQZsXGbsR/x7kUofDo0KrM2oVQHQi5QFhBRJRt4rCwHvfN3B4EpRQY7Z62zbAWNepa ca7T/mU473mwM4Gd0patOpPzq4LQbEVHeWelG5Gj8QWBz8UpDkGFUEVUgWQ2oMxigPG+ Y/PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Lsfz3018; dkim=neutral (no key) header.i=@linutronix.de header.b="24KK/A8H"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020a50fa8d000000b00459b0e0e04bsi8400420edr.199.2022.10.17.07.55.14; Mon, 17 Oct 2022 07:55:41 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Lsfz3018; dkim=neutral (no key) header.i=@linutronix.de header.b="24KK/A8H"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231189AbiJQOyT (ORCPT + 99 others); Mon, 17 Oct 2022 10:54:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbiJQOxz (ORCPT ); Mon, 17 Oct 2022 10:53:55 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4CD149B69; Mon, 17 Oct 2022 07:53:35 -0700 (PDT) Date: Mon, 17 Oct 2022 14:53:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666018413; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fT5/BcvC6Qp5TgWLuIIniP7KCiPJ7NyILpuDuar90fU=; b=Lsfz3018TTNu+jBaLoHCdAceM6VtNpNV+qLCgR7CsjkCdUJ6jk8/nQKnvMb6U1Zletn9LP T089vBp3LbiCUQ0l4xMKKKO8G3qxSlqedR9hwUnAILindXw8T6rq6ralqYL1bCdtUvpdUG 7yJ8+50pkWvt6zlPdHGasREh40KmhDvlPUHgLbiQbnFRsHmuv+7w53DpMsotPEYFt/Vsrg AjcCaMQ43VzaIp4UqvPzpw7qfCjBU/Shm7dWKxyUHPV80e6IzV95a+2yCnxZFfW9/nRG/o tufZnrbGuNkscXR+ZlEj1bdpdKdPXT2s/wb0dIGzE7MwZ7m6BZWb176cYXDp9g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666018413; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fT5/BcvC6Qp5TgWLuIIniP7KCiPJ7NyILpuDuar90fU=; b=24KK/A8HvN9x+GeunkRHKTJ2RYEZ5kSe8Sdp5Na3kOy6BT68us7/kZoKRuwTttmY+/Jk0l xRJRsLvuhZKr6mBw== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/core] x86/ftrace: Remove ftrace_epilogue() Cc: "Peter Zijlstra (Intel)" , Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220915111148.719080593@infradead.org> References: <20220915111148.719080593@infradead.org> MIME-Version: 1.0 Message-ID: <166601841196.401.8504499250910970303.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746947057758485306?= X-GMAIL-MSGID: =?utf-8?q?1746947057758485306?= The following commit has been merged into the x86/core branch of tip: Commit-ID: eac828eaef295cd0cc8b58f55fa5c8401fdc2370 Gitweb: https://git.kernel.org/tip/eac828eaef295cd0cc8b58f55fa5c8401fdc2370 Author: Peter Zijlstra AuthorDate: Thu, 15 Sep 2022 13:11:35 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 17 Oct 2022 16:41:18 +02:00 x86/ftrace: Remove ftrace_epilogue() Remove the weird jumps to RET and simply use RET. This then promotes ftrace_stub() to a real function; which becomes important for kcfi. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/20220915111148.719080593@infradead.org --- arch/x86/kernel/ftrace_64.S | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S index dfeb227..a90c55a 100644 --- a/arch/x86/kernel/ftrace_64.S +++ b/arch/x86/kernel/ftrace_64.S @@ -172,20 +172,14 @@ SYM_INNER_LABEL(ftrace_call, SYM_L_GLOBAL) */ SYM_INNER_LABEL(ftrace_caller_end, SYM_L_GLOBAL) ANNOTATE_NOENDBR - - jmp ftrace_epilogue + RET SYM_FUNC_END(ftrace_caller); STACK_FRAME_NON_STANDARD_FP(ftrace_caller) -SYM_FUNC_START(ftrace_epilogue) -/* - * This is weak to keep gas from relaxing the jumps. - */ -SYM_INNER_LABEL_ALIGN(ftrace_stub, SYM_L_WEAK) +SYM_FUNC_START(ftrace_stub) UNWIND_HINT_FUNC - ENDBR RET -SYM_FUNC_END(ftrace_epilogue) +SYM_FUNC_END(ftrace_stub) SYM_FUNC_START(ftrace_regs_caller) /* Save the current flags before any operations that can change them */ @@ -262,14 +256,11 @@ SYM_INNER_LABEL(ftrace_regs_caller_jmp, SYM_L_GLOBAL) popfq /* - * As this jmp to ftrace_epilogue can be a short jump - * it must not be copied into the trampoline. - * The trampoline will add the code to jump - * to the return. + * The trampoline will add the return. */ SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL) ANNOTATE_NOENDBR - jmp ftrace_epilogue + RET /* Swap the flags with orig_rax */ 1: movq MCOUNT_REG_SIZE(%rsp), %rdi @@ -280,7 +271,7 @@ SYM_INNER_LABEL(ftrace_regs_caller_end, SYM_L_GLOBAL) /* Restore flags */ popfq UNWIND_HINT_FUNC - jmp ftrace_epilogue + RET SYM_FUNC_END(ftrace_regs_caller) STACK_FRAME_NON_STANDARD_FP(ftrace_regs_caller)