From patchwork Sat Sep 23 12:20:10 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: 143998 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp360306vqu; Sat, 23 Sep 2023 13:38:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEVzZZMHWiNsMQfhKzPq9VzWPNwbZkpGfNzoee/N3dXCG3IdepsI67Kh2Q27wcUtvP6rhSG X-Received: by 2002:aca:1b1a:0:b0:3a5:a78b:f773 with SMTP id b26-20020aca1b1a000000b003a5a78bf773mr3649388oib.6.1695501485550; Sat, 23 Sep 2023 13:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695501485; cv=none; d=google.com; s=arc-20160816; b=tGKgg8bFCv86TDmzWgPu6gmZpKWUV2yCknCdLs41Bn85RCb8Grl0PD1paozUntK9J3 0r/irhk17M5bh8V0tms+bqGbNQJe8Zv6mLcw2IL3rmorjAHpL5nmYnV742XhdtdCpfuS lAcFGy57LstwzO6640dizaUZUFSTi+ZUIuX5NKht9PoP6YREDQbXD/Vtv2oC7BKMkHX9 /AVCkVRJFQ8Ms9dKXAYq+ggSXm6dM3qNmaukQ2WpzCtz249ucWV66pha1VubRORtSveA Itjy62Tyn+U6vCuCF/+w/BbzBguia0H6UsiCyayMekP9qkY9YFBSelIYZ4WDbGOjJg8k 6IUg== 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=Q6ot9K9Rl8q7fbEonMpGDhJBWXj0REF2km4em8hvP0E=; fh=TJa98jjcJcAUyvo2yQiOqi+wukdLlQU80th5XskGe8U=; b=AH+pU1ArQSJwgtOO3mrN2Xo9kU9qtvyWrGwmP+7+EVCXtCx50HAK3yJmhvRYeuCSFm c05+8ZPBx39UrIi0ihnncZ3lhaiUFtNR/laOjVGJubVgJqyxerKVbG+mU8Fb2l4vXpOk jxjbdUnit6qZAet1yCEgmdJgvdTmeQruX/ZY7m1STofXtbR+i64qsokLc/8gRhljDKo7 yLn40phqPRpJ7ac0ksFyHwLe03XJokKOSGnanQpUp82aE3uqoVf2UZFf/BnoAJUmJVGi XJe4V2Cxsx8jeq7TNH1TADm0o+UW/2x/r+q0bO89YcQYObTa7JzLqVapzmPCJzBXD1K2 MZyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="BLE8/p1k"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id nv2-20020a17090b1b4200b002747da1ef70si412055pjb.16.2023.09.23.13.38.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Sep 2023 13:38:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="BLE8/p1k"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id F2ACC8090784; Sat, 23 Sep 2023 05:21:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231620AbjIWMUm (ORCPT + 29 others); Sat, 23 Sep 2023 08:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231635AbjIWMUS (ORCPT ); Sat, 23 Sep 2023 08:20:18 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A5571AC; Sat, 23 Sep 2023 05:20:12 -0700 (PDT) Date: Sat, 23 Sep 2023 12:20:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695471611; 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=Q6ot9K9Rl8q7fbEonMpGDhJBWXj0REF2km4em8hvP0E=; b=BLE8/p1kYjgErjUUy6FQyNrQJmA0bC8IQKYKFLcVJTyrjMXcrf2UoOxeBCrXSR+ey7p3Di RaVZpYhx2cgtgOm2mpDHEgVMw43E45EHyyfUzJFKrfRumIkKzRC4pzQF5uAzT9/+db8J1O qgxEOuzCKGhYdsPxbgLT8nWMDx7/PV0CrZLu1xxblTKlOEqOz+HL5hg5p2nHU9UBgkLEI6 G31bP3M+WWywxW16D0oLtrRmGx3IdB+4dC98N3s8LVyfbEAiTLmulWW0VPDaBs2DmFzybJ xATcxQ/39eBFdHmgiobOi/suTPMIJHuEfFXAI+s0BHky7R2xK4hIIBK/QG9xHw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695471611; 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=Q6ot9K9Rl8q7fbEonMpGDhJBWXj0REF2km4em8hvP0E=; b=LVKsh+bsL5r0oA32/48HCqzn4GTQWWPmVHy8rUTb7ZjDDEfGfe6QMPITtFF90iEruFmo4h HS94pR/6gXVSHLDA== 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: Improve i-cache locality for alias mitigation Cc: Josh Poimboeuf , Ingo Molnar , "Borislav Petkov (AMD)" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: MIME-Version: 1.0 Message-ID: <169547161036.27769.12486923899216752520.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 agentk.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 (agentk.vger.email [0.0.0.0]); Sat, 23 Sep 2023 05:21:22 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777459377698584663 X-GMAIL-MSGID: 1777862165661047345 The following commit has been merged into the x86/bugs branch of tip: Commit-ID: 01c032b1b11620232f0405d477d33acb7870388c Gitweb: https://git.kernel.org/tip/01c032b1b11620232f0405d477d33acb7870388c Author: Josh Poimboeuf AuthorDate: Mon, 04 Sep 2023 22:04:55 -07:00 Committer: Ingo Molnar CommitterDate: Sat, 23 Sep 2023 14:13:02 +02:00 x86/srso: Improve i-cache locality for alias mitigation 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 Signed-off-by: Ingo Molnar Acked-by: Borislav Petkov (AMD) Link: https://lore.kernel.org/r/eadaf5530b46a7ae8b936522da45ae555d2b3393.1693889988.git.jpoimboe@kernel.org --- 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 cd86aeb..9ab634f 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: *