Skip to content

Commit d7f679e

Browse files
hcahcaAlexander Gordeev
authored andcommitted
s390/fpu: remove ARCH_WANTS_DYNAMIC_TASK_STRUCT support
s390 selects ARCH_WANTS_DYNAMIC_TASK_STRUCT in order to make the size of the task structure dependent on the availability of the vector facility. This doesn't make sense anymore because since many years all machines provide the vector facility. Therefore simplify the code a bit and remove s390 support for ARCH_WANTS_DYNAMIC_TASK_STRUCT. Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent d7271ba commit d7f679e

4 files changed

Lines changed: 2 additions & 24 deletions

File tree

arch/s390/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ config S390
123123
select ARCH_USE_BUILTIN_BSWAP
124124
select ARCH_USE_CMPXCHG_LOCKREF
125125
select ARCH_USE_SYM_ANNOTATIONS
126-
select ARCH_WANTS_DYNAMIC_TASK_STRUCT
127126
select ARCH_WANTS_NO_INSTR
128127
select ARCH_WANT_DEFAULT_BPF_JIT
129128
select ARCH_WANT_IPC_PARSE_VERSION

arch/s390/include/asm/processor.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,7 @@ struct thread_struct {
184184
struct gs_cb *gs_cb; /* Current guarded storage cb */
185185
struct gs_cb *gs_bc_cb; /* Broadcast guarded storage cb */
186186
struct pgm_tdb trap_tdb; /* Transaction abort diagnose block */
187-
/*
188-
* Warning: 'fpu' is dynamically-sized. It *MUST* be at
189-
* the end.
190-
*/
191-
struct fpu fpu; /* FP and VX register save area */
187+
struct fpu fpu; /* FP and VX register save area */
192188
};
193189

194190
/* Flag to disable transactions. */

arch/s390/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
8989
*/
9090
save_fpu_regs();
9191

92-
memcpy(dst, src, arch_task_struct_size);
92+
*dst = *src;
9393
dst->thread.fpu.regs = dst->thread.fpu.fprs;
9494

9595
/*

arch/s390/kernel/setup.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -819,22 +819,6 @@ static void __init setup_randomness(void)
819819
static_branch_enable(&s390_arch_random_available);
820820
}
821821

822-
/*
823-
* Find the correct size for the task_struct. This depends on
824-
* the size of the struct fpu at the end of the thread_struct
825-
* which is embedded in the task_struct.
826-
*/
827-
static void __init setup_task_size(void)
828-
{
829-
int task_size = sizeof(struct task_struct);
830-
831-
if (!MACHINE_HAS_VX) {
832-
task_size -= sizeof(__vector128) * __NUM_VXRS;
833-
task_size += sizeof(freg_t) * __NUM_FPRS;
834-
}
835-
arch_task_struct_size = task_size;
836-
}
837-
838822
/*
839823
* Issue diagnose 318 to set the control program name and
840824
* version codes.
@@ -927,7 +911,6 @@ void __init setup_arch(char **cmdline_p)
927911

928912
os_info_init();
929913
setup_ipl();
930-
setup_task_size();
931914
setup_control_program_code();
932915

933916
/* Do some memory reservations *before* memory is added to memblock */

0 commit comments

Comments
 (0)