Commit 3a0aee48 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

x86/fpu: Rename math_state_restore() to fpu__restore()



Move to the new fpu__*() namespace.

Reviewed-by: default avatarBorislav Petkov <bp@alien8.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent 93b90712
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ preemption must be disabled around such regions.

Note, some FPU functions are already explicitly preempt safe.  For example,
kernel_fpu_begin and kernel_fpu_end will disable and enable preemption.
However, math_state_restore must be called with preemption disabled.
However, fpu__restore() must be called with preemption disabled.


RULE #3: Lock acquire and release must be performed by same task
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ extern void fpstate_init(struct fpu *fpu);
extern void fpu__flush_thread(struct task_struct *tsk);

extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
extern void math_state_restore(void);
extern void fpu__restore(void);

extern bool irq_fpu_usable(void);

+3 −3
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ static int fpu__unlazy_stopped(struct task_struct *child)
}

/*
 * 'math_state_restore()' saves the current math information in the
 * 'fpu__restore()' saves the current math information in the
 * old math state array, and gets the new ones from the current task
 *
 * Careful.. There are problems with IBM-designed IRQ13 behaviour.
@@ -237,7 +237,7 @@ static int fpu__unlazy_stopped(struct task_struct *child)
 * Must be called with kernel preemption disabled (eg with local
 * local interrupts as in the case of do_device_not_available).
 */
void math_state_restore(void)
void fpu__restore(void)
{
	struct task_struct *tsk = current;

@@ -267,7 +267,7 @@ void math_state_restore(void)
	}
	kernel_fpu_enable();
}
EXPORT_SYMBOL_GPL(math_state_restore);
EXPORT_SYMBOL_GPL(fpu__restore);

void fpu__flush_thread(struct task_struct *tsk)
{
+1 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ int __restore_xstate_sig(void __user *buf, void __user *buf_fx, int size)
		set_used_math();
		if (use_eager_fpu()) {
			preempt_disable();
			math_state_restore();
			fpu__restore();
			preempt_enable();
		}

+1 −1
Original line number Diff line number Diff line
@@ -295,7 +295,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
	 * Leave lazy mode, flushing any hypercalls made here.
	 * This must be done before restoring TLS segments so
	 * the GDT and LDT are properly updated, and must be
	 * done before math_state_restore, so the TS bit is up
	 * done before fpu__restore(), so the TS bit is up
	 * to date.
	 */
	arch_end_context_switch(next_p);
Loading