From patchwork Fri Oct 20 11:37:20 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: 156030 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp990861vqb; Fri, 20 Oct 2023 04:38:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGz+tqZiRpvAlUKjlTeJLQd+mq8Ni2qgmI/cdmGUi8jDL4GjOrO6BTEPb3t+O1RGmoOFYFm X-Received: by 2002:a05:6870:230e:b0:1c8:c2df:a927 with SMTP id w14-20020a056870230e00b001c8c2dfa927mr2009922oao.53.1697801929218; Fri, 20 Oct 2023 04:38:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697801929; cv=none; d=google.com; s=arc-20160816; b=ZAfeXUvvqyRPcGE3/201OHbV2EkcHEpTSof8W1+QouHl8SqN0rhRwoXvG5ZcGKwMUU Sq05ybQYgLJ3xy1wUWj1Bg64eilph0vDuyds4ZmbTYZoEBs/ENcXKSuX2XC0grqHsfpz db9uovcaP4HQG/HqtKHgFqFczoofHbODjg54YKpFyZMgNwyT3b9iP3FzSzLag75N0ASX pMmvQViHmFFJ1tuwhMgoDTawxaLZeWuI+mAVOVZ8siTAhczVhLxSOgLbEPdGQnlcRqup Ujf0LN/mYwF8l4EyfY5WEaFFQdvXw/vLkW6q0eEY+AZNx/vXPtcqtqylM2K7CtRqz9WU Ytfw== 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=9Rf47wcdRcofhh4s3xmDkv2JGCHTkCVyV4o8rvfSp3U=; fh=TJa98jjcJcAUyvo2yQiOqi+wukdLlQU80th5XskGe8U=; b=FPVYTlT0cBcPzGPQG3mREnU0wpxzO+Dwl5Hqx3b+Owwb4R4vBZrY65LaCkw2SNmN+k Wyqp5KkKQ6VE58oDvbHpOHKH40/uz51ZxwBuPa+5vfwWwcuj2ZPsfNbD5e4/ebO4liwU 64yIYETwpukmshjD5/bLQaAzF0h+7fUnDYzIYfdaSbbicPEvdb4XNkZII8rlmdkd5tZz b0uk+TCju+H0lF4TabSwxUB07YMi+TQqoSlEt8TjGeAj9Fw6UE0moMk918L1xVliGqea vxeGZldIzjQQ/r/3R+Orh+96XIP+wPO7cL5zwu2gWJXDxqXzrzbquYUhW2h6D4oCR1TR TMsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ifuvw17l; dkim=neutral (no key) header.i=@linutronix.de header.b=NImgSDQl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id j63-20020a638042000000b00574035fd472si1670847pgd.31.2023.10.20.04.38.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 04:38:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ifuvw17l; dkim=neutral (no key) header.i=@linutronix.de header.b=NImgSDQl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id AA3D482C06FE; Fri, 20 Oct 2023 04:38:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377304AbjJTLhv (ORCPT + 25 others); Fri, 20 Oct 2023 07:37:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377187AbjJTLhY (ORCPT ); Fri, 20 Oct 2023 07:37:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BDCDD49; Fri, 20 Oct 2023 04:37:22 -0700 (PDT) Date: Fri, 20 Oct 2023 11:37:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1697801840; 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=9Rf47wcdRcofhh4s3xmDkv2JGCHTkCVyV4o8rvfSp3U=; b=ifuvw17l0/7Jz3OewaskuyQ6bAYVK0jyM4qkY7KBZj1PMv3k7bBhhSysNkfxPiCMr5MxCa /zDQ/5RvI8i1jI3Z5gf4CG2KyMXM/ZMs07AcZgdq7Ex/6VpvUyRfYdCnQ+hSpghnWBLIDo s3XNIhbyrKEssAu/qnylXzW6c3Pl4lUpmi13ZVBPWWZpIcVau+5PvQO4g6E8u1qEHFSry9 JwxTq1cmUft82iRFaF37hvhDgiVWDoocFsho2OZGFYB8Yh4xy/mf4U1hSnps91Pc48GSCs m+kGmBapfEX4BdRHPPQ16+Dcv/sqUhcp/QzoLRC6katXOb7xCc6IRg6ycgzJ3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1697801840; 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=9Rf47wcdRcofhh4s3xmDkv2JGCHTkCVyV4o8rvfSp3U=; b=NImgSDQlztwnUAkJ2vMzka1lz0oLxr7Y4bp5tS5TCt+0odSz62gGsotnuVvtsyGqE9hZej UE8DYzSvTaCmF+Bw== 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: x86/bugs] x86/srso: Unexport untraining functions Cc: Josh Poimboeuf , Ingo Molnar , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <1ae080f95ce7266c82cba6d2adde82349b832654.1693889988.git.jpoimboe@kernel.org> References: <1ae080f95ce7266c82cba6d2adde82349b832654.1693889988.git.jpoimboe@kernel.org> MIME-Version: 1.0 Message-ID: <169780184033.3135.9663222409439647598.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 20 Oct 2023 04:38:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777465477799431731 X-GMAIL-MSGID: 1780274355335324820 The following commit has been merged into the x86/bugs branch of tip: Commit-ID: eb54be26b0d25222809b16f335fe13756ff4a206 Gitweb: https://git.kernel.org/tip/eb54be26b0d25222809b16f335fe13756ff4a206 Author: Josh Poimboeuf AuthorDate: Mon, 04 Sep 2023 22:04:56 -07:00 Committer: Borislav Petkov (AMD) CommitterDate: Fri, 20 Oct 2023 12:21:59 +02:00 x86/srso: Unexport untraining functions These functions aren't called outside of retpoline.S. Signed-off-by: Josh Poimboeuf Signed-off-by: Ingo Molnar Signed-off-by: Borislav Petkov (AMD) Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/1ae080f95ce7266c82cba6d2adde82349b832654.1693889988.git.jpoimboe@kernel.org --- arch/x86/include/asm/nospec-branch.h | 4 ---- arch/x86/lib/retpoline.S | 7 ++----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h index 197ff4f..6c14fd1 100644 --- a/arch/x86/include/asm/nospec-branch.h +++ b/arch/x86/include/asm/nospec-branch.h @@ -352,10 +352,6 @@ extern void retbleed_return_thunk(void); extern void srso_return_thunk(void); extern void srso_alias_return_thunk(void); -extern void retbleed_untrain_ret(void); -extern void srso_untrain_ret(void); -extern void srso_alias_untrain_ret(void); - extern void entry_untrain_ret(void); extern void entry_ibpb(void); diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index 9ab634f..a40ba18 100644 --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -157,7 +157,6 @@ SYM_START(srso_alias_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE) lfence jmp srso_alias_return_thunk SYM_FUNC_END(srso_alias_untrain_ret) -__EXPORT_THUNK(srso_alias_untrain_ret) .section .text..__x86.rethunk_safe #else @@ -215,7 +214,7 @@ SYM_CODE_END(srso_alias_return_thunk) */ .align 64 .skip 64 - (retbleed_return_thunk - retbleed_untrain_ret), 0xcc -SYM_START(retbleed_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE) +SYM_START(retbleed_untrain_ret, SYM_L_LOCAL, SYM_A_NONE) ANNOTATE_NOENDBR /* * As executed from retbleed_untrain_ret, this is: @@ -263,7 +262,6 @@ SYM_CODE_END(retbleed_return_thunk) jmp retbleed_return_thunk int3 SYM_FUNC_END(retbleed_untrain_ret) -__EXPORT_THUNK(retbleed_untrain_ret) /* * SRSO untraining sequence for Zen1/2, similar to retbleed_untrain_ret() @@ -277,7 +275,7 @@ __EXPORT_THUNK(retbleed_untrain_ret) */ .align 64 .skip 64 - (srso_safe_ret - srso_untrain_ret), 0xcc -SYM_START(srso_untrain_ret, SYM_L_GLOBAL, SYM_A_NONE) +SYM_START(srso_untrain_ret, SYM_L_LOCAL, SYM_A_NONE) ANNOTATE_NOENDBR .byte 0x48, 0xb8 @@ -298,7 +296,6 @@ SYM_INNER_LABEL(srso_safe_ret, SYM_L_GLOBAL) ud2 SYM_CODE_END(srso_safe_ret) SYM_FUNC_END(srso_untrain_ret) -__EXPORT_THUNK(srso_untrain_ret) SYM_CODE_START(srso_return_thunk) UNWIND_HINT_FUNC