Skip to content

Commit d147553

Browse files
Peter Zijlstrasuryasaimadhu
authored andcommitted
x86/xen: Add UNTRAIN_RET
Ensure the Xen entry also passes through UNTRAIN_RET. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Reviewed-by: Josh Poimboeuf <[email protected]> Signed-off-by: Borislav Petkov <[email protected]>
1 parent b75b7f8 commit d147553

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

arch/x86/entry/entry_64.S

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,12 @@ SYM_CODE_END(ret_from_fork)
328328
#endif
329329
.endm
330330

331+
SYM_CODE_START_LOCAL(xen_error_entry)
332+
UNWIND_HINT_FUNC
333+
UNTRAIN_RET
334+
RET
335+
SYM_CODE_END(xen_error_entry)
336+
331337
/**
332338
* idtentry_body - Macro to emit code calling the C function
333339
* @cfunc: C function to be called
@@ -347,7 +353,7 @@ SYM_CODE_END(ret_from_fork)
347353
* switch the CR3. So it can skip invoking error_entry().
348354
*/
349355
ALTERNATIVE "call error_entry; movq %rax, %rsp", \
350-
"", X86_FEATURE_XENPV
356+
"call xen_error_entry", X86_FEATURE_XENPV
351357

352358
ENCODE_FRAME_POINTER
353359
UNWIND_HINT_REGS

0 commit comments

Comments
 (0)