Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp48207lqt; Mon, 18 Mar 2024 00:16:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGicp4bBHTQx2dDKSfSziYPKmebSkUZUuvShbxLtYzONKKxxfgFnMsaoQCMaaK6LNQuKP38/cM3YRbPerkKUCdMRqih+ScRHNKAUisbw== X-Google-Smtp-Source: AGHT+IFTKEvJavRm80fWhUhT8h3jiZePT0VPNhEjj0yn6OHDS7ahnnhNyMNmZyVQBwOihLTtMVLZ X-Received: by 2002:a05:6870:648d:b0:21e:624d:56f3 with SMTP id cz13-20020a056870648d00b0021e624d56f3mr11614758oab.56.1710746178409; Mon, 18 Mar 2024 00:16:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710746178; cv=pass; d=google.com; s=arc-20160816; b=R9efQ6SShUoUO+zNhThU2yIZ81bXWnWaXNoNBpuShw1Xf8sRMe6I+wgfB8+ySb2sUe IiHJcIEojxap+STJwnDaXMGOQEIxW9ypNktlB98pNBnOgttX6v7H4ATuN7qkbdXb7Sti /XOh0PfhyAHgv2+NSLNynifiGm2mZKu81QVLc1dGWRhUMzC4fzJjr4/CVPtqG1yuzQR6 STm0D77tQQ1hxmypntXQxMbSsGi9G5+iMC2FwO5DjYhl6vNKCQw5zvP9Oc5Ixq13Iuwd 54gwaVqob/QZfuc+phOBRdqVJziIQU4cUuLCMFQPgThowTFiUpDLfvg2c65lmOKvfXs4 6Tug== 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=lOgqPli4E6y6mgNZ3XzJ8MlzC1fqsi4wvgAp64a4zdg=; fh=2uh+njBG2MrRoBhAWf4A0RKFT2nLHQpU1qpYk70QJD8=; b=B5WAwqHoWxHfd+40zDOsVyJAHpdjccwTRbqVJMmy6AWDHPxauyv8ZkQbSAb8JKI41B rVPPqCccKdin35Y/CabRgAQPmKh6Zx1D92N/VAs3lEJqFyGmL22cY7qluqkcgbZewdO3 ux4h2SxSMCCa8asUDNcE6dZ6ja8/AupajEAe7z38DrO7rI0YYWMdBbj+T4I9IF3kKPPI 2JGrU6MR1W5Z8m6kyHc12V05e9zl4lJHSzjLGCJB15Hbewb8qLH9m2ojwnw2PMlWJWqR Mkylppic9whtfivRlaXz7zzOzeE5YDWfwddkaOQAl89n2m7htQzz6csBdwxEzgkYEl+J 7Idg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zytor.com header.s=2024031401 header.b=4qfo7+Bo; 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-105762-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105762-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a27-20020a056a001d1b00b006e732a966c2si434303pfx.65.2024.03.18.00.16.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 00:16:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-105762-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2024031401 header.b=4qfo7+Bo; 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-105762-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-105762-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 498F4B20A6B for ; Mon, 18 Mar 2024 07:16:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F0A522EF0; Mon, 18 Mar 2024 07:16:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=zytor.com header.i=@zytor.com header.b="4qfo7+Bo" 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 C7F3222612; Mon, 18 Mar 2024 07:15:55 +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=1710746168; cv=none; b=HQJfVZvn4MSNC/XiKTrrSGEGIzSnFh2Qw7mhgbmrGeFp3o9QUDGNJsCoc4A6wXLPmMRHXTcMqU8uy3YnptP7Ub+Ab7KSCk6OEnbHkafA8NTiUht5w98XMENbx95fJXcipeUu5kPGvhPXuix7trev0J/0tik56wJ6U4mrUKviz+8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710746168; c=relaxed/simple; bh=aLS6AX7W+AXgAh4hgoumByC0Igk0YWUJhR1plA7yRec=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Ui3Ds9ViYvE1a9PJCV6tAWz4DjBbDS59rlVii12pDpQbpdib1UrHHKtLdFxzCz2fxgVxQaNCqtxN7VtrJIROp6An5X5wN51syqYBn76Bw1iIuStICCNby01DXahF5b8SKUPkyuMa33PsFohdJQ4SKkSkumzkEtHxQjOjU3Ay/ZI= 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=4qfo7+Bo; 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 42I7ETdi910464 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Mon, 18 Mar 2024 00:14:34 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.zytor.com 42I7ETdi910464 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2024031401; t=1710746075; bh=lOgqPli4E6y6mgNZ3XzJ8MlzC1fqsi4wvgAp64a4zdg=; h=From:To:Cc:Subject:Date:From; b=4qfo7+Bopd2+cAB5JZREDFFnwJ9EUBUQzcTriimHV5zBacAHniCvGQvo/sA6muLna r4PwVGXSNtnFAarpjPSIkcS/hfYgUg4ojZl9bimUFHmnM0P9CO9rh8dpDRYahLqOvt jnGim1lPI+5C7q/LXw9w5uKxwMQXRUaNszLu95FjFea3zs0mFNXuwyPH5LagxqX0vC DosUI2YMVafFXw+c4aHUHb5JuMOQj2w2l2V9R0IlbFLWugYYUIdGE6Z5Vy6yC1MuaW vy1Q4stBFIJ3UVxNPttVvgPU9sLEwyljSMMwcFiw0pKIcgh2pkDHDqZRXAoNS8IABG Eqfo27oqDTeqA== From: "Xin Li (Intel)" To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org, linux-arch@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, jgross@suse.com, boris.ostrovsky@oracle.com, arnd@arndb.de Subject: [PATCH v2 1/1] x86: Rename __{start,end}_init_task to __{start,end}_init_stack Date: Mon, 18 Mar 2024 00:14:29 -0700 Message-ID: <20240318071429.910454-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stack of a task has been separated from the memory of a task_struct struture for a long time on x86, as a result __{start,end}_init_task no longer mark the start and end of the init_task structure, but its stack only. Rename __{start,end}_init_task to __{start,end}_init_stack. Note other architectures are not affected because __{start,end}_init_task are used on x86 only. Signed-off-by: Xin Li (Intel) --- Change since v1: * Revert an accident insane change, init_task to init_stack (Jürgen Groß). --- arch/x86/include/asm/processor.h | 4 ++-- arch/x86/kernel/head_64.S | 2 +- arch/x86/xen/xen-head.S | 2 +- include/asm-generic/vmlinux.lds.h | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h index 811548f131f4..8b3a3f3bb859 100644 --- a/arch/x86/include/asm/processor.h +++ b/arch/x86/include/asm/processor.h @@ -636,10 +636,10 @@ static __always_inline void prefetchw(const void *x) #define KSTK_ESP(task) (task_pt_regs(task)->sp) #else -extern unsigned long __end_init_task[]; +extern unsigned long __end_init_stack[]; #define INIT_THREAD { \ - .sp = (unsigned long)&__end_init_task - \ + .sp = (unsigned long)&__end_init_stack - \ TOP_OF_KERNEL_STACK_PADDING - \ sizeof(struct pt_regs), \ } diff --git a/arch/x86/kernel/head_64.S b/arch/x86/kernel/head_64.S index d8198fbd70e5..c7babd7ebb0f 100644 --- a/arch/x86/kernel/head_64.S +++ b/arch/x86/kernel/head_64.S @@ -66,7 +66,7 @@ SYM_CODE_START_NOALIGN(startup_64) mov %rsi, %r15 /* Set up the stack for verify_cpu() */ - leaq (__end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp + leaq (__end_init_stack - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp /* Setup GSBASE to allow stack canary access for C code */ movl $MSR_GS_BASE, %ecx diff --git a/arch/x86/xen/xen-head.S b/arch/x86/xen/xen-head.S index 04101b984f24..43eadf03f46d 100644 --- a/arch/x86/xen/xen-head.S +++ b/arch/x86/xen/xen-head.S @@ -49,7 +49,7 @@ SYM_CODE_START(startup_xen) ANNOTATE_NOENDBR cld - leaq (__end_init_task - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp + leaq (__end_init_stack - TOP_OF_KERNEL_STACK_PADDING - PTREGS_SIZE)(%rip), %rsp /* Set up %gs. * diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index 514d3002ad8a..cdfdcca23045 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -399,13 +399,13 @@ #define INIT_TASK_DATA(align) \ . = ALIGN(align); \ - __start_init_task = .; \ + __start_init_stack = .; \ init_thread_union = .; \ init_stack = .; \ KEEP(*(.data..init_task)) \ KEEP(*(.data..init_thread_info)) \ - . = __start_init_task + THREAD_SIZE; \ - __end_init_task = .; + . = __start_init_stack + THREAD_SIZE; \ + __end_init_stack = .; #define JUMP_TABLE_DATA \ . = ALIGN(8); \ base-commit: 7e19a79344df2ed5e106091c29338962261b0290 -- 2.44.0