]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
mips: properly lock access to the fpu
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Mon, 11 May 2015 15:52:19 +0000 (17:52 +0200)
committerMichal Sojka <sojka@merica.cz>
Sun, 13 Sep 2015 07:47:00 +0000 (09:47 +0200)
Let's always disable preemption and pagefaults when locking the fpu,
so we can be sure that the owner won't change in between.

This is a preparation for pagefault_disable() not touching preemption
anymore.

Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
arch/mips/kernel/signal-common.h

index 06805e09bcd35751857a6f4a1d367d6796163c1b..0b85f827cd1836165fe4d146ec1d543953edeb7b 100644 (file)
@@ -28,12 +28,7 @@ extern void __user *get_sigframe(struct ksignal *ksig, struct pt_regs *regs,
 extern int fpcsr_pending(unsigned int __user *fpcsr);
 
 /* Make sure we will not lose FPU ownership */
-#ifdef CONFIG_PREEMPT
-#define lock_fpu_owner()       preempt_disable()
-#define unlock_fpu_owner()     preempt_enable()
-#else
-#define lock_fpu_owner()       pagefault_disable()
-#define unlock_fpu_owner()     pagefault_enable()
-#endif
+#define lock_fpu_owner()       ({ preempt_disable(); pagefault_disable(); })
+#define unlock_fpu_owner()     ({ pagefault_enable(); preempt_enable(); })
 
 #endif /* __SIGNAL_COMMON_H */