Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp138837rdb; Thu, 25 Jan 2024 10:25:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHaoFGxGcefnmpQnt6FJ5DgCWbTOwOzjpXEt47X5peNnRjQgHKyAhpe0qRXTjrzJRBAB0s1 X-Received: by 2002:a05:6402:1cae:b0:559:d2d9:ed28 with SMTP id cz14-20020a0564021cae00b00559d2d9ed28mr13562edb.93.1706207135542; Thu, 25 Jan 2024 10:25:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706207135; cv=pass; d=google.com; s=arc-20160816; b=Qcd7a6n3HKSd0opoFP2wkrfah4WENR8KL+kkXBCXMuUY4vA/IaCDvRyqVFo6Qw/e8W NUVeOB89IBsB8x8vOrA028VXGgqX++5YDEfNFoctrTXlRKYS984UuNMO9rK1KCK+pFrh +4aGUJMjsro1IPsWyQ8N/9TRyphQtzTsJQpzQhUsYKfVDxoH4EE0mRYUX9VUM5AMXUf2 j9gQMEv/qwUcqXyLXEAtTK7vZtRMStuEVoREMO50BwrxBY8kvbRbtWPKnu9MpEQ5kEs/ rXCrvts35nTuDNBAKmtl+z9YzsYyGk+RtU5MEDjrbVOwpAljwNpAideHm0gmDntTFhYK xTHg== 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=vu/47x9Ti9yhmQ+i8gJyEiZuv3PLrCTSFIaEamDaSRs=; fh=U/Hd0cPmVpmsXI9UC370Q88/l4pozXEkKxB1Pi0MTn0=; b=0yGRj3L3z10sOsCfs2HwMjlu/o93XLEreYJj+/EinoBAvLhndmn5FV8+/nWg2Z/FSY eC2hdxnFrFEvO3xbNFUC8clz7nNMgmlp2X0ICiTty+pw1yA4LqvCa3/KLbbEB0yotdmr hO1LwWhVO4o2TruVFxcqgid3+5g+WmuIr6vUE1+sY/O2NwgOiIjVA5goLeim6oKCaGCC UKtdZ4e6zywQs6pinTIUpV1FlvKWRtFzUQqbsACv2+RTV+/no2uG/K4Nh5RresA0RcMc lTfFMlBl+9uc+KXnKznf4KpUOPejS09qEghGCRDq8xtvrQdjFMREwOaxjbdu2dgMMVj8 KBrA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=B7r9KnwW; 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-39100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39100-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q35-20020a05640224a300b0055400f1f188si15246161eda.41.2024.01.25.10.25.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 10:25:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=B7r9KnwW; 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-39100-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39100-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 2B2321F27328 for ; Thu, 25 Jan 2024 18:25:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26F2713BE9F; Thu, 25 Jan 2024 18:21:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="B7r9KnwW"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="RD4yCmPj" 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 59A19137C5E; Thu, 25 Jan 2024 18:21:32 +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=1706206896; cv=none; b=CEm24/SQdLW55RzbbLJmFZQZ4HdNYMmKJKXL51GGyNraF4aIOJfzVyJOgYjaZDEiEJ6Vga4wXVEXpcAQN/tryvNVRJTVffn67l6jLYvKRe3boBfvAtpwtdFc4YThMOZBVjTVG2J0Nvf/oXD1j0Hx9ePCsoQ3uQam3zIsgYy2l5Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706206896; c=relaxed/simple; bh=wlzmYwUxJ215NNYBIX4aN9yqimcI9GZYJd5gP2TYed0=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=itjSWQURU/7Hi1CdT99PSCYMlUtb4KqPXb/ENkAgKnAwad4AheL3oCVqgBMND5sybZ6hezcXoP1rZudvaObwsXCDYKXI8NWRVxs5X3ZFPqVljACvos+sdABi3UUNNHNN9N8Rl1FUxGAgbWUYGbV+9zYS9JgjM5exPdqqM+4iXSc= 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=B7r9KnwW; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=RD4yCmPj; 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: Thu, 25 Jan 2024 18:21:27 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706206887; 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=vu/47x9Ti9yhmQ+i8gJyEiZuv3PLrCTSFIaEamDaSRs=; b=B7r9KnwWa3LSCIp3bkum4fleThlUoKUSa9s9c9j3ClUGq2erAI4eQv3aVQbYO7eRCFqqzF LxA00hzoWPWspzrSOSKWliJmDf2+OY5hCSZufj2yvAVVaANNs16Im6TVQ0rZcnY+0MKDP1 lpsQ2VDtfztEDcaaMrYp6npbPovzIu9c0cDDIYb8sYkxgpfV70i+3I/3AAMQpTkoH/8QuS uzpjVCsc+ejZNjNyuVMzai3A53GgJOj+sCQcoNSb4cCv483iCvvPA0M6IGtXxuInUTlZ/u zEFlQgz8Ueh83N0njdKVebSL9QhazPYj397fLEuyrvqsMjL+2VSZHnYSLKw0kA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706206887; 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=vu/47x9Ti9yhmQ+i8gJyEiZuv3PLrCTSFIaEamDaSRs=; b=RD4yCmPjFfwIO9XRSGmvXXT+ETHavD4FDyC6FJbE8K6+sBG0a88wejA32wE7D2uPxtIJME fq1N9Ru8mD75EMBg== 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: <170620688711.398.1337533491872943903.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: bc49cef5e02ab95b5235acbbc4cb5bb6a0bdec7f Gitweb: https://git.kernel.org/tip/bc49cef5e02ab95b5235acbbc4cb5bb6a0bdec7f Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:50:08 -08:00 Committer: Thomas Gleixner CommitterDate: Thu, 25 Jan 2024 19:10:31 +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 */