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

x86/math-emu: Convert to fpstate

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

authored by

Thomas Gleixner and committed by
Borislav Petkov
63d6bdf3 c20942ce

+4 -4
+1 -1
arch/x86/math-emu/fpu_aux.c
··· 53 53 54 54 void finit(void) 55 55 { 56 - fpstate_init_soft(&current->thread.fpu.state.soft); 56 + fpstate_init_soft(&current->thread.fpu.fpstate->regs.soft); 57 57 } 58 58 59 59 /*
+2 -2
arch/x86/math-emu/fpu_entry.c
··· 640 640 unsigned int pos, unsigned int count, 641 641 const void *kbuf, const void __user *ubuf) 642 642 { 643 - struct swregs_state *s387 = &target->thread.fpu.state.soft; 643 + struct swregs_state *s387 = &target->thread.fpu.fpstate->regs.soft; 644 644 void *space = s387->st_space; 645 645 int ret; 646 646 int offset, other, i, tags, regnr, tag, newtop; ··· 691 691 const struct user_regset *regset, 692 692 struct membuf to) 693 693 { 694 - struct swregs_state *s387 = &target->thread.fpu.state.soft; 694 + struct swregs_state *s387 = &target->thread.fpu.fpstate->regs.soft; 695 695 const void *space = s387->st_space; 696 696 int offset = (S387->ftop & 7) * 10, other = 80 - offset; 697 697
+1 -1
arch/x86/math-emu/fpu_system.h
··· 73 73 return (d->type & SEG_TYPE_EXECUTE_MASK) == SEG_TYPE_WRITABLE; 74 74 } 75 75 76 - #define I387 (&current->thread.fpu.state) 76 + #define I387 (&current->thread.fpu.fpstate->regs) 77 77 #define FPU_info (I387->soft.info) 78 78 79 79 #define FPU_CS (*(unsigned short *) &(FPU_info->regs->cs))