Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arch: remove ARCH_TASK_STRUCT_ON_STACK

IA-64 was the only architecture which selected ARCH_TASK_STRUCT_ON_STACK.
IA-64 was removed with commit cf8e8658100d ("arch: Remove Itanium (IA-64)
architecture"). Therefore remove support for ARCH_TASK_STRUCT_ON_STACK
as well.

Note: this also reveals a potential bug in powerpc code, which makes use of
__init_task_data without selecting ARCH_TASK_STRUCT_ON_STACK which makes
__init_task_data a no-op. This is broken since commit d11ed3ab3166 ("Expand
INIT_TASK() in init/init_task.c and remove") from 2018 and needs to be
addressed separately.

Link: https://lkml.kernel.org/r/20231116133638.1636277-4-hca@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Heiko Carstens and committed by
Andrew Morton
0eb5085c 3888750e

+3 -23
-4
arch/Kconfig
··· 301 301 config ARCH_HAS_CPU_FINALIZE_INIT 302 302 bool 303 303 304 - # Select if arch init_task must go in the __init_task_data section 305 - config ARCH_TASK_STRUCT_ON_STACK 306 - bool 307 - 308 304 config HAVE_ARCH_THREAD_STRUCT_WHITELIST 309 305 bool 310 306 help
+1 -2
arch/powerpc/kexec/core_64.c
··· 283 283 * We could use a smaller stack if we don't care about anything using 284 284 * current, but that audit has not been performed. 285 285 */ 286 - static union thread_union kexec_stack __init_task_data = 287 - { }; 286 + static union thread_union kexec_stack = { }; 288 287 289 288 /* 290 289 * For similar reasons to the stack above, the kexecing CPU needs to be on a
-7
include/linux/init_task.h
··· 37 37 38 38 #define INIT_TASK_COMM "swapper" 39 39 40 - /* Attach to the init_task data structure for proper alignment */ 41 - #ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK 42 - #define __init_task_data __section(".data..init_task") 43 - #else 44 - #define __init_task_data /**/ 45 - #endif 46 - 47 40 /* Attach to the thread_info data structure for proper alignment */ 48 41 #define __init_thread_info __section(".data..init_thread_info") 49 42
-2
include/linux/sched.h
··· 1955 1955 void yield(void); 1956 1956 1957 1957 union thread_union { 1958 - #ifndef CONFIG_ARCH_TASK_STRUCT_ON_STACK 1959 1958 struct task_struct task; 1960 - #endif 1961 1959 #ifndef CONFIG_THREAD_INFO_IN_TASK 1962 1960 struct thread_info thread_info; 1963 1961 #endif
+2 -8
init/init_task.c
··· 51 51 }; 52 52 53 53 #ifdef CONFIG_SHADOW_CALL_STACK 54 - unsigned long init_shadow_call_stack[SCS_SIZE / sizeof(long)] 55 - __init_task_data = { 54 + unsigned long init_shadow_call_stack[SCS_SIZE / sizeof(long)] = { 56 55 [(SCS_SIZE / sizeof(long)) - 1] = SCS_END_MAGIC 57 56 }; 58 57 #endif ··· 60 61 * Set up the first task table, touch at your own risk!. Base=0, 61 62 * limit=0x1fffff (=2MB) 62 63 */ 63 - struct task_struct init_task 64 - #ifdef CONFIG_ARCH_TASK_STRUCT_ON_STACK 65 - __init_task_data 66 - #endif 67 - __aligned(L1_CACHE_BYTES) 68 - = { 64 + struct task_struct init_task __aligned(L1_CACHE_BYTES) = { 69 65 #ifdef CONFIG_THREAD_INFO_IN_TASK 70 66 .thread_info = INIT_THREAD_INFO(init_task), 71 67 .stack_refcount = REFCOUNT_INIT(1),