From nobody Fri Dec 19 03:34:55 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9474FC0729B for ; Mon, 14 Aug 2023 12:20:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234214AbjHNMUK (ORCPT ); Mon, 14 Aug 2023 08:20:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233940AbjHNMTe (ORCPT ); Mon, 14 Aug 2023 08:19:34 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E681910F4 for ; Mon, 14 Aug 2023 05:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:References: Subject:Cc:To:From:Date:Message-ID:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To; bh=UW8swBZKEShmVwzbkW/tIP2uQ5C31tN5ZsH9IAoW9A8=; b=TzWAzfoGgbzh3Rm3v0WnarL5Wb bGs0mnFhkKcvmw+DdE3Qp6GUYX6CNTyQT2QjKvZr6W9+mJYwUYsF/PCcMDQGaw8lPMXMSz8MsJJEb 1tOL63HgJFmbicRrFFs/y9+HdnSwCGG/G1vx8z9mazau8ccqNgSxVletEkL5mbudSEg9QYwGzmBIf LKSA/nbxpc3nyFzqSOionVx+Hnnuxq/GHKMNt9oV+LMFxPY2hzGT9TFdDTuftp8KPQub2cHqXqv2V hHTSlpHAJU38WkKGaZDfu5/oQcLlqkkxOcAy8p8vtFqZXYOIYNhHwI3nY09J/qzO6ln2p8kv5Vl8z y74lTWdw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qVWXY-00AaKX-0y; Mon, 14 Aug 2023 12:19:21 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CCA5E300599; Mon, 14 Aug 2023 14:19:19 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id B50BC21C1D1B3; Mon, 14 Aug 2023 14:19:19 +0200 (CEST) Message-ID: <20230814121148.637802730@infradead.org> User-Agent: quilt/0.66 Date: Mon, 14 Aug 2023 13:44:28 +0200 From: Peter Zijlstra To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, David.Kaplan@amd.com, Andrew.Cooper3@citrix.com, jpoimboe@kernel.org, gregkh@linuxfoundation.org, nik.borisov@suse.com Subject: [PATCH v2 02/11] x86/cpu: Fix up srso_safe_ret() and __x86_return_thunk() References: <20230814114426.057251214@infradead.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" vmlinux.o: warning: objtool: srso_untrain_ret() falls through to next funct= ion __x86_return_skl() vmlinux.o: warning: objtool: __x86_return_thunk() falls through to next fun= ction __x86_return_skl() This is because these functions (can) end with CALL, which objtool does not consider a terminating instruction. Therefore replace the INT3 instruction (which is a non-fatal trap) with UD2 (which is a fatal-trap). This indicates execution will not continue past this point. Fixes: fb3bd914b3ec ("x86/srso: Add a Speculative RAS Overflow mitigation") Signed-off-by: Peter Zijlstra (Intel) --- arch/x86/lib/retpoline.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -259,7 +259,7 @@ SYM_INNER_LABEL(srso_safe_ret, SYM_L_GLO int3 lfence call srso_safe_ret - int3 + ud2 SYM_CODE_END(srso_safe_ret) SYM_FUNC_END(srso_untrain_ret) __EXPORT_THUNK(srso_untrain_ret) @@ -269,7 +269,7 @@ SYM_CORE_START(__x86_return_thunk) ANNOTATE_NOENDBR ALTERNATIVE_2 "jmp __ret", "call srso_safe_ret", X86_FEATURE_SRSO, \ "call srso_safe_ret_alias", X86_FEATURE_SRSO_ALIAS - int3 + ud2 SYM_CODE_END(__x86_return_thunk) EXPORT_SYMBOL(__x86_return_thunk)