From nobody Tue Dec 23 16:24:48 2025 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 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" 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: quoted-printable The following commit has been merged into the x86/fred branch of tip: Commit-ID: df8838737b3612eea024fce5ffce0b23dafe5058 Gitweb: https://git.kernel.org/tip/df8838737b3612eea024fce5ffce0b23d= afe5058 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; =20 + /* 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 =3D &init_top_pgt[pgd_index(ESPFIX_BASE_ADDR)]; p4d =3D p4d_alloc(&init_mm, pgd, ESPFIX_BASE_ADDR); @@ -129,6 +133,10 @@ void init_espfix_ap(int cpu) void *stack_page; pteval_t ptemask; =20 + /* 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 */