From patchwork Sat Sep 23 12:20:09 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: 143966 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp298305vqu; Sat, 23 Sep 2023 10:35:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE7GZg22azK3slu2E5svaBdrLs3igHhHd6UrVYtCB/HOfz0B4VuzuNrG5GIYkweSn/R9svG X-Received: by 2002:a17:902:ea0f:b0:1c3:749f:6a5c with SMTP id s15-20020a170902ea0f00b001c3749f6a5cmr2380087plg.12.1695490551483; Sat, 23 Sep 2023 10:35:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695490551; cv=none; d=google.com; s=arc-20160816; b=sWRKfozQiJAISyMnGY0Qtq3QYcqqXOeVtWdP+qPFk6rF+Cr7Z2TsOsZuAse3wZJerO IZ/pQhtk/gq3U0rBBbrIOQXCBiZG+Suhtl3jYRmxQosj1IC5b8RabzwlYUSNKat3Al4y +CV+307u2nCGNo2BJ+XSi7HC8s71jNUlLAP+S7+IboJSNRYiWgf90GppkTVD1fD/0fOQ wSviwlqz9TQXU8BUe2sjt8cOaw/uz2s637iPjds/zoYpg/xvCJpnTLCoIu0qJQO7PO8y 7S5boP68xclW+BWP+xvRhF8ByKC3KAukqUg7ApU2gE+F2nGgqgWPUNbFKrZKb9mtakdX MOrg== 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=Gf8n8UKovPTgE4ScfY67jkYVoHD50ZARwyIjgGjhiFU=; fh=TJa98jjcJcAUyvo2yQiOqi+wukdLlQU80th5XskGe8U=; b=qCuo2RJiIUL2U5KX6ZdPTAML2SurQm2jys2SHH14EtDbneHx/KEtWPCNzdX5pjoytf eOeU7VfzXHQSYbY7YP+8HVYEYXATvPQz9iTEk+Msv8+73BBmbcNibkqW7VqujcgZjOhH CdWbCeulBmNflzGDuVwkJGntWUvJ+zVnrIbKb44X28WKTOgzoiDQx2lM+eZ4KrNWLX95 rAurXt3Ymho+5DYkaEUgiJj7V8Vm2P0WxqlQtwGmwfJE7Od5RyzDmJyXk2sPkiZ48K41 n0hHiHn20gafSdcIcfJ0z8OkUGgMSAWs0xpXqva/CuHpRHPS2+4EolXg7epSLLjbph+z h/9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=X8a5X3qu; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id lc13-20020a170902fa8d00b001be025f8407si6149781plb.37.2023.09.23.10.35.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 10:35:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=X8a5X3qu; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 E68A9810AF58; Sat, 23 Sep 2023 05:21:06 -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 S231734AbjIWMUt (ORCPT + 29 others); Sat, 23 Sep 2023 08:20:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231665AbjIWMUY (ORCPT ); Sat, 23 Sep 2023 08:20:24 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3DC5D1AB; Sat, 23 Sep 2023 05:20:12 -0700 (PDT) Date: Sat, 23 Sep 2023 12:20:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695471610; 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=Gf8n8UKovPTgE4ScfY67jkYVoHD50ZARwyIjgGjhiFU=; b=X8a5X3qunecEZkb2RjM4jaJR829t05eerzB7tNqSCsmu4xohT8x+jA3Ijr9RPTnlSDhebr 0hZS99NQLJsQyE1bt4ioGf5soOEIBwmq1VTFrUMXTQifardgctwRAm67rOHVkGEpD8+bR4 S2ga39s6Mu2r+2LL0/dU2l+j4Z1X/8g3grfm/m1Efy+79/uijX4BNh8+1bbfKSwsflTo4e 7goOjPVGFwoMKvo5kQhDrgsgAi+I1Dwaa81aNvl8XOQLtVl55RosBNZ4LwusY89ePCVAYO u6eLTeWhkmbMAFHspZ24V11xDq+SeaNBpar1OfAanC+JLZY0ZdUGSW4P6i59Fg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695471610; 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=Gf8n8UKovPTgE4ScfY67jkYVoHD50ZARwyIjgGjhiFU=; b=/XfoqgAw30OERnwu6Uvp8cLNj2Lx/ZI4TZC4G/oi4cmkZRiyT7OEmTlqc69eTMWcUwwpcK 6F2h8CuxUNSZqyBg== 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: <169547160980.27769.14687356116320625469.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no 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]); Sat, 23 Sep 2023 05:21:07 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777465477799431731 X-GMAIL-MSGID: 1777850700597875351 The following commit has been merged into the x86/bugs branch of tip: Commit-ID: ee35f33f13f094151794a02fdb0204ce8ca89af9 Gitweb: https://git.kernel.org/tip/ee35f33f13f094151794a02fdb0204ce8ca89af9 Author: Josh Poimboeuf AuthorDate: Mon, 04 Sep 2023 22:04:56 -07:00 Committer: Ingo Molnar CommitterDate: Sat, 23 Sep 2023 14:13:03 +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