Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1961399rdb; Tue, 5 Sep 2023 09:58:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkA0uIO4YE4nMhdwo71/EyJJ9z9V3KTfst6MjnM6QZZCwuv0XsJEKiIEjE8eMyVn1P41NH X-Received: by 2002:a05:6a20:7da7:b0:123:149b:a34f with SMTP id v39-20020a056a207da700b00123149ba34fmr17988199pzj.1.1693933083468; Tue, 05 Sep 2023 09:58:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693933083; cv=none; d=google.com; s=arc-20160816; b=tcIaEHN9jwjnWne8sx5yu92uDfArJtjDO2VPo0ESsmRS46aSiByzS2BFPRMSoDCuNa qWr8UGTLH5ha4J6V9YRs40LhQ9BBE0/vRuiN1urTcCVE5z5ZaCq9CW6wcjr4y1E58At5 PsOCReO9OoAZe6uVlHNvdccH9co6jOLC30eCYEDkbdYpqDR6kSK5VguLREHp7J4931Bg ZLYJ/d7GEugizwNZ9YAKIzxpQjEnqLqrUWmRh12/8iSvX+WasMLNrKoq+iys5o2JBwr8 43X4sdfVS7UGbd7M3AIL3ofQtVdvDzbeW0nsyfY75pNIHkX9Ahq3WAJTjM1uFoPx+NtU y9yQ== 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=r/L2NyQEEa04HhUh0wkxXgNyIh+4Gy+VraE/DKH9hCPJ6EyL1FdKeeWC4YL+FzoOUk xTnp4P5Svy2tFPAagjsD7kagw8u9x3pxQZ80U9BraeNUwhllNSw/t/KEsTKMQwVhrjDu zfKfra8imGPC9DhxioDkQNtE9pbcORadXeNphlHA7GS8iml4s/ZvWp/BMaR+2y4FGfCp MnEHaotdd6lqLb7T+ueehO6Guttpp/TPhbTNmpWFtWxtnGtUuDZ3ga5V2z97BducsVwQ 5Ly94lImTbVxedL27fVhJP2qGNr4xj7VKGcH/WjJ3ecqcUuZX/aTSUsVtdNzGQ5LmdTD uwbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=F0Xi9J+q; 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 x24-20020a63b218000000b00573efae0ee1si194085pge.515.2023.09.05.09.57.50; Tue, 05 Sep 2023 09:58:03 -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=F0Xi9J+q; 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 S243443AbjIEQjm (ORCPT + 99 others); Tue, 5 Sep 2023 12:39:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351014AbjIEFFU (ORCPT ); Tue, 5 Sep 2023 01:05:20 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0309FCD2 for ; Mon, 4 Sep 2023 22:05:17 -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 sin.source.kernel.org (Postfix) with ESMTPS id 5DCCBCE10AF for ; Tue, 5 Sep 2023 05:05:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 40E37C433CB; Tue, 5 Sep 2023 05:05:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693890313; bh=roaZa6DJKVHyMmMO2D1vNZ9eeHp8DbQmu8mMGYbUivE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F0Xi9J+qx2jWa/RxizWxGlmFAaslhM+YtPPtc+kgHqLYxiAaCE3lEL3ZDunANpx9H acyn6se1NiWuosv5KRpZIT6cE1y8OlKhUG1CK+BbxXx0xsxb5h/jSr1vdVKRetoZ5X CrVP+mRCWjL4KUXGF6Gz0mgn0fCbHEl066Y6LHqSz1m5Xm1m41yK2+Mqi1iFf6zc+i KrM2JjykS8YPXCP7oIGrX3ui45Pe2s21APSNneWG+Eip6ZhkjhI+VnZ6VesFFPi93U vcp1XW03Hv4ikMTJ9ojl9ffm8/9H6TyZGazGv88a1LdRGXZZizHmsKYuYWM/KcX4RQ nJd6FJG/iH9Kw== 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 v3 11/20] x86/srso: Improve i-cache locality for alias mitigation Date: Mon, 4 Sep 2023 22:04:55 -0700 Message-ID: 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=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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