x86/entry: Change exit path of xen_failsafe_callback

xen_failsafe_callback() is invoked from XEN for two cases:

  1. Fault while reloading DS, ES, FS or GS
  2. Fault while executing IRET

 #1 retries the IRET after XEN has fixed up the segments.
 #2 injects a #GP which kills the task

For #1 there is no reason to go through the full exception return path
because the tasks TIF state is still the same. So just going straight to
the IRET path is good enough.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Andy Lutomirski <luto@kernel.org>
Link: https://lore.kernel.org/r/20200521202118.423224507@linutronix.de
This commit is contained in:
Thomas Gleixner 2020-05-21 22:05:30 +02:00
parent e2dcb5f139
commit e88d974136
2 changed files with 2 additions and 2 deletions

View File

@ -1355,7 +1355,7 @@ SYM_FUNC_START(xen_failsafe_callback)
5: pushl $-1 /* orig_ax = -1 => not a system call */ 5: pushl $-1 /* orig_ax = -1 => not a system call */
SAVE_ALL SAVE_ALL
ENCODE_FRAME_POINTER ENCODE_FRAME_POINTER
jmp ret_from_exception jmp handle_exception_return
.section .fixup, "ax" .section .fixup, "ax"
6: xorl %eax, %eax 6: xorl %eax, %eax

View File

@ -1175,7 +1175,7 @@ SYM_CODE_START(xen_failsafe_callback)
pushq $-1 /* orig_ax = -1 => not a system call */ pushq $-1 /* orig_ax = -1 => not a system call */
PUSH_AND_CLEAR_REGS PUSH_AND_CLEAR_REGS
ENCODE_FRAME_POINTER ENCODE_FRAME_POINTER
jmp error_exit jmp error_return
SYM_CODE_END(xen_failsafe_callback) SYM_CODE_END(xen_failsafe_callback)
#endif /* CONFIG_XEN_PV */ #endif /* CONFIG_XEN_PV */