diff mbox series

[RFC,13/15] arm64/entry: Move FPU restore out of exit_to_usermode() loop

Message ID 20190919150809.754111224@linutronix.de (mailing list archive)
State New, archived
Headers show
Series entry: Provide generic implementation for host and guest entry/exit work | expand

Commit Message

Thomas Gleixner Sept. 19, 2019, 3:03 p.m. UTC
Restoring the FPU is not required to be insided the loop. The final point
to do that is before returning to user space. Move it there.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
 arch/arm64/include/asm/entry-common.h |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
diff mbox series

Patch

--- a/arch/arm64/include/asm/entry-common.h
+++ b/arch/arm64/include/asm/entry-common.h
@@ -7,8 +7,6 @@ 
 
 #include <asm/daifflags.h>
 
-#define ARCH_EXIT_TO_USERMODE_WORK	(_TIF_FOREIGN_FPSTATE)
-
 static inline void local_irq_enable_exit_to_user(unsigned long ti_work)
 {
 	if (ti_work & _TIF_NEED_RESCHED)
@@ -24,15 +22,14 @@  static inline void local_irq_disable_exi
 }
 #define local_irq_disable_exit_to_user local_irq_disable_exit_to_user
 
-static inline void arch_exit_to_usermode_work(struct pt_regs *regs,
-					      unsigned long ti_work)
+static inline void arch_exit_to_usermode(struct pt_regs *regs,
+					 unsigned long ti_work)
 {
-	/* Must this be inside the work loop ? */
 	if (ti_work & _TIF_FOREIGN_FPSTATE)
 		fpsimd_restore_current_state();
 
 }
-#define arch_exit_to_usermode_work arch_exit_to_usermode_work
+#define arch_exit_to_usermode arch_exit_to_usermode
 
 enum ptrace_syscall_dir {
 	PTRACE_SYSCALL_ENTER = 0,