Skip to content

Commit 2c08b9b

Browse files
Peter Zijlstrasuryasaimadhu
authored andcommitted
x86/entry: Move PUSH_AND_CLEAR_REGS() back into error_entry
Commit ee774da ("x86/entry: Move PUSH_AND_CLEAR_REGS out of error_entry()") moved PUSH_AND_CLEAR_REGS out of error_entry, into its own function, in part to avoid calling error_entry() for XenPV. However, commit 7c81c0c ("x86/entry: Avoid very early RET") had to change that because the 'ret' was too early and moved it into idtentry, bloating the text size, since idtentry is expanded for every exception vector. However, with the advent of xen_error_entry() in commit d147553 ("x86/xen: Add UNTRAIN_RET") it became possible to remove PUSH_AND_CLEAR_REGS from idtentry, back into *error_entry(). Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Borislav Petkov <[email protected]>
1 parent f54d453 commit 2c08b9b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

arch/x86/entry/entry_64.S

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,8 @@ SYM_CODE_END(ret_from_fork)
328328

329329
SYM_CODE_START_LOCAL(xen_error_entry)
330330
UNWIND_HINT_FUNC
331+
PUSH_AND_CLEAR_REGS save_ret=1
332+
ENCODE_FRAME_POINTER 8
331333
UNTRAIN_RET
332334
RET
333335
SYM_CODE_END(xen_error_entry)
@@ -339,9 +341,6 @@ SYM_CODE_END(xen_error_entry)
339341
*/
340342
.macro idtentry_body cfunc has_error_code:req
341343

342-
PUSH_AND_CLEAR_REGS
343-
ENCODE_FRAME_POINTER
344-
345344
/*
346345
* Call error_entry() and switch to the task stack if from userspace.
347346
*
@@ -1042,6 +1041,10 @@ SYM_CODE_END(paranoid_exit)
10421041
*/
10431042
SYM_CODE_START_LOCAL(error_entry)
10441043
UNWIND_HINT_FUNC
1044+
1045+
PUSH_AND_CLEAR_REGS save_ret=1
1046+
ENCODE_FRAME_POINTER 8
1047+
10451048
testb $3, CS+8(%rsp)
10461049
jz .Lerror_kernelspace
10471050

0 commit comments

Comments
 (0)