Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1493193rdb; Tue, 30 Jan 2024 23:24:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IEu/mN5/NRaKwUVwX4Jl08vjuwzNEyEEBMKnTe+/T67vus9/Cr3TPm7tG+A888EazEhpS9t X-Received: by 2002:a17:906:3951:b0:a36:5e63:7b12 with SMTP id g17-20020a170906395100b00a365e637b12mr472525eje.37.1706685879689; Tue, 30 Jan 2024 23:24:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706685879; cv=pass; d=google.com; s=arc-20160816; b=syIvC/FYwkpQi6pEQTp7MTNRgLhoxpjcC1A6GhAXv/BQ9q/iPvK/2E/X3zZs9f6CHB XW5yuAavfrf3KMNzc4+/2dJpWFHi+VzP0a1o1XccSzG0ZLdlAWCwtI8nR9g9ENy9mvBZ 1kEzwK0Vv4bm5v2LBw5msYtd+WdxXxSRiiCza6t+COV/byPNC0CDIysE0ifymZCs9qKf xg6hyV/og+HM57iUnTLk+fwlNxpPrrq/4l4nX8m7GiHkGVlZ8t1AaqQPkxKYIdydvl4J y8uwUe6gZSFm+7nrr25OfrDLM0ER+PPNH18sbPx0YYDYFgTiszaGRQwPMcpPOFxLi/re yPJA== 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=ZdDbI+3UdclGrdmKctpKWHGBsVC6dyLT2iD8l1QugE0=; fh=nzMUuqKjwsqTjZvV8wjrWxEZpsT7xAB7yPVrHmpd4LA=; b=S2fgLp5XTDLR3lJoUYes8yDrvbRvFnd++CbbFaGfhqBiiwo6+UFsTfm/A8M3q18dyx +n012wv6u+F6xjRfUfd2+KIcP1TOkTiTEvuj31oEEe/9LQCBqXcdUvUktBurLH+KAljy bziMyQMJznzraaGlLxzPFCf3DfXxQbqUjMTaBj77EbqnGAdfhZ3ZtTJF5LweBrW4OC2/ HDcQdSOTuN+n/3xT0r5FuceQRORHBoH98pVfJ4vTay0Sw10fxh/ITD7EWR1KMs4ATFp8 qVibiZ856FC9AIVYunnXE+36lCKpw12AQXgmqXM+T4JGVJFsHB5LMjsRFDhrncU8xR6f wiLQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=CcaPgPow; 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-45907-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45907-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; AJvYcCWWNwNsUiRChlEZmsJfJknVdy6KnD+Ih1tSJf4Ba/utpZ18cAx3MPqS57J/uwKhhuR/YPKmcnkJlcWF56NkbVwO+S1HPlA8e/VqyGMCIQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a6-20020a1709066d4600b00a359e081020si2950216ejt.181.2024.01.30.23.24.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 23:24:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45907-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=CcaPgPow; 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-45907-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45907-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 4D6801F28561 for ; Wed, 31 Jan 2024 07:24:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5614B76903; Wed, 31 Jan 2024 07:21:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CcaPgPow"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ySMLLQFQ" 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 8E6AF6DD19; Wed, 31 Jan 2024 07:21:22 +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=1706685684; cv=none; b=iHKPtTUcXpDADRtIUtoRdYqMYDfV0820nCubCZJ37w0dZWMDkkdOXoynyysgaf3bKgJVYJQdyVe892nuEUgDvWioTPbdhz3z+85HZl5z8ooafScVzlHyudlnciN0Ofxrsr/ooKyFKlDjmcfWyX91kNg2E4UGyQYuq4sYqtDHyuk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706685684; c=relaxed/simple; bh=lRX/Cwn5841ZQVMSLI88ekqtL5uilM05LQsWrvM1mms=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=dZ5a+WVQm0Tqj82msNJn/RR+bB9kU3tvD7zjthfrABaCa/jg7J+Jw54iHiEmF2KXUQ2eA2aP3cw9hkMX7OVghNzv+GbvJKrpFN4Ei5iTHgzFXEVG6Ik8+COYvXzyEtuxbphaDTrTyN/NFBuYreTVw27MEuvrgy+Jg9xDHGe8fXM= 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=CcaPgPow; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ySMLLQFQ; 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 07:21:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706685680; 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=ZdDbI+3UdclGrdmKctpKWHGBsVC6dyLT2iD8l1QugE0=; b=CcaPgPowpVr4Comr6fK3GnGsPaz6IJRx3THZ1KJJrNi6pj/tvoR5hW3+fbyaevaxuSPWgP szPeseSBvNIWmtwFz/C5WCoy4E9KTqHRdHyaZlu5FErUJ0N6RpvvyYBP+qdXx5DyCww0k3 Ht74JrGDanZlMw12hFPXbFLKjEGXKJTLbDwGDZc1oHGoA/qU6MP8NKBK74n4nZDSvhke65 yLwMsHUlWwoAfi/tMiZmb9U3Zc9dhWA/8AzXZKhUlASWFUKBi3n7Fh+qEc3mr8Mf/087uk Pi5h/VDv7O8IR5q0ddImCrD8h3vPgF17Q3+M1/ezTltCdNh6GcjLNhNK6sVjog== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706685680; 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=ZdDbI+3UdclGrdmKctpKWHGBsVC6dyLT2iD8l1QugE0=; b=ySMLLQFQ9lsOXe5oHWkGJ0Kdc0IDYzmRzJd1SfXtABhxxTlGUu+GiqESe1RvfXWP+Up6N0 oziiTkYcVaieVTAA== 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 , 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: <170668568002.398.1889543253223143145.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: d0fb796dc3475cf71d788ec960d8ed5de4d7a429 Gitweb: https://git.kernel.org/tip/d0fb796dc3475cf71d788ec960d8ed5de4d7a429 Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:50:08 -08:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 30 Jan 2024 18:20:35 +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 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 */