From patchwork Tue Sep 19 09:53:12 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: 141836 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3312557vqi; Tue, 19 Sep 2023 04:32:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFwEqC6sbIMxs4xbmKJ9M6kzaDhtIxwMLrAr/bcvCSYVk054GLgmQTLhTxjcW+R4ABTQ+CA X-Received: by 2002:a05:6e02:1c0d:b0:34c:ecc8:98e7 with SMTP id l13-20020a056e021c0d00b0034cecc898e7mr15952295ilh.9.1695123174497; Tue, 19 Sep 2023 04:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695123174; cv=none; d=google.com; s=arc-20160816; b=eeTvaAXAOr7UPY7OXj0/SjhGYOZCOEqb2KOJYxXaCdCqxoz8m7rHD5yzcYfycvRmAP NO1SIxcXh/09EWk/5NrlKzXJknKnN6uVro5gaiXoOAFd3P03BXr8s3WfT7M+n/ZjtstK un9kdk33tRPbDOZscqRmlg7xEILi3c7A02K1yRiOeyG/nYfXWUhOJ0hyD3iiXu3+9WjP 0HoAFdq/dsGe40rUVVwgCkE2gsv2IE0w2Z1xU2v7pMUc4rHLiQzWZxwV2eSgtQ36e0Zt Z57+0V5XQGhKHB4KY78Gd5g9aa2Ajqw88yjazSqQN/ZHTxTgoJwzJ+mXHBcs7OGn9z9M zo+w== 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=MxkZN9ibynG/53sdyXvwzmGf55Ys2TH/ixMqgV9qELc=; fh=TJa98jjcJcAUyvo2yQiOqi+wukdLlQU80th5XskGe8U=; b=vCJ3a1NPtjcCPej3pXtHbp77ulzna4pULLcmETlhxkdAstFVOz7PK/DltyLWdUY3+/ F7Wdlkn7WIFjr1JqvXQJDJIrcWG/rKp6tZ2gt6zALOl1YevvtBlvOqqBJfr38ANhEsTn 6BVppihcLbsQrxkqXjGjj1P89QhUErP07Ta6GlTnRC5BIqbUfssrly8amLxOnEhuFPa6 LmTj1grpYLQH7Tvx2V1TxMOx7XzTILFeNVyqKlZvFnVd7Diu//0dgBubJUisJA2kx98p 9ihL3TQZ9AD1755AXlK/96y842sBWnPraMvGLyw3bxfwZWTc7ULobrfPCgAXEll/FsHL XtqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=k30RmUAj; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id d190-20020a6336c7000000b005709caba61dsi9576201pga.574.2023.09.19.04.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 04:32:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=k30RmUAj; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 06AFA8072A3A; Tue, 19 Sep 2023 02:55:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232011AbjISJyc (ORCPT + 26 others); Tue, 19 Sep 2023 05:54:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231631AbjISJxV (ORCPT ); Tue, 19 Sep 2023 05:53:21 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0192CD0; Tue, 19 Sep 2023 02:53:14 -0700 (PDT) Date: Tue, 19 Sep 2023 09:53:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695117192; 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=MxkZN9ibynG/53sdyXvwzmGf55Ys2TH/ixMqgV9qELc=; b=k30RmUAjjLVj5HRx6kKaVji3mLomjhXYQgfkU8Dhhn3WWJgxWUBhAt8LEBNc0MRUulbLfN HiPkkUZN4BfKwk7gEa5kJFKTlXhZh1unihoT7JNvomFpjl9SfJbyNF8Q/JFq56bIjoSxv8 rJ6vU9LrDF0bn4TVvHaTak9ht9BParQ2D3JP0OURcpMOskTA4qQYC725/MYlzInxUIzWQP vLZG7JNhJ3cFZ1Uf5qd+QqINsq5cT7sL5Y21doA03EA7qijbT8SQYSQxnSj7C9RYkRaSWB yvhtd1eh02WC/Y7q7pJb7wk9aftjx0jBEwmbuUBK93hqbq2Gx1oDDOCiQW+v6g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695117192; 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=MxkZN9ibynG/53sdyXvwzmGf55Ys2TH/ixMqgV9qELc=; b=gYoZ/cd1bjNr0gOatSFwkr2btAkpyN9IxfacSHDccPoeHJcrWP0SjCg47YqgXDVgbv8QNQ uUsZhrLjBzZaOoDw== 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: <169511719210.27769.7276549772387680701.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-0.9 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 groat.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 (groat.vger.email [0.0.0.0]); Tue, 19 Sep 2023 02:55:58 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777465477799431731 X-GMAIL-MSGID: 1777465477799431731 The following commit has been merged into the x86/bugs branch of tip: Commit-ID: d1a8e4d9929989ffd74da6b340acf6a4ce03e299 Gitweb: https://git.kernel.org/tip/d1a8e4d9929989ffd74da6b340acf6a4ce03e299 Author: Josh Poimboeuf AuthorDate: Mon, 04 Sep 2023 22:04:56 -07:00 Committer: Ingo Molnar CommitterDate: Tue, 19 Sep 2023 11:42:47 +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 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