Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp138394rdb; Thu, 25 Jan 2024 10:24:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGE3NFoJ2HYQZhd5hhKkCIIzYayuyWHG14agjrrdK5gzoedhZxhoSXzD2w1a3p3wZIZaKMZ X-Received: by 2002:a17:907:1048:b0:a2f:bb64:2985 with SMTP id oy8-20020a170907104800b00a2fbb642985mr5580ejb.3.1706207084554; Thu, 25 Jan 2024 10:24:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706207084; cv=pass; d=google.com; s=arc-20160816; b=Xz0u65o8oFy3ARX5dIfFf9sfN46BXVpr1y5NEyrLbRQHpxDlYNqZpBSOp/ONx8GFLI 3FDlaWm3okvCXYE/ZOnMT95o7+cFEbfOatMEYDdCOEpsT/J+KnllB7TEYKaMJcYvhJl+ YnTR9yy8WWF9pk/DLZS/ebXYMWHZ4Vt+ZcOu+f6A/coKevYj+dFA9A7l4LljWQq2eieJ z3Nmilz1I3AKR5gjVC604h9V9sbY4ApkBZRlyH05tclSGGADOntg1iJ/yxSPaZeZgacZ QiLh76Xp0I9OZFQd1PhdRDSNI3/grAo2HbAAdeb6y4OgV1K6EjAb+Yqfcxm/d0RZpvwU P+fQ== 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=OLeY2kavi4Blft+tytqE4VRMdY3zDRsQo4hNiN/v+fM=; fh=U/Hd0cPmVpmsXI9UC370Q88/l4pozXEkKxB1Pi0MTn0=; b=R5vJ3ptyiH8REOHgs0AtC77vHeZtkl7dUPuXfIhcYnLxGzY2z2FKWya/5OubQq0JIF OjPCnuSpHyrfEGQXJNTCzBJq7bEAqwLUWKUpRwfByIt/gCljR1FK2BLLftESyS56SQV7 fl0N7yMXdxLfRjp3vLOHgljS2MVRVTNkub5NoEdXmf2IOHtHq2oi7AeFRe0dvpi/8cV9 Elk3DN6w2gsgvpjbaJHam51FrP402gurBIAzotCdpKPEGFa/D/opjCo0vZF3+DGR4HPJ t+kon8qeDSKfQFyqLDKh/JUFb/SECFyYkIIuvdKQHV/TfbQ8uLz7ClSk/H0PVj/aGx8y s70A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=l4KxA1Fm; 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-39095-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39095-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 z21-20020a170906075500b00a2bea90686esi1104340ejb.1054.2024.01.25.10.24.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 10:24:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39095-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=l4KxA1Fm; 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-39095-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39095-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 521B41F21D84 for ; Thu, 25 Jan 2024 18:24:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 36C7713AA55; Thu, 25 Jan 2024 18:21:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="l4KxA1Fm"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ck4MOo0y" 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 DDD371386B7; 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=1706206895; cv=none; b=U+kzlIo+10sjPjriS13diWlcwCQzE8EpL5XwMxVbC5Sp0oxv4o0QNvWjBz0A0Nckc4GRtSgxIbLFXB3WvMUPkGWvxx00deQU8d8DOjWLlI9VLHU+X0A50i7LGuLIWlDRN7jCQ0wGhrza7n1GQuphKTzB4IcOVvHx/3yAyVqub8Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706206895; c=relaxed/simple; bh=RF7N1W05VmzZr3JjO91Yskl3CQVnOza/2vJqVHtC/OI=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=HnvxCzkhPHv02jf4tZtdx1b3r/lCCg9yLp2Gx09Fp1r10nx5Jc1ur2tA5Fp2oTO8RL/lS3+41G7to4o4TOJIn57+NHqtkBG0kdN35au2GeWcgrNjLwIzKsvONdTSAdMknBEfB3eD8vuhoskORMEehnRz2srJ8Q3Jzix+/hO436w= 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=l4KxA1Fm; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ck4MOo0y; 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:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706206890; 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=OLeY2kavi4Blft+tytqE4VRMdY3zDRsQo4hNiN/v+fM=; b=l4KxA1FmiUx3cVFF12gHXZRrf3i9R8vjt7jx28dOj16Dd0mT2B3sWj487wD1Y2etib6neh V0V1LFwSLbzFeMR8H1q7TJxuqFT6mkkWkKvPVIZMbVcuJC2noxLTeqIYAwtkQJJ1TFk0k+ odUI9XbwOtKjYtTPxXail41teF7dbjQpwI5HLljhCBLQCu6LWWbEq9KfmM/xLjdm5MQkcB 26U+ly9zqi8C+ZwDJsYPJccTSPICdTf2azWIhvg1wToz056pDsRH8HmaEB1nMMVUw9uwZc f9MMT3ReSyKthSCcIPOc5Ev37XxOVX1uyKGiQW3pzfYCQI3M1J0RA7pu4LBBMA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706206890; 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=OLeY2kavi4Blft+tytqE4VRMdY3zDRsQo4hNiN/v+fM=; b=ck4MOo0yLiXVb/w5AEnNtzeGKqinFZVZOgE5M2cDoyEcRX/ZLRnkBDjwyrEogNLDJQukE3 NV46AE1r5mGbhWCQ== 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 , 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: <170620688966.398.5410138435076203692.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: c83ce06e137034b155ce56f2830637e7dc9c56ce Gitweb: https://git.kernel.org/tip/c83ce06e137034b155ce56f2830637e7dc9c56ce Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:50:05 -08:00 Committer: Thomas Gleixner CommitterDate: Thu, 25 Jan 2024 19:10: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 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 /*