x86/xen: Add UNTRAIN_RET
authorPeter Zijlstra <peterz@infradead.org>
Tue, 14 Jun 2022 21:16:01 +0000 (23:16 +0200)
committerBorislav Petkov <bp@suse.de>
Mon, 27 Jun 2022 08:33:59 +0000 (10:33 +0200)
Ensure the Xen entry also passes through UNTRAIN_RET.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/entry/entry_64.S

index f4384a2..0c88802 100644 (file)
@@ -328,6 +328,12 @@ SYM_CODE_END(ret_from_fork)
 #endif
 .endm
 
+SYM_CODE_START_LOCAL(xen_error_entry)
+       UNWIND_HINT_FUNC
+       UNTRAIN_RET
+       RET
+SYM_CODE_END(xen_error_entry)
+
 /**
  * idtentry_body - Macro to emit code calling the C function
  * @cfunc:             C function to be called
@@ -347,7 +353,7 @@ SYM_CODE_END(ret_from_fork)
         * switch the CR3.  So it can skip invoking error_entry().
         */
        ALTERNATIVE "call error_entry; movq %rax, %rsp", \
-               "", X86_FEATURE_XENPV
+                   "call xen_error_entry", X86_FEATURE_XENPV
 
        ENCODE_FRAME_POINTER
        UNWIND_HINT_REGS