Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1922340rdb; Wed, 31 Jan 2024 13:21:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrYGCw/aM73syG6Mx/gVL+Xg8iku0DbmAcDLlPaOHAjiQOj4yyU+7xld+YBm4PZCJIMmJq X-Received: by 2002:a05:6a00:2d8c:b0:6dd:c43e:fb5e with SMTP id fb12-20020a056a002d8c00b006ddc43efb5emr3502434pfb.8.1706736066105; Wed, 31 Jan 2024 13:21:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706736066; cv=pass; d=google.com; s=arc-20160816; b=j9f3RWxLnDBRcrya+of/BB6/aZJOpTpTCBtbFCW0JvXsvPL1aUdIiVZS+1OYkXSz/N GzVDV+vOcoNb71myNAqzCDyXOIcApyJOiE+hgpV0ygsMnLWvntXJDVhh7VzDQkj8lv05 xxoZFWVlV3ZjtyzYZJIqMM8ZWuISfrB0QoT11U5oIVgw8dZy1sHamXEoP4jmAbmw6JUN JrecBuT+xdmzSreDqdQZmApPEMDQOdhaF05UOqWsKaMm95UBhDlyI3NQJ8WG1AH95WdH Pk38eMTKyJZFBiRiqotF+Qq+GstVyVAuWFt8Md/Zre8YNSak1WcVEWjdWkFUyCT/JApv txDQ== 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=V3rySNEmjT/c4K21p0U7c4EN7VOfizhRI1l/sNnNJVE=; fh=1vtKO6lqLOTzPwcNh/xKdfcdwIsKpmG1d5JCVXVVHu0=; b=BpGCcjOa++GMyecjx1UmJ2mUU00XXB4/UpBrhXSgvKRq/9d2l8pDlS6gYUeSKp4hJ6 zmBdWGrb5JPR9bHYbEW19PZPZAqflaOxO1zlAKcBR43L50w1iUKZY2YEQaisRURa4mjE syvQ1BS5i7aQ+RL4qd+xi6EfNaMQmDRFWkxZZVi5eUujti9A5TKmrkcgJ6shMdMys5xv tVnlNsoLIF/mQdtSRgWd+eGEvezZEf1vmYEsgI/9GdIAs21VmKeWfpnhWBm8YqfbTO6U E3M1sdWc3FvUORwvIbQXAEfYy/C6jIer0AJfZajMsbBLjEn+k9ySVrt+UBZbBj8UNf2r TD8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=McSpwabh; 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-47136-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47136-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; AJvYcCWclNU57yK7s5VtoO6NVKgesJ+DHvCrz6SMcJjFjfk04lkpmeJuW90Vk6pPq0LdWfWgDtA7ovlBX1IcQ0AuhnzyAkMzf+1LB+TCmUdcDA== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g15-20020a63520f000000b005d8c175f182si7470877pgb.776.2024.01.31.13.21.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 13:21:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47136-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=McSpwabh; 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-47136-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47136-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 5AF1B29082F for ; Wed, 31 Jan 2024 21:19:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A4953FE2E; Wed, 31 Jan 2024 21:14:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="McSpwabh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="nMmeuJEf" 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 D7B913BB3D; Wed, 31 Jan 2024 21:14:52 +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=1706735694; cv=none; b=CO1uL31+vbFqC/C1UpiSLS2I912vJYrxE6XVrmhceywkMOjEQFMEhpq2t1uUJ3Ws3T3UA1vqRlZptY6SsbzPHGGxsgN9kVecvBeM878BoKyDlDWze9w8Bl7cZ2E0smTW+gsWdjT1NCN3cA/HhB5E062/AsaYthAbxezYV9o2LFk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706735694; c=relaxed/simple; bh=amc0Ld0f8tthTrPZKjqAZGX4Aqk1Gf4HoJmRO8jWkNc=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=a+xo3+zK/Gmd/R7RwultLufgo9Vfy6p3TQBkotG6ZWaiJfsm9YuexuIulBq7if9f6teL2+5jEJKrwMQiVcDs8K6M3qagONvzocatDNySX8TzkwOf9GivJqOfACncBV9RqJztMs3UBeVL3J7WCCu/jKo2+W1yhAs4ypKlxKEDoME= 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=McSpwabh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=nMmeuJEf; 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:50 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706735691; 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=V3rySNEmjT/c4K21p0U7c4EN7VOfizhRI1l/sNnNJVE=; b=McSpwabh/7gWBwYRp3QTiJ0b8tKSoliHIEtcxWWsihXkN3DirS5Se6pCgH84TxTlSe9AA9 N0mHTcYmiMQ7AaDPkU+RybHcnvF2JBaunUTkViiLa4rFJ/A5LV2vsOAInRqtCJZoo8jccA GgLR5rXuITb4/yDZUF8AMBG1opIZUrZMGAhh+eZ10Ns0OAGMpGxVD3wZ+poPt7hKQtL29u XxpPHzFwTGuDvLLeKm0ArrojUPLfa3fRq55JoVLqeN8gPrDgK+3pi+iaQdijWbuWIKFEah a09ZJ14lktOj96bcExy03EOPeewV7JSZwN14fXSROYFCYpAL4/L90UaQg0dgBA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706735691; 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=V3rySNEmjT/c4K21p0U7c4EN7VOfizhRI1l/sNnNJVE=; b=nMmeuJEfDolhPWPUnaHkfqxrsdNo+59CNSZWvnBR2FCKxcOypjU6yWo5RZEUC03rhtplsS 4Yz7msMeAKtwy3AQ== 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: Reserve space for the FRED stack frame 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-17-xin3.li@intel.com> References: <20231205105030.8698-17-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: <170673569050.398.6147585182118522399.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: 65c9cc9e2c14602d98f1ca61c51ac954e9529303 Gitweb: https://git.kernel.org/tip/65c9cc9e2c14602d98f1ca61c51ac954e9529303 Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:50:05 -08:00 Committer: Borislav Petkov (AMD) CommitterDate: Wed, 31 Jan 2024 22:01:31 +01:00 x86/fred: Reserve space for the FRED stack frame When using FRED, reserve space at the top of the stack frame, just like i386 does. 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-17-xin3.li@intel.com --- arch/x86/include/asm/thread_info.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h index d63b029..12da7df 100644 --- a/arch/x86/include/asm/thread_info.h +++ b/arch/x86/include/asm/thread_info.h @@ -31,7 +31,9 @@ * In vm86 mode, the hardware frame is much longer still, so add 16 * bytes to make room for the real-mode segments. * - * x86_64 has a fixed-length stack frame. + * x86-64 has a fixed-length stack frame, but it depends on whether + * or not FRED is enabled. Future versions of FRED might make this + * dynamic, but for now it is always 2 words longer. */ #ifdef CONFIG_X86_32 # ifdef CONFIG_VM86 @@ -39,8 +41,12 @@ # else # define TOP_OF_KERNEL_STACK_PADDING 8 # endif -#else -# define TOP_OF_KERNEL_STACK_PADDING 0 +#else /* x86-64 */ +# ifdef CONFIG_X86_FRED +# define TOP_OF_KERNEL_STACK_PADDING (2 * 8) +# else +# define TOP_OF_KERNEL_STACK_PADDING 0 +# endif #endif /*