x86/math-emu: Convert to fpstate
authorThomas Gleixner <tglx@linutronix.de>
Wed, 13 Oct 2021 14:55:40 +0000 (16:55 +0200)
committerBorislav Petkov <bp@suse.de>
Wed, 20 Oct 2021 21:57:54 +0000 (23:57 +0200)
Convert math emulation code to the new register storage
mechanism in preparation for dynamically sized buffers.

No functional change.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lkml.kernel.org/r/20211013145322.711347464@linutronix.de
arch/x86/math-emu/fpu_aux.c
arch/x86/math-emu/fpu_entry.c
arch/x86/math-emu/fpu_system.h

index 034748459482a945fff91f3e9554e46bccdf4a30..d62662bdd4604398656559cb23955a7d6b217a42 100644 (file)
@@ -53,7 +53,7 @@ void fpstate_init_soft(struct swregs_state *soft)
 
 void finit(void)
 {
-       fpstate_init_soft(&current->thread.fpu.state.soft);
+       fpstate_init_soft(&current->thread.fpu.fpstate->regs.soft);
 }
 
 /*
index 50195e24975368190c1b9850f2a3a1a7eea79a4a..7fe56c594aa627e5de65199ba85bbae6d4d340ea 100644 (file)
@@ -640,7 +640,7 @@ int fpregs_soft_set(struct task_struct *target,
                    unsigned int pos, unsigned int count,
                    const void *kbuf, const void __user *ubuf)
 {
-       struct swregs_state *s387 = &target->thread.fpu.state.soft;
+       struct swregs_state *s387 = &target->thread.fpu.fpstate->regs.soft;
        void *space = s387->st_space;
        int ret;
        int offset, other, i, tags, regnr, tag, newtop;
@@ -691,7 +691,7 @@ int fpregs_soft_get(struct task_struct *target,
                    const struct user_regset *regset,
                    struct membuf to)
 {
-       struct swregs_state *s387 = &target->thread.fpu.state.soft;
+       struct swregs_state *s387 = &target->thread.fpu.fpstate->regs.soft;
        const void *space = s387->st_space;
        int offset = (S387->ftop & 7) * 10, other = 80 - offset;
 
index 9b41391867dcafb90472bb9de2a2ff6372c2731a..eec3e4805c75e595653dbba3b98e6fbc2a51f49f 100644 (file)
@@ -73,7 +73,7 @@ static inline bool seg_writable(struct desc_struct *d)
        return (d->type & SEG_TYPE_EXECUTE_MASK) == SEG_TYPE_WRITABLE;
 }
 
-#define I387                   (&current->thread.fpu.state)
+#define I387                   (&current->thread.fpu.fpstate->regs)
 #define FPU_info               (I387->soft.info)
 
 #define FPU_CS                 (*(unsigned short *) &(FPU_info->regs->cs))