]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
s390/fpu: remove regs member from struct fpu
authorHeiko Carstens <hca@linux.ibm.com>
Sat, 3 Feb 2024 10:45:14 +0000 (11:45 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Fri, 16 Feb 2024 13:30:16 +0000 (14:30 +0100)
KVM was the only user which modified the regs pointer in struct fpu. Remove
the pointer and convert the rest of the core fpu code to directly access
the save area embedded within struct fpu.

Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/include/asm/fpu-types.h
arch/s390/include/asm/processor.h
arch/s390/kernel/fpu.c
arch/s390/kernel/process.c

index fee4468a85d38a52802ae1cbe583800338d0563c..f5b6fab304013a8df51f0a88f4258c165200c4a7 100644 (file)
@@ -13,7 +13,6 @@
 
 struct fpu {
        __u32 fpc;              /* Floating-point control */
-       void *regs;             /* Pointer to the current save area */
        union {
                /* Floating-point register save area */
                freg_t fprs[__NUM_FPRS];
index eee0a1eec620c86774cb84e48ce9e2d8c960191d..ecce58abf3dba9b8a6d3385e6b6e0dc7f8fbf70f 100644 (file)
@@ -202,7 +202,6 @@ typedef struct thread_struct thread_struct;
 
 #define INIT_THREAD {                                                  \
        .ksp = sizeof(init_stack) + (unsigned long) &init_stack,        \
-       .ufpu.regs = (void *)init_task.thread.ufpu.fprs,                \
        .last_break = 1,                                                \
 }
 
index b976da5bf71bcc6592462629fe44a14b4448286d..a0ef3fc5d90f3d8c68278db9f4db9184834994c8 100644 (file)
@@ -110,13 +110,12 @@ EXPORT_SYMBOL(__kernel_fpu_end);
 void __load_user_fpu_regs(void)
 {
        struct fpu *state = &current->thread.ufpu;
-       void *regs = current->thread.ufpu.regs;
 
        fpu_lfpc_safe(&state->fpc);
        if (likely(cpu_has_vx()))
-               load_vx_regs(regs);
+               load_vx_regs(state->vxrs);
        else
-               load_fp_regs(regs);
+               load_fp_regs(state->fprs);
        clear_thread_flag(TIF_FPU);
 }
 
@@ -132,7 +131,6 @@ void save_user_fpu_regs(void)
 {
        unsigned long flags;
        struct fpu *state;
-       void *regs;
 
        local_irq_save(flags);
 
@@ -140,13 +138,12 @@ void save_user_fpu_regs(void)
                goto out;
 
        state = &current->thread.ufpu;
-       regs = current->thread.ufpu.regs;
 
        fpu_stfpc(&state->fpc);
        if (likely(cpu_has_vx()))
-               save_vx_regs(regs);
+               save_vx_regs(state->vxrs);
        else
-               save_fp_regs(regs);
+               save_fp_regs(state->fprs);
        set_thread_flag(TIF_FPU);
 out:
        local_irq_restore(flags);
index b7b623818753764bbf5181ffe72cb50344863bdb..dd456b4758611ce178236b0680f56d1fc7e78294 100644 (file)
@@ -94,7 +94,6 @@ int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src)
        save_user_fpu_regs();
 
        *dst = *src;
-       dst->thread.ufpu.regs = dst->thread.ufpu.fprs;
        dst->thread.kfpu_flags = 0;
 
        /*