common-user: Fix tail calls to safe_syscall_set_errno_tail
PATCH 1/1 common-user: Fix tail calls to safe_syscall_set_errno_tail
For the ABIs in which the syscall return register is not also the first function argument register, move the errno value into the correct place.
--- common-user/host/i386/safe-syscall.inc.S | 1 + common-user/host/mips/safe-syscall.inc.S | 1 + common-user/host/x86_64/safe-syscall.inc.S | 1 + 3 files changed, 3 insertions(+)
common-user/host/i386/safe-syscall.inc.S +1 -0
@@ -120,6 +120,7 @@ safe_syscall_end: pop %ebp .cfi_adjust_cfa_offset -4 .cfi_restore ebp + mov %eax, (%esp) jmp safe_syscall_set_errno_tail .cfi_endproc
common-user/host/mips/safe-syscall.inc.S +1 -0
@@ -141,6 +141,7 @@ safe_syscall_end: 1: USE_ALT_CP(t0) SETUP_GPX(t1) SETUP_GPX64(t0, t1) + move a0, v0 PTR_LA t9, safe_syscall_set_errno_tail jr t9
common-user/host/x86_64/safe-syscall.inc.S +1 -0
@@ -99,6 +99,7 @@ safe_syscall_end: 1: pop %rbp .cfi_def_cfa_offset 8 .cfi_restore rbp + mov %eax, %edi jmp safe_syscall_set_errno_tail .cfi_endproc
Signature · 1 line
2.25.1
Quoted 6 lines · Richard Henderson
For the ABIs in which the syscall return register is not also the first function argument register, move the errno value into the correct place.
Fixes a3310c0397e2
Using Laurent alias [*]:
safe_syscall_base")
[*] https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 7 lines
Reported-by Laurent Vivier <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- common-user/host/i386/safe-syscall.inc.S | 1 + common-user/host/mips/safe-syscall.inc.S | 1 + common-user/host/x86_64/safe-syscall.inc.S | 1 + 3 files changed, 3 insertions(+)
Le 04/01/2022 à 20:04, Richard Henderson a écrit :
Quoted 4 lines
For the ABIs in which the syscall return register is not also the first function argument register, move the errno value into the correct place.
Quoted 9 lines
Fixes a3310c0397e2Reported-by Laurent Vivier <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- common-user/host/i386/safe-syscall.inc.S | 1 + common-user/host/mips/safe-syscall.inc.S | 1 + common-user/host/x86_64/safe-syscall.inc.S | 1 + 3 files changed, 3 insertions(+)
Richard Henderson
AppliedQuoted 4 lines · Richard Henderson
For the ABIs in which the syscall return register is not also the first function argument register, move the errno value into the correct place.
Quoted 8 lines
Fixes a3310c0397e2Reported-by Laurent Vivier <[email protected]>Signed-off-by Richard Henderson <[email protected]>--- common-user/host/i386/safe-syscall.inc.S | 1 + common-user/host/mips/safe-syscall.inc.S | 1 + common-user/host/x86_64/safe-syscall.inc.S | 1 + 3 files changed, 3 insertions(+)
Queued to tcg-next.
r~