|
29 | 29 |
|
30 | 30 | .section .entry.text, "ax"
|
31 | 31 |
|
32 |
| - /* |
33 |
| - * Reload arg registers from stack in case ptrace changed them. |
34 |
| - * We don't reload %eax because syscall_trace_enter() returned |
35 |
| - * the %rax value we should see. Instead, we just truncate that |
36 |
| - * value to 32 bits again as we did on entry from user mode. |
37 |
| - * If it's a new value set by user_regset during entry tracing, |
38 |
| - * this matches the normal truncation of the user-mode value. |
39 |
| - * If it's -1 to make us punt the syscall, then (u32)-1 is still |
40 |
| - * an appropriately invalid value. |
41 |
| - */ |
42 |
| - .macro LOAD_ARGS32 _r9=0 |
43 |
| - .if \_r9 |
44 |
| - movl R9(%rsp),%r9d |
45 |
| - .endif |
46 |
| - movl RCX(%rsp),%ecx |
47 |
| - movl RDX(%rsp),%edx |
48 |
| - movl RSI(%rsp),%esi |
49 |
| - movl RDI(%rsp),%edi |
50 |
| - movl %eax,%eax /* zero extension */ |
51 |
| - .endm |
52 |
| - |
53 |
| - |
54 | 32 | #ifdef CONFIG_PARAVIRT
|
55 | 33 | ENTRY(native_usergs_sysret32)
|
56 | 34 | swapgs
|
@@ -269,7 +247,14 @@ sysenter_tracesys:
|
269 | 247 | movq %rax, R8(%rsp)
|
270 | 248 | movq %rsp,%rdi /* &pt_regs -> arg1 */
|
271 | 249 | call syscall_trace_enter
|
272 |
| - LOAD_ARGS32 /* reload args from stack in case ptrace changed it */ |
| 250 | + |
| 251 | + /* Reload arg registers from stack. (see sysenter_tracesys) */ |
| 252 | + movl RCX(%rsp), %ecx |
| 253 | + movl RDX(%rsp), %edx |
| 254 | + movl RSI(%rsp), %esi |
| 255 | + movl RDI(%rsp), %edi |
| 256 | + movl %eax, %eax /* zero extension */ |
| 257 | + |
273 | 258 | RESTORE_EXTRA_REGS
|
274 | 259 | jmp sysenter_do_call
|
275 | 260 | ENDPROC(ia32_sysenter_target)
|
@@ -413,7 +398,15 @@ cstar_tracesys:
|
413 | 398 | movq %rax, R8(%rsp)
|
414 | 399 | movq %rsp,%rdi /* &pt_regs -> arg1 */
|
415 | 400 | call syscall_trace_enter
|
416 |
| - LOAD_ARGS32 1 /* reload args from stack in case ptrace changed it */ |
| 401 | + movl R9(%rsp),%r9d |
| 402 | + |
| 403 | + /* Reload arg registers from stack. (see sysenter_tracesys) */ |
| 404 | + movl RCX(%rsp), %ecx |
| 405 | + movl RDX(%rsp), %edx |
| 406 | + movl RSI(%rsp), %esi |
| 407 | + movl RDI(%rsp), %edi |
| 408 | + movl %eax, %eax /* zero extension */ |
| 409 | + |
417 | 410 | RESTORE_EXTRA_REGS
|
418 | 411 | xchgl %ebp,%r9d
|
419 | 412 | jmp cstar_do_call
|
@@ -502,7 +495,18 @@ ia32_tracesys:
|
502 | 495 | SAVE_EXTRA_REGS
|
503 | 496 | movq %rsp,%rdi /* &pt_regs -> arg1 */
|
504 | 497 | call syscall_trace_enter
|
505 |
| - LOAD_ARGS32 /* reload args from stack in case ptrace changed it */ |
| 498 | + /* |
| 499 | + * Reload arg registers from stack in case ptrace changed them. |
| 500 | + * Don't reload %eax because syscall_trace_enter() returned |
| 501 | + * the %rax value we should see. But do truncate it to 32 bits. |
| 502 | + * If it's -1 to make us punt the syscall, then (u32)-1 is still |
| 503 | + * an appropriately invalid value. |
| 504 | + */ |
| 505 | + movl RCX(%rsp), %ecx |
| 506 | + movl RDX(%rsp), %edx |
| 507 | + movl RSI(%rsp), %esi |
| 508 | + movl RDI(%rsp), %edi |
| 509 | + movl %eax, %eax /* zero extension */ |
506 | 510 | RESTORE_EXTRA_REGS
|
507 | 511 | jmp ia32_do_call
|
508 | 512 | END(ia32_syscall)
|
|
0 commit comments