Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1921132rdb; Wed, 31 Jan 2024 13:18:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IEmKisZr817xvGDb2H8EFtdoH7OxJ8oRD+jUlWgMX8jFckOHrWv1GmCxG76mH+uJ8MFmALi X-Received: by 2002:a50:ab17:0:b0:55f:2e1e:5b8e with SMTP id s23-20020a50ab17000000b0055f2e1e5b8emr2432251edc.7.1706735914265; Wed, 31 Jan 2024 13:18:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706735914; cv=pass; d=google.com; s=arc-20160816; b=Q12OSNPbuLPmgPCo0TcBoN9AUmey1aLlgwyDsTi+oFtrmZN4df1s+suNwsZw2hYOB4 MgkwDEAUVFzVNY7lJ1Tudh5pHtjOTqcbIByrZQhFU6za7Bge7ZtPQy8XqT7DXXKFYcOe CjcMYuLjgkU/st5IwfOo9zx0Y8ybOJXesD5ngrpohrORcTl0ABk5CymnnURh6RkT/Wlo gMi0nP/W5sE9PvoJkMcJtGTlF1nCzzyNR5NUklfSknk6vZN0nQXFVTO0O8bTTaJsiBqW xBnhYBkcVcr1eaRmgbeZ8Y6kDZm6VBYObmj8UxjTjNO3V9W+E3wOXl03vMOBUCjK5nsC IE8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=+rwFPhRWusT+2qo5r55A9Fiq7u2ixEyco1fGG8zRSbQ=; fh=pCsn0/M6nvypzVPkLE09SvTp+nfgQU0yLrI08+j/eKI=; b=YeaTrjEtBSAuUglxmlSLW/K8ho3zTPUHHSgBOe235Y7PEmSn2ePzVjcZ7BmUhjhVjK TDuCurmw64vhDEhZSp7dQpmekjOhMVtPHHJJcrjjdLFkS/uzWHUBSTo/cnJ+ff4rjIm/ 57HdGOmE6b+tVziURMMwScqTra7iDBmp7xwYEQuX9MlxC0zIWAKrt3nh0YeXprOpBtDr l/ayS2qxpVoFS2eQfcN5bMOFVAgaksGtQJQioAvX6ErYZ2yx2iO+dTQU6yxSYzS21JOn fI5NOC94h6SaHr3cJvnkVHmWrQwNaq+wFCSI4mGMXwoPPOK+BAk3v566kzw50ZpsPzbx inDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=P2iCzgw6; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-47133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=1; AJvYcCVQS0Ml5EKgttnBecp7bJREl4YqyipgH9VrEoZJi5aRCJ1+/Eljh1F1WpoOgCe5f1VsFDrzjtNKCtHe3ddScU9l5Xc65D9+lWJloA4jZw== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id ds6-20020a0564021cc600b005585701151csi6040628edb.224.2024.01.31.13.18.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 13:18:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=P2iCzgw6; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-47133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DCDD81F23054 for ; Wed, 31 Jan 2024 21:18:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D7983A1AF; Wed, 31 Jan 2024 21:14:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="P2iCzgw6"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NixLpVIQ" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 302BF3B1A0; Wed, 31 Jan 2024 21:14:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706735692; cv=none; b=ryyPSgntSPgdM0UUpJ4l8AgB9viqRxTr9HjjYgFwzIsAM0xGx4i4uHNojZtfhgD38Dd1emqTIeAREbnwnjg9ReKLLA5srrvjTW2JktZz9K0t0RlmThSvJFYNBhC+w7TpOS2f4nJtCQ22ThdxtYucLEKRkqW78cVI742GwXboWG8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706735692; c=relaxed/simple; bh=T2J7RmZjxcIanokRfrdWhAhrG0OvSXw5EcXG4Zo30NM=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=eulxixVYxwzfuXc+0PNH3HF+j13fsI8R3WIti9V3VtjfU5yjbAk3oJERVcXO47tv11dVewuLRnM9Ql3TMeT4T0lC1SB0cpE/kk1ZBc6PG1O1WvL3EBFkEAZP1oTAyl2Vpu8DPKKLPxQ39rXn04ib5M7tBnHZ9efLorxz6C6Y9CY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=P2iCzgw6; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NixLpVIQ; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Wed, 31 Jan 2024 21:14:48 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706735689; 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=+rwFPhRWusT+2qo5r55A9Fiq7u2ixEyco1fGG8zRSbQ=; b=P2iCzgw6qeFYvdvn2uRHEdcwMQbuui0hB/Fzc6Oq5wnHPK/aF4A48n5IBh4xDufE5kfYGC pfPXmHsEM0660IaGLSW+FYzKS+JlvmuPJqgBtoijgB59e1FjzW5NOBfWhPf59CtBDmGL2T GW1SLNvW8ciF1JJDP9YkSbxbs8k76wzJSTeYUUh4v6TDhz6Wb6GTcAcowtqyiOYTwzGV1v nZ7TK8peGk+MJR+QATqIpxFXzkdXxRKWSR3H6oXof8knou3TsKJOevKXaz1FVPvjas3L/w g1+XrzWtE4mCgzqzc+m8p17BJxBxvgG993BmNHWGNFO1tI4wGcolWLxY7LpOAA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706735689; 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=+rwFPhRWusT+2qo5r55A9Fiq7u2ixEyco1fGG8zRSbQ=; b=NixLpVIQcyKBfgmjYcAyfqnAGMmpfjgkRYVegkbZGQLXIE5XCKVWSDWehVODrrIKE+NQcU o8nFl5Fv/BOjcnCA== From: "tip-bot2 for H. Peter Anvin (Intel)" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/fred] x86/fred: No ESPFIX needed when FRED is enabled Cc: "H. Peter Anvin (Intel)" , Xin Li , Thomas Gleixner , "Borislav Petkov (AMD)" , Shan Kang , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231205105030.8698-20-xin3.li@intel.com> References: <20231205105030.8698-20-xin3.li@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170673568870.398.7853288615116409390.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The following commit has been merged into the x86/fred branch of tip: Commit-ID: df8838737b3612eea024fce5ffce0b23dafe5058 Gitweb: https://git.kernel.org/tip/df8838737b3612eea024fce5ffce0b23dafe5058 Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:50:08 -08:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 31 Jan 2024 22:01:51 +01:00 x86/fred: No ESPFIX needed when FRED is enabled Because FRED always restores the full value of %rsp, ESPFIX is no longer needed when it's enabled. Signed-off-by: H. Peter Anvin (Intel) Signed-off-by: Xin Li Signed-off-by: Thomas Gleixner Signed-off-by: Borislav Petkov (AMD) Tested-by: Shan Kang Link: https://lore.kernel.org/r/20231205105030.8698-20-xin3.li@intel.com --- arch/x86/kernel/espfix_64.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/x86/kernel/espfix_64.c b/arch/x86/kernel/espfix_64.c index 16f9814..6726e04 100644 --- a/arch/x86/kernel/espfix_64.c +++ b/arch/x86/kernel/espfix_64.c @@ -106,6 +106,10 @@ void __init init_espfix_bsp(void) pgd_t *pgd; p4d_t *p4d; + /* FRED systems always restore the full value of %rsp */ + if (cpu_feature_enabled(X86_FEATURE_FRED)) + return; + /* Install the espfix pud into the kernel page directory */ pgd = &init_top_pgt[pgd_index(ESPFIX_BASE_ADDR)]; p4d = p4d_alloc(&init_mm, pgd, ESPFIX_BASE_ADDR); @@ -129,6 +133,10 @@ void init_espfix_ap(int cpu) void *stack_page; pteval_t ptemask; + /* FRED systems always restore the full value of %rsp */ + if (cpu_feature_enabled(X86_FEATURE_FRED)) + return; + /* We only have to do this once... */ if (likely(per_cpu(espfix_stack, cpu))) return; /* Already initialized */