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
This commit is contained in:
Thomas Gleixner 2021-10-13 16:55:40 +02:00 committed by Borislav Petkov
parent c20942ce51
commit 63d6bdf36c
3 changed files with 4 additions and 4 deletions

View File

@ -53,7 +53,7 @@ void fpstate_init_soft(struct swregs_state *soft)
void finit(void) void finit(void)
{ {
fpstate_init_soft(&current->thread.fpu.state.soft); fpstate_init_soft(&current->thread.fpu.fpstate->regs.soft);
} }
/* /*

View File

@ -640,7 +640,7 @@ int fpregs_soft_set(struct task_struct *target,
unsigned int pos, unsigned int count, unsigned int pos, unsigned int count,
const void *kbuf, const void __user *ubuf) 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; void *space = s387->st_space;
int ret; int ret;
int offset, other, i, tags, regnr, tag, newtop; 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, const struct user_regset *regset,
struct membuf to) 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; const void *space = s387->st_space;
int offset = (S387->ftop & 7) * 10, other = 80 - offset; int offset = (S387->ftop & 7) * 10, other = 80 - offset;

View File

@ -73,7 +73,7 @@ static inline bool seg_writable(struct desc_struct *d)
return (d->type & SEG_TYPE_EXECUTE_MASK) == SEG_TYPE_WRITABLE; 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_info (I387->soft.info)
#define FPU_CS (*(unsigned short *) &(FPU_info->regs->cs)) #define FPU_CS (*(unsigned short *) &(FPU_info->regs->cs))