Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21023
b: refs/heads/master
c: c33d456
h: refs/heads/master
i:
  21021: a90b57e
  21019: c4021e5
  21015: a8f361f
  21007: 17f8c3f
  20991: d2687a6
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Mar 13, 2006
1 parent 4cfc81c commit 700faf2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 31fe4d331729e9687db84521c3ceb8e43390efcf
refs/heads/master: c33d4568aca9028a22857f94f5e0850012b6444b
29 changes: 11 additions & 18 deletions trunk/arch/x86_64/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ rff_trace:
* Interrupts are off on entry.
* Only called from user space.
*
* EM64T CPUs have somewhat weird error reporting for non canonical RIPs in SYSRET.
* We can't handle any exceptions there because the exception handler would
* end up running on the user stack which is unsafe. To avoid problems
* any code that might end up with a user touched pt_regs should return
* using int_ret_from_syscall.
*
* XXX if we had a free scratch register we could save the RSP into the stack frame
* and report it properly in ps. Unfortunately we haven't.
*/
Expand Down Expand Up @@ -254,7 +260,9 @@ sysret_signal:
xorl %esi,%esi # oldset -> arg2
call ptregscall_common
1: movl $_TIF_NEED_RESCHED,%edi
jmp sysret_check
/* Stack frame might have been changed. The IRET path does
some additional checks to handle this */
jmp int_with_check

badsys:
movq $-ENOSYS,RAX-ARGOFFSET(%rsp)
Expand All @@ -280,7 +288,8 @@ tracesys:
call syscall_trace_leave
RESTORE_TOP_OF_STACK %rbx
RESTORE_REST
jmp ret_from_sys_call
/* Stack frame might have been changed. Use the more careful IRET path */
jmp int_ret_from_sys_call
CFI_ENDPROC

/*
Expand Down Expand Up @@ -408,25 +417,9 @@ ENTRY(stub_execve)
CFI_ADJUST_CFA_OFFSET -8
CFI_REGISTER rip, r11
SAVE_REST
movq %r11, %r15
CFI_REGISTER rip, r15
FIXUP_TOP_OF_STACK %r11
call sys_execve
GET_THREAD_INFO(%rcx)
bt $TIF_IA32,threadinfo_flags(%rcx)
CFI_REMEMBER_STATE
jc exec_32bit
RESTORE_TOP_OF_STACK %r11
movq %r15, %r11
CFI_REGISTER rip, r11
RESTORE_REST
pushq %r11
CFI_ADJUST_CFA_OFFSET 8
CFI_REL_OFFSET rip, 0
ret

exec_32bit:
CFI_RESTORE_STATE
movq %rax,RAX(%rsp)
RESTORE_REST
jmp int_ret_from_sys_call
Expand Down

0 comments on commit 700faf2

Please sign in to comment.