diff options
author | Jan Beulich <jbeulich@novell.com> | 2006-12-06 20:14:02 -0500 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-12-06 20:14:02 -0500 |
commit | bcddc0155f351ab3f06c6ede6d91fd399ef9e18f (patch) | |
tree | e3ba814c9cb319f6e486aea8e0fe537177f9594f | |
parent | da68933e0a999fb13636653c710cca701b457ad2 (diff) |
[PATCH] x86-64: miscellaneous entry.S adjustments
This patch:
- makes ret_from_sys_call no longer global (all external users were
previously switched to use int_ret_from_sys_call)
- adjusts placement of a CFI_{REMEMBER,RESTORE}_STATE pair to better
fit logic flow
- eliminates an unnecessary pair of CFI_{REMEMBER,RESTORE}_STATE
- glues together function- and unwinder-wise the previously separate
system_call and int_ret_from_sys_call function fragments
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Andi Kleen <ak@suse.de>
-rw-r--r-- | arch/x86_64/kernel/entry.S | 36 |
1 files changed, 6 insertions, 30 deletions
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S index 7d401b00d822..601d332c4b79 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86_64/kernel/entry.S | |||
@@ -230,7 +230,6 @@ ENTRY(system_call) | |||
230 | CFI_REL_OFFSET rip,RIP-ARGOFFSET | 230 | CFI_REL_OFFSET rip,RIP-ARGOFFSET |
231 | GET_THREAD_INFO(%rcx) | 231 | GET_THREAD_INFO(%rcx) |
232 | testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx) | 232 | testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP),threadinfo_flags(%rcx) |
233 | CFI_REMEMBER_STATE | ||
234 | jnz tracesys | 233 | jnz tracesys |
235 | cmpq $__NR_syscall_max,%rax | 234 | cmpq $__NR_syscall_max,%rax |
236 | ja badsys | 235 | ja badsys |
@@ -241,7 +240,6 @@ ENTRY(system_call) | |||
241 | * Syscall return path ending with SYSRET (fast path) | 240 | * Syscall return path ending with SYSRET (fast path) |
242 | * Has incomplete stack frame and undefined top of stack. | 241 | * Has incomplete stack frame and undefined top of stack. |
243 | */ | 242 | */ |
244 | .globl ret_from_sys_call | ||
245 | ret_from_sys_call: | 243 | ret_from_sys_call: |
246 | movl $_TIF_ALLWORK_MASK,%edi | 244 | movl $_TIF_ALLWORK_MASK,%edi |
247 | /* edi: flagmask */ | 245 | /* edi: flagmask */ |
@@ -251,8 +249,8 @@ sysret_check: | |||
251 | TRACE_IRQS_OFF | 249 | TRACE_IRQS_OFF |
252 | movl threadinfo_flags(%rcx),%edx | 250 | movl threadinfo_flags(%rcx),%edx |
253 | andl %edi,%edx | 251 | andl %edi,%edx |
254 | CFI_REMEMBER_STATE | ||
255 | jnz sysret_careful | 252 | jnz sysret_careful |
253 | CFI_REMEMBER_STATE | ||
256 | /* | 254 | /* |
257 | * sysretq will re-enable interrupts: | 255 | * sysretq will re-enable interrupts: |
258 | */ | 256 | */ |
@@ -265,10 +263,10 @@ sysret_check: | |||
265 | swapgs | 263 | swapgs |
266 | sysretq | 264 | sysretq |
267 | 265 | ||
266 | CFI_RESTORE_STATE | ||
268 | /* Handle reschedules */ | 267 | /* Handle reschedules */ |
269 | /* edx: work, edi: workmask */ | 268 | /* edx: work, edi: workmask */ |
270 | sysret_careful: | 269 | sysret_careful: |
271 | CFI_RESTORE_STATE | ||
272 | bt $TIF_NEED_RESCHED,%edx | 270 | bt $TIF_NEED_RESCHED,%edx |
273 | jnc sysret_signal | 271 | jnc sysret_signal |
274 | TRACE_IRQS_ON | 272 | TRACE_IRQS_ON |
@@ -306,7 +304,6 @@ badsys: | |||
306 | 304 | ||
307 | /* Do syscall tracing */ | 305 | /* Do syscall tracing */ |
308 | tracesys: | 306 | tracesys: |
309 | CFI_RESTORE_STATE | ||
310 | SAVE_REST | 307 | SAVE_REST |
311 | movq $-ENOSYS,RAX(%rsp) | 308 | movq $-ENOSYS,RAX(%rsp) |
312 | FIXUP_TOP_OF_STACK %rdi | 309 | FIXUP_TOP_OF_STACK %rdi |
@@ -322,32 +319,13 @@ tracesys: | |||
322 | call *sys_call_table(,%rax,8) | 319 | call *sys_call_table(,%rax,8) |
323 | 1: movq %rax,RAX-ARGOFFSET(%rsp) | 320 | 1: movq %rax,RAX-ARGOFFSET(%rsp) |
324 | /* Use IRET because user could have changed frame */ | 321 | /* Use IRET because user could have changed frame */ |
325 | jmp int_ret_from_sys_call | ||
326 | CFI_ENDPROC | ||
327 | END(system_call) | ||
328 | 322 | ||
329 | /* | 323 | /* |
330 | * Syscall return path ending with IRET. | 324 | * Syscall return path ending with IRET. |
331 | * Has correct top of stack, but partial stack frame. | 325 | * Has correct top of stack, but partial stack frame. |
332 | */ | 326 | */ |
333 | ENTRY(int_ret_from_sys_call) | 327 | .globl int_ret_from_sys_call |
334 | CFI_STARTPROC simple | 328 | int_ret_from_sys_call: |
335 | CFI_SIGNAL_FRAME | ||
336 | CFI_DEF_CFA rsp,SS+8-ARGOFFSET | ||
337 | /*CFI_REL_OFFSET ss,SS-ARGOFFSET*/ | ||
338 | CFI_REL_OFFSET rsp,RSP-ARGOFFSET | ||
339 | /*CFI_REL_OFFSET rflags,EFLAGS-ARGOFFSET*/ | ||
340 | /*CFI_REL_OFFSET cs,CS-ARGOFFSET*/ | ||
341 | CFI_REL_OFFSET rip,RIP-ARGOFFSET | ||
342 | CFI_REL_OFFSET rdx,RDX-ARGOFFSET | ||
343 | CFI_REL_OFFSET rcx,RCX-ARGOFFSET | ||
344 | CFI_REL_OFFSET rax,RAX-ARGOFFSET | ||
345 | CFI_REL_OFFSET rdi,RDI-ARGOFFSET | ||
346 | CFI_REL_OFFSET rsi,RSI-ARGOFFSET | ||
347 | CFI_REL_OFFSET r8,R8-ARGOFFSET | ||
348 | CFI_REL_OFFSET r9,R9-ARGOFFSET | ||
349 | CFI_REL_OFFSET r10,R10-ARGOFFSET | ||
350 | CFI_REL_OFFSET r11,R11-ARGOFFSET | ||
351 | cli | 329 | cli |
352 | TRACE_IRQS_OFF | 330 | TRACE_IRQS_OFF |
353 | testl $3,CS-ARGOFFSET(%rsp) | 331 | testl $3,CS-ARGOFFSET(%rsp) |
@@ -394,8 +372,6 @@ int_very_careful: | |||
394 | popq %rdi | 372 | popq %rdi |
395 | CFI_ADJUST_CFA_OFFSET -8 | 373 | CFI_ADJUST_CFA_OFFSET -8 |
396 | andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi | 374 | andl $~(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP),%edi |
397 | cli | ||
398 | TRACE_IRQS_OFF | ||
399 | jmp int_restore_rest | 375 | jmp int_restore_rest |
400 | 376 | ||
401 | int_signal: | 377 | int_signal: |
@@ -411,7 +387,7 @@ int_restore_rest: | |||
411 | TRACE_IRQS_OFF | 387 | TRACE_IRQS_OFF |
412 | jmp int_with_check | 388 | jmp int_with_check |
413 | CFI_ENDPROC | 389 | CFI_ENDPROC |
414 | END(int_ret_from_sys_call) | 390 | END(system_call) |
415 | 391 | ||
416 | /* | 392 | /* |
417 | * Certain special system calls that need to save a complete full stack frame. | 393 | * Certain special system calls that need to save a complete full stack frame. |