Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1493414rdb; Tue, 30 Jan 2024 23:25:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IHhoTRcYuM8DSxhTTIjrmmnI5rsCwdhVMV01TJt2qKL2wuDGGTJETmGTMha+PHZExvUYPXD X-Received: by 2002:a05:6402:310a:b0:55c:93c1:4a50 with SMTP id dc10-20020a056402310a00b0055c93c14a50mr739437edb.13.1706685923352; Tue, 30 Jan 2024 23:25:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706685923; cv=pass; d=google.com; s=arc-20160816; b=KEV5uJZlxv27XY1nn/jAnBsQf3IsxOANYsRME4N4eqmTb8Nd2CdkwpMdxDusEBybwG uyUxVfZE/a5797r63TmNSmBqg0wr1wxQ/bLJUWwjKEM8N2pGKTk+G252phlSvzxUUubS T5FC1BvdpmofvTWYNY2PAuNRN7463EkjBSR8tQM57n/MG5Akx0UGP+utbBysCimMOJBV /E0IGzP7bEmO+FFKjrdjHTDKuKNrn4sTQxQm6rsk4QPIKGbsAQLt49cIDuCwYpBj0wAU HWNZApopAfYWdoOwS2E/PaV+ye0ohdm3Yu8rwPgcNkgtkJ+q1tMRMXtvyRdVe0B6OtKk JXCw== 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=A1conEPj2nHWZzNiaFZc+CtRhcR+OVNeXlZj8gBfnMU=; fh=dErHWFbZWVN9ciLeADMEloV/2cNCzmeZX1bbTiUr17s=; b=KMT+3PuLWC25Si8s4pyQoh8DaWspyJqWaPqbC0hYp5paSjHgid6fh7FZgi7lFdp6Ff Je6NdJ6ApDiXoO4fFCFPzQotmCS0VwcN0m/TrfVmtrh4F8M6wv1UlV6cC7bXesV+vGHH h3CMo3ZUUTYndBGEtOAab05Y+cR0pYefx+Bg6QCSWIlylOtHf0Nez9Or2LPFdVeX7eNi zuesy0UASTqiHGe0vQjKPRhzBfIbZf4pzrZJ8MwtRktIn5J/31SCeYIw6zrd8CGZyfTG yMYM1Wknerc+bjVpusQD3QnyYZVzF5qSeAKYC3PActMlnlf1s3+DQYghiSHcIDMpRpLB Ge7w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=qbuEfAeV; 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-45910-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45910-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; AJvYcCXb6Ptn9HZQBlhjXRokf7Px5MMFW/W2YGq4vJuz8MmP1J5gahh78Y0kHgkwVaFDyNomxGuYgD+7UbOmnHlGZ69FpJOKNnsMOD+CVDRbmg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id i22-20020a50d756000000b0055f19a3348fsi2138751edj.658.2024.01.30.23.25.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 23:25:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45910-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=qbuEfAeV; 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-45910-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45910-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 1A9BD1F20F9A for ; Wed, 31 Jan 2024 07:25:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BEAF57BB07; Wed, 31 Jan 2024 07:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qbuEfAeV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="zUjtWSfC" 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 0C478762D7; Wed, 31 Jan 2024 07:21:24 +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=1706685686; cv=none; b=lWFubA239QZezKy5GL0t8quOyx9kuxfby6c7jNuxO84wi08FcrdxSS+hb/bEXMCCZh3Kd2W9tLb7YYhw1v6Lqsa4ugktHU0CO29W1VQAAVh7lQTCX1zkhkqWwZ+ju09jksRDOSvXTzL6fRoZKXic8VOp8QPMeYccb6Z8uGvYLEA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706685686; c=relaxed/simple; bh=QL2/OWq+vgqFQvjPhv5WJiWMfqB/aoojfW5s8UhPlo0=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=Zpy0LmI50qxUpHjMBrhrN3ywZ/BfdR2QzvtSWGWjgppDvE0W7dJ1FsUt3PmqUrLz4+/RSvit058wa67QxsRnxFkOdgK9fPPItjHwOD4nB9rZEFip49egZQSQFJDK5M3aJ259yvDTSOVJSA9D1wfYriX89meF64HLBvFhGWtO81Q= 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=qbuEfAeV; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=zUjtWSfC; 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:22 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1706685683; 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=A1conEPj2nHWZzNiaFZc+CtRhcR+OVNeXlZj8gBfnMU=; b=qbuEfAeVshGraxq4ERDPUwJkUjm8AorFtX0tX7drPr0txr/tkvFTc8VEUkjeQ4KID4abo/ akXduNx/k0IE4a8fmCKuKHFFwitCrGovFo8w+reS7TWgz2rt3Fu4brKJSDpdAXeYRNPdCk 48TN6Jsc90qMx5Nd5tq36xh7dQztEuFwlQ4Xpj/2+Sb919d+oTjbPowgPGfBvPgVMjbq7Y NY67ApTles7uhgFJtB+eBOhX4n4/Ecsr4/nLaFYWN40KBBrI/wS6a4dEL9Brg8JKTJ7ecv TCruxfhG4hkZVJLAqmmmV4nK91rkxPmXKgZwOXIY44vqSZVRGMlbOd8l9XRcBg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1706685683; 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=A1conEPj2nHWZzNiaFZc+CtRhcR+OVNeXlZj8gBfnMU=; b=zUjtWSfCvS8+bWTDEI4833cIEELRwX6q3AcnHloRg70B3aDnger0L6MrDdiNGcQQRdSs1f mxvHNviwvYaOFSDw== 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: <170668568261.398.10403890006820046961.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: fcd06abf6de2b81724a1e39c121d288f66b1d392 Gitweb: https://git.kernel.org/tip/fcd06abf6de2b81724a1e39c121d288f66b1d392 Author: H. Peter Anvin (Intel) AuthorDate: Tue, 05 Dec 2023 02:50:05 -08:00 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 30 Jan 2024 18:20:35 +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 /*