Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp814831rdb; Fri, 25 Aug 2023 01:42:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4f7DzKzA5N1DFfgOndbTrr5MI/m+pAPgIJdpsdOIzQzOojGU6V1256+Siu9159RxVEGuG X-Received: by 2002:aa7:c589:0:b0:522:29d3:4185 with SMTP id g9-20020aa7c589000000b0052229d34185mr13438059edq.32.1692952939071; Fri, 25 Aug 2023 01:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692952939; cv=none; d=google.com; s=arc-20160816; b=GiJA23vOZDqMm2eoe6Tr8qe2/GAQMOZm2d8UzLhfUpgpSTqrwIepXpdgRgjMyPoo5k SneIImROOEEuZSJ2FCSP5RQzlhlZSu+dW1l0yZnOf81dK3PT47o9WuMINWH1xE1L3/km U3ZZira4wi6bbLqSOByl2jM+Z70RcwZPGGNVII8b7qP9k6uxqI8BC0lAk3qj9gkGBPny BjPB/DFyThHVH2MfQdbWKlxUt9ML5KEqn9lVbGmK/GKFgX2KB+RSHp9P2/Zw+Mg+j5LL SaCWDMZw7PAH3SNXp5/4ULUvnFKUsw8tKg1OS6kOcX4csJmyLA1MybCRaF9RL/b6+w2m fmTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KzWBWUeKtPOdT7hPtoDpysYQG4mscbB5ZQ0/ThNz86M=; fh=ZwaEcDYNCnlh+U7YxZ1LCEcet9pcdhSkEX0cCEOksvY=; b=EpNxkreDe7gEX5ajrqLeVPJyy6o7jQvkj7NVCN4aIGdSuFa6cHYNhe1xsMJO+HXFrv DxBTdRS8f6YCJSoxR9jko403utqUEi/s7oJ9u4Nes98o40bCqsR9sddfNgcDeNc8230c RmnY7k72Xme0Aq1V4JX21f4dcVVcNi9bVYuOIIYZ9iVCoDbV9hSEhAQw2fssqCV26EuI G3M7GiyRRIm4V84Q/msKf3tPLNbO87ZPrtkVV/AxfEVkvpxwISPwIhwAnmzr+SD9It0P jCBYWwf2Vw5AJ/df3qtc+Z3bDOSDprc1hvQtuktFN4UfMN+2fEfvOmR2Tk4BrmdUo5ty 6sAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=j5z8PKCu; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g17-20020aa7c591000000b005255ea1ee4asi802675edq.289.2023.08.25.01.41.45; Fri, 25 Aug 2023 01:42:19 -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=@kernel.org header.s=k20201202 header.b=j5z8PKCu; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243194AbjHYHDG (ORCPT + 99 others); Fri, 25 Aug 2023 03:03:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242659AbjHYHCN (ORCPT ); Fri, 25 Aug 2023 03:02:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AC4BD3 for ; Fri, 25 Aug 2023 00:02:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 178A266618 for ; Fri, 25 Aug 2023 07:02:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15196C433C8; Fri, 25 Aug 2023 07:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692946930; bh=kzD8Rkhdf6omv3NkeVtM4TRHGvAyOn4bC2fsiLph4tE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j5z8PKCuUB594PcxlZNvWwaVh4G88UupO6bfbuuVyTKBvKmL2nrbEb5xZh/lq5LCS q5RXSiQ0pMjSSymEp+kgU3K59nAsP0ayuqy/1yY2Fqinl+BRI9xylXB+FyGmKeKYrH iuESWQK/lr93h0Kid2qpx8rAgW6OTSt2ZmmfpboGNQgx/PQ4/NzBs1q+MWx04OUyjF MylUmKyWuwcQ0nAUeuJNlKfDwU5CNuch7+Ey1oP0UwcM6jtmOIDrzLV4G6gwjDETr5 mYUYrSw9gb8JZdJzuq9Jzx0csp0ch/k72JQe0FMxPdkUTy7AV2SiKJ3zCSzP+0DEEv 3qvG7AdBocaNg== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Borislav Petkov , Peter Zijlstra , Babu Moger , Paolo Bonzini , Sean Christopherson , David.Kaplan@amd.com, Andrew Cooper , Nikolay Borisov , gregkh@linuxfoundation.org, Thomas Gleixner Subject: [PATCH 14/23] x86/srso: Unexport untraining functions Date: Fri, 25 Aug 2023 00:01:45 -0700 Message-ID: <94caf421d80924666be921e387851665054ba9b7.1692919072.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 These functions aren't called outside of retpoline.S. Signed-off-by: Josh Poimboeuf --- 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 197ff4f4d1ce..6c14fd1f5912 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 9ab634f0b5d2..a40ba18610d8 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 -- 2.41.0