From patchwork Fri Jun 9 07:47:41 2023 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: 105323 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp778433vqr; Fri, 9 Jun 2023 00:50:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6gzWuQJuP/f8riXhuoi1PkGmeB4wLlbaM9hCKQcTc+xXK5tMb/J+1S42Nt20dH2/Wkvp0y X-Received: by 2002:a05:6a00:a13:b0:658:d819:8890 with SMTP id p19-20020a056a000a1300b00658d8198890mr458336pfh.5.1686297036506; Fri, 09 Jun 2023 00:50:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686297036; cv=none; d=google.com; s=arc-20160816; b=O7Yn/N1d/voibyRjd+9XspoDX7iIa764rum3Scd4fxq1CH7rob1luGRGGgWarLCjSC lV6eTE7ORYIFQCsxWnBwdZBCJC3EqcOmQUOm6urOcMBGkFqzFbjfYSEO3Q3X0YKMgLag wwmvnvDiA8KXSEuU9RWR0gM8prJHaVVblbUmcj4QH+Z9HIIJrnwbNLOmIiXya1sAaXhu mwHHXEJGESP5K7VbIXNS/dW6tWj7NtXty6xtmAXLv2jaGX4FCT97+8I7RBVjIIUpcdLP VZ2k6ZxF0JcLCjuYFPQoVX74r7wEcAuA+K3pHnoJwm0BqbZJpWHDthOLiTnWfAwBwun6 Qmvw== 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=lqRQz1OjzzpGQ4iiY57BC9yGXPvO2QKKws/Tybsfw8I=; b=PboXy22gGfS7BmkSFteqXYz7H2u+dpz26OnwxRxvjic8JD6NyF03XR4JDOGRv/gGgt RzV4tuZY7V2eaUzJgYlDtKW8wOSc2j0qubpM9xT8oiX5N2pzO+/aSLqzGlIXR7HeJVVt fRyhH3gkIgG1qETwGtRbM36eijLf2iDgv473F+I5n9bWMU0j5bBjk6AStPDWTNrQ101b n8CnICXm/R/T7xJdiATKnGwExo+jU2FyAWBOQrrGUBCHI1+n0wxB3jESAikmiEONU7x3 ft8Pf2Yrr3M32EHrCdkKQLFeeBa3ky0hsAquj15eFGpH/T4hQcNzTIaL/XCxMucu1Nro Y/8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=v2fuNeHL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 m14-20020a638c0e000000b0053f8da90675si1007887pgd.598.2023.06.09.00.50.21; Fri, 09 Jun 2023 00:50:36 -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=v2fuNeHL; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S239286AbjFIHtb (ORCPT + 99 others); Fri, 9 Jun 2023 03:49:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239126AbjFIHrr (ORCPT ); Fri, 9 Jun 2023 03:47:47 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF1912139; Fri, 9 Jun 2023 00:47:43 -0700 (PDT) Date: Fri, 09 Jun 2023 07:47:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686296861; 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=lqRQz1OjzzpGQ4iiY57BC9yGXPvO2QKKws/Tybsfw8I=; b=v2fuNeHLUbSTOOAsx0dKhALq3wbgSNpaMjLUxp93MDWh0LMLtrHk+8YsxJgvRh1rkc03pD eOexA1DgrkkRSJDtTHqS1E2XxUgcUqBLau7ka3dhCMdpTgyISjVqYD8hjbU9V/cXDAF++7 4q2XZskxqNIbm9zLMUZBuGee+7idVtHh0J1Ym+RCP59k87FiMo2i7X+IdIyQQvrVO0/0WW TUJYAoe1s/0U2LfnnGaV1UNd5cWYZBf2cye5a9mwLCyT8v8zkYCNCU9ZRxnQw++5a+MT3s oikTB+lOoQanSeb5X6phyE55IQZCQCq0edbCV3CflFDM7S2cHfKJDyCGjwESuw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686296861; 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=lqRQz1OjzzpGQ4iiY57BC9yGXPvO2QKKws/Tybsfw8I=; b=ZgN+BxIz14x96iS5pjCMddFITiE5G/mnz+7SJIo5DvzEumjYsIuDWQRy98iAHGG9Z+DE/Q rMxaSFNpYjWQ2WBg== From: "tip-bot2 for Josh Poimboeuf" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: objtool/core] x86/entry: Move thunk restore code into thunk functions Cc: kernel test robot , Josh Poimboeuf , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <46aa8aeb716f302e22e1673ae15ee6fe050b41f4.1685488050.git.jpoimboe@kernel.org> References: <46aa8aeb716f302e22e1673ae15ee6fe050b41f4.1685488050.git.jpoimboe@kernel.org> MIME-Version: 1.0 Message-ID: <168629686115.404.13695695960788796083.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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1767362976743083255?= X-GMAIL-MSGID: =?utf-8?q?1768210601414178314?= The following commit has been merged into the objtool/core branch of tip: Commit-ID: ac27ecf68a1ada240bb71531dc2d30cde04ad70a Gitweb: https://git.kernel.org/tip/ac27ecf68a1ada240bb71531dc2d30cde04ad70a Author: Josh Poimboeuf AuthorDate: Tue, 30 May 2023 16:07:41 -07:00 Committer: Josh Poimboeuf CommitterDate: Wed, 07 Jun 2023 09:54:45 -07:00 x86/entry: Move thunk restore code into thunk functions There's no need for both thunk functions to jump to the same shared thunk restore code which lives outside the thunk function boundaries. It disrupts i-cache locality and confuses objtool. Keep it simple by keeping each thunk's restore code self-contained within the function. Fixes a bunch of false positive "missing __noreturn" warnings like: vmlinux.o: warning: objtool: do_arch_prctl_common+0xf4: preempt_schedule_thunk() is missing a __noreturn annotation Fixes: fedb724c3db5 ("objtool: Detect missing __noreturn annotations") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202305281037.3PaI3tW4-lkp@intel.com/ Link: https://lore.kernel.org/r/46aa8aeb716f302e22e1673ae15ee6fe050b41f4.1685488050.git.jpoimboe@kernel.org Signed-off-by: Josh Poimboeuf --- arch/x86/entry/thunk_64.S | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/arch/x86/entry/thunk_64.S b/arch/x86/entry/thunk_64.S index 5e37f41..27b5da2 100644 --- a/arch/x86/entry/thunk_64.S +++ b/arch/x86/entry/thunk_64.S @@ -26,17 +26,7 @@ SYM_FUNC_START(\name) pushq %r11 call \func - jmp __thunk_restore -SYM_FUNC_END(\name) - _ASM_NOKPROBE(\name) - .endm - - THUNK preempt_schedule_thunk, preempt_schedule - THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace - EXPORT_SYMBOL(preempt_schedule_thunk) - EXPORT_SYMBOL(preempt_schedule_notrace_thunk) -SYM_CODE_START_LOCAL(__thunk_restore) popq %r11 popq %r10 popq %r9 @@ -48,5 +38,11 @@ SYM_CODE_START_LOCAL(__thunk_restore) popq %rdi popq %rbp RET - _ASM_NOKPROBE(__thunk_restore) -SYM_CODE_END(__thunk_restore) +SYM_FUNC_END(\name) + _ASM_NOKPROBE(\name) + .endm + +THUNK preempt_schedule_thunk, preempt_schedule +THUNK preempt_schedule_notrace_thunk, preempt_schedule_notrace +EXPORT_SYMBOL(preempt_schedule_thunk) +EXPORT_SYMBOL(preempt_schedule_notrace_thunk)