Received: by 2002:a05:7412:1703:b0:e2:908c:2ebd with SMTP id dm3csp814223rdb; Fri, 25 Aug 2023 01:40:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5dE7vHmmVxEKVEYsKV/W44pMEGkg6vr6oVziIBV3VAAjZvDqVTjEfunrzuw7hXtbc9mtQ X-Received: by 2002:a17:906:9be3:b0:99c:a2ca:4f54 with SMTP id de35-20020a1709069be300b0099ca2ca4f54mr14711623ejc.34.1692952856505; Fri, 25 Aug 2023 01:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692952856; cv=none; d=google.com; s=arc-20160816; b=fvmppw0hrLukBJUhJBMa6TUTItJ7rYwodMvQ6fpgB94WsOTn0BqqXoSHNRvRsKGomG aXgQ0rmQArU1wkrECi1mMBYrJAibRg6C6AHwDgvNrKStAt1XntZxK9Uyhy15Rb/UzCVX za+7pw8Z1J8D3XKOBUOLhDNTl6+dtxXqBlmFJVjCFSZmBAL7zVu3VMQLp26uTQdsMl8y WnN19oO+2XQdIQm5aVbkvtBVhEGc9zS1UXoPdcqLsWIF3mAlhHLjaFX3O7H8A5NISA4x AtP/YweuKkJA6640+S/PlSbKBuTHPWG8hozer1aZgFgzXOUtiBAwh7T14MR2cWi0/9EE fjng== 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=9wOVmTdWuIliCepxsI23oJUlS0vt7jepZ4v8i1HuH7k=; fh=ZwaEcDYNCnlh+U7YxZ1LCEcet9pcdhSkEX0cCEOksvY=; b=zqeuq32oikop5M4R0fkJaTkRKksEhZqEnCbuKnPA11emj1c05+Y6ipBZLYSV49OHch KqJKsB6RkDNWa5bPM1l04vVVveBd57/CKktlv//FVeoiURGsoKjObPZANtJk5jbZRPCd jiHG+MXDcIPSF04IRmxxIcgxxeMQmORfkOixaEmGKDda8YqgBvDaV0tdilFSGBtgiya2 ggoNGuYFVyetIc8hZDactFGzOdG56TgOtFWoXqlJmVejwMMdWwk7wDdH7y6/RW9K6Dib EsdaleLEtUd0mrVNONgN/WJiBVz3vRWn8SMdeFTysx6k162PpRgGY5+7k07BDyMD9hN3 fPjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fQSeisAp; 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 b18-20020a170906195200b00993860a6d3fsi650308eje.281.2023.08.25.01.40.23; Fri, 25 Aug 2023 01:40:56 -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=fQSeisAp; 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 S242911AbjHYHCv (ORCPT + 99 others); Fri, 25 Aug 2023 03:02:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242559AbjHYHCL (ORCPT ); Fri, 25 Aug 2023 03:02:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3ADCFE6B for ; Fri, 25 Aug 2023 00:02:10 -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 1D06B66658 for ; Fri, 25 Aug 2023 07:02:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F1FEC433C7; Fri, 25 Aug 2023 07:02:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692946929; bh=roaZa6DJKVHyMmMO2D1vNZ9eeHp8DbQmu8mMGYbUivE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fQSeisApm+/NTyGDFfw0K/xsyeWWEA1z/wN09Pm6UMQ8eZl0o25/nwqpRPXpgSnbl zrPdrqyVPGxxYX72AvCVY1VQFHovnwDhHE7vU5reAqi8ZphVghCUQIdN5mn1IZY9Z4 IRVDW+WbunxZBBEOzVyzpwIldC0SDZ3Kv0h3jsUI6CIcuy92diG/KlsBzia/Bpw3/O bmoHj9poMa8KtLNGH4vjDAcD8fNzzX27u/Ix6KlhadGyjMpJjVI5CY3S3I8nXjhC4h glwoVCCAIalqq4lhoQApGbbjsFemfJ1FiA4GgMuS8mXdF/1Bhej0OcTHaJ2g2KiTzG YtFmKgu/la65A== 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 13/23] x86/srso: Improve i-cache locality for alias mitigation Date: Fri, 25 Aug 2023 00:01:44 -0700 Message-ID: <4f975cf178ab641d3720362f244694408d85ecca.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 Move srso_alias_return_thunk() to the same section as srso_alias_safe_ret() so they can share a cache line. Signed-off-by: Josh Poimboeuf --- arch/x86/lib/retpoline.S | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/lib/retpoline.S b/arch/x86/lib/retpoline.S index cd86aeb5fdd3..9ab634f0b5d2 100644 --- a/arch/x86/lib/retpoline.S +++ b/arch/x86/lib/retpoline.S @@ -177,15 +177,14 @@ SYM_START(srso_alias_safe_ret, SYM_L_GLOBAL, SYM_A_NONE) int3 SYM_FUNC_END(srso_alias_safe_ret) - .section .text..__x86.return_thunk - -SYM_CODE_START(srso_alias_return_thunk) +SYM_CODE_START_NOALIGN(srso_alias_return_thunk) UNWIND_HINT_FUNC ANNOTATE_NOENDBR call srso_alias_safe_ret ud2 SYM_CODE_END(srso_alias_return_thunk) + .section .text..__x86.return_thunk /* * Some generic notes on the untraining sequences: * -- 2.41.0