From: Thomas Gleixner Subject: [RFC patch 13/15] arm64/entry: Move FPU restore out of exit_to_usermode() loop Date: Thu, 19 Sep 2019 17:03:27 +0200 Message-ID: <20190919150809.754111224@linutronix.de> References: <20190919150314.054351477@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Sender: linux-kernel-owner@vger.kernel.org To: LKML Cc: x86@kernel.org, Peter Zijlstra , Andy Lutomirski , Catalin Marinas , Will Deacon , Mark Rutland , Marc Zyngier , Paolo Bonzini , kvm@vger.kernel.org, linux-arch@vger.kernel.org List-Id: linux-arch.vger.kernel.org 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 --- arch/arm64/include/asm/entry-common.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) --- a/arch/arm64/include/asm/entry-common.h +++ b/arch/arm64/include/asm/entry-common.h @@ -7,8 +7,6 @@ #include -#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,