Skip to content

Commit 1b331ee

Browse files
Peter Zijlstrasuryasaimadhu
authored andcommitted
x86/entry: Remove skip_r11rcx
Yes, r11 and rcx have been restored previously, but since they're being popped anyway (into rsi) might as well pop them into their own regs -- setting them to the value they already are. Less magical code. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8c42819 commit 1b331ee

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

arch/x86/entry/calling.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,27 +120,19 @@ For 32-bit we have the following conventions - kernel is built with
120120
CLEAR_REGS
121121
.endm
122122

123-
.macro POP_REGS pop_rdi=1 skip_r11rcx=0
123+
.macro POP_REGS pop_rdi=1
124124
popq %r15
125125
popq %r14
126126
popq %r13
127127
popq %r12
128128
popq %rbp
129129
popq %rbx
130-
.if \skip_r11rcx
131-
popq %rsi
132-
.else
133130
popq %r11
134-
.endif
135131
popq %r10
136132
popq %r9
137133
popq %r8
138134
popq %rax
139-
.if \skip_r11rcx
140-
popq %rsi
141-
.else
142135
popq %rcx
143-
.endif
144136
popq %rdx
145137
popq %rsi
146138
.if \pop_rdi

arch/x86/entry/entry_64.S

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ SYM_INNER_LABEL(entry_SYSCALL_64_after_hwframe, SYM_L_GLOBAL)
191191
* perf profiles. Nothing jumps here.
192192
*/
193193
syscall_return_via_sysret:
194-
/* rcx and r11 are already restored (see code above) */
195-
POP_REGS pop_rdi=0 skip_r11rcx=1
194+
POP_REGS pop_rdi=0
196195

197196
/*
198197
* Now all regs are restored except RSP and RDI.

0 commit comments

Comments
 (0)