From patchwork Fri Mar 1 08:40:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Xin Li (Intel)" X-Patchwork-Id: 208697 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp941068dyb; Fri, 1 Mar 2024 00:42:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWyM8aC3hJiCZmD+wM+wrdj5XXbUNe/PXaqam15FXLur5YhAx6YNFQPM1E8qguxawee/lJpl1o04Rr/16CLs0RLwaY4ow== X-Google-Smtp-Source: AGHT+IG2+xAHtW4Q8V2rsVW3Svr9LNXUFlLj1UfLS95/Kuk5btKPXVgbWGWcdqihryPf1l23C8WE X-Received: by 2002:a05:6402:323:b0:566:4ba7:157e with SMTP id q3-20020a056402032300b005664ba7157emr786007edw.14.1709282542847; Fri, 01 Mar 2024 00:42:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709282542; cv=pass; d=google.com; s=arc-20160816; b=ogTyPuYQHlPGdJcr1crIkVy0yp5l1NZ35FiCmh35Ph+WKw8nEB4K+GdE32x3jfSvY0 gW5H9JEz7R3SPmbON1GpiFUDSeS4esW2tieGcpe9ZoZTX0Du3YOs5Qt5D+OiVo2kQyWT 2+/nlhZEhOKN7e2iZ5kUGDYFX4L35HIgpGkEFuPe3f2d9vRwZu7JQz7CM5JcBMFqqAMR xy+Rhh791CCgo5AZzn/z+8/ly8SQTgjXvK6SULT/GK1+PtvePp0J1Xw7ZIq1a8CgPt/P LFqjceEdx9qV49nEQeZcwX0ph3mubUnf736fxalKhi13OjO0z+i1+oraqt6CKG5/zWvO +ORg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature:dkim-filter; bh=XHDUSdp3fzgtKbz1MB2i6kRiFtguTPR1L2wgsX/y370=; fh=i2KdxqsaXzwmrZcS/SvEO6y/qU8O9VI6x6zqJRa+1JI=; b=nk0+r6QsKNwo5V8Z94tsTP3a5y61pwYXe2eckM4toTXYXQFqqZPNLLY9dSD4+TDLPW a8ZwWbogAaqPwh3NzBYizE0wnc4paMMy3DqxoZJoAoNHpUWMHGiNkhzdME9unkCWivDb q2+Iw7cS4NpwDL2oVuGsT2cTm8ECegpp8qzGdyNQZVBrqTBqsOBXr8w8RCFZPp0OoQX1 xok8/aP9fqHXGnp72dONlEo1EtCSV3zHBeiwo2nmkjSM/CMQoafLkLvzO1wjxh+ubLZd 0Whg3AjIcXVoFH6AdElu+qUrWyZVAYFprruq1AnIq5+3V3hE2Q492UKM2Y6IMS70LAkH Jalg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024021201 header.b="IgxvAT/b"; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-88096-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88096-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id l11-20020a056402254b00b005664dc1157esi1317307edb.143.2024.03.01.00.42.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 00:42:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-88096-ouuuleilei=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=@zytor.com header.s=2024021201 header.b="IgxvAT/b"; arc=pass (i=1 spf=pass spfdomain=zytor.com dkim=pass dkdomain=zytor.com dmarc=pass fromdomain=zytor.com); spf=pass (google.com: domain of linux-kernel+bounces-88096-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-88096-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com 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 6FDB71F2202C for ; Fri, 1 Mar 2024 08:42:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 90DF469D25; Fri, 1 Mar 2024 08:41:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="IgxvAT/b" Received: from mail.zytor.com (terminus.zytor.com [198.137.202.136]) (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 5710969E11 for ; Fri, 1 Mar 2024 08:41:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.136 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709282489; cv=none; b=PzQ7LGG2FOHYMZVS+jWSd8s5GTVGtMq0MGyVCpeiISQIOSQrrsP9VXLNXRqIVQurkx75MUrcOTNVbAqS64HrcXH3gHLC9ccPvi0CEXaoZ3QMDy/Co2qGRwVQ+0drsXsxVkxocAhRUZQWXfJ11f6ifMufe6wqu4NOnPOt679xIok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709282489; c=relaxed/simple; bh=ZU05d8rgL+KouMacXKQ7YsJZM3JuNUeEZVl84wyTLE0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=k5fhMW1Q6YN5O/LkwPL+HuBt/bAzx4NIrgPfDLFN6wcdvyg1BfcmfomMIPDfiVOKeEUk2CSagcY9ZXc+jS0NaLdDVVWGvmppu13LestTOzU3jnVY/oIaE15Hymj1PF6u8MMD8vujGi//LzGoPzBxWEwtIQIeqoi+ZBELTBNGWxw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com; spf=pass smtp.mailfrom=zytor.com; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b=IgxvAT/b; arc=none smtp.client-ip=198.137.202.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zytor.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zytor.com Received: from terminus.zytor.com (terminus.zytor.com [IPv6:2607:7c80:54:3:0:0:0:136]) (authenticated bits=0) by mail.zytor.com (8.17.2/8.17.1) with ESMTPSA id 4218elje3370386 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 1 Mar 2024 00:40:51 -0800 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 4218elje3370386 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024021201; t=1709282452; bh=XHDUSdp3fzgtKbz1MB2i6kRiFtguTPR1L2wgsX/y370=; h=From:To:Cc:Subject:Date:From; b=IgxvAT/b5pPtrkD2o+Qs/LXL4q5C7xWmeYT0I0Nsswgzi6K6V9wDP80kZ/ett1+/6 +c+7DO2i9jYYDi9XGNQSNs3Hm927ZUR5Sf25qCQaMdFJbJFjokI12uTTYQjxX0zL8F XFf9TuC+fsoEppfz2iSCyrnlc3CLGsfzmqHL3smI5W1EnNadAlpUHuKVYyblQQss2s y0rFAZTyJdE0y8qC7fbKiKIE6VyZp7202CS4p1rkn4luH/VlHEfsIL3VgzUeLByNRY wpSinfHmpQ2TNp3RfbklxovH3aRMMrPwVe8B/VcXrw09CQu5LVmrczq7UDMnzlaKhK OIPCFXhK7wfjQ== From: "Xin Li (Intel)" To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, brgerst@gmail.com Subject: [PATCH v1 1/1] x86/fred: Fix init_task thread stack pointer initialization Date: Fri, 1 Mar 2024 00:40:46 -0800 Message-ID: <20240301084046.3370376-1-xin@zytor.com> X-Mailer: git-send-email 2.44.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792312651637710214 X-GMAIL-MSGID: 1792312651637710214 As TOP_OF_KERNEL_STACK_PADDING is defined as 0 on x86_64, no one noticed it's missing in the calculation of the .sp field in INIT_THREAD until it is defined to 16 with CONFIG_X86_FRED=y. Subtract TOP_OF_KERNEL_STACK_PADDING from the .sp field of INIT_THREAD. Fixes: 65c9cc9e2c14 ("x86/fred: Reserve space for the FRED stack frame") Fixes: 3adee777ad0d ("x86/smpboot: Remove initial_stack on 64-bit") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202402262159.183c2a37-lkp@intel.com Signed-off-by: Xin Li (Intel) --- arch/x86/include/asm/processor.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) base-commit: e13841907b8fda0ae0ce1ec03684665f578416a8 diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 26620d7642a9..17fe81998ce4 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -664,8 +664,10 @@ static __always_inline void prefetchw(const void *x) #else extern unsigned long __end_init_task[]; -#define INIT_THREAD { \ - .sp = (unsigned long)&__end_init_task - sizeof(struct pt_regs), \ +#define INIT_THREAD { \ + .sp = (unsigned long)&__end_init_task - \ + TOP_OF_KERNEL_STACK_PADDING - \ + sizeof(struct pt_regs), \ } extern unsigned long KSTK_ESP(struct task_struct *task);