This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/6] aarch64: Improve sysdep-cancel.h
- From: Will Newton <will dot newton at linaro dot org>
- To: Richard Henderson <rth at twiddle dot net>
- Cc: libc-alpha <libc-alpha at sourceware dot org>, Marcus Shawcroft <marcus dot shawcroft at gmail dot com>, Richard Henderson <rth at redhat dot com>
- Date: Wed, 21 May 2014 16:19:03 +0100
- Subject: Re: [PATCH 4/6] aarch64: Improve sysdep-cancel.h
- Authentication-results: sourceware.org; auth=none
- References: <1400619378-7262-1-git-send-email-rth at twiddle dot net> <1400619378-7262-5-git-send-email-rth at twiddle dot net> <537CC1DF dot 8010002 at twiddle dot net>
On 21 May 2014 16:10, Richard Henderson <rth@twiddle.net> wrote:
> On 05/20/2014 01:56 PM, Richard Henderson wrote:
>> - mov x16, x0; /* put mask in safe place. */ \
>> - UNDOCARGS_##args; /* restore syscall args. */ \
>> - mov x8, SYS_ify (syscall_name); /* do the call. */ \
>> - svc 0; \
>> - str x0, [sp, -16]!; /* save syscall return value. */ \
>> - cfi_adjust_cfa_offset (16); \
>> - mov x0, x16; /* get mask back. */ \
>
> Oh, I should have mentioned, that there's either a bug or inconsistency here.
>
> We're saving a value in x16 around the syscall. Except that on the C side, for
> the inline syscalls, we mark x16 as clobbered.
>
> My patch assumes that we want to assume "normal-ish" calling conventions for
> the kernel and puts the value in the normal call saved register x19.
>
> If there are in fact a set of calling-convention call-clobbered registers that
> are not clobbered by syscalls, then we should consider adjusting the inline
> syscalls to match.
When this was discussed previously it turns out that everything apart
from the return value is preserved:
https://sourceware.org/ml/libc-alpha/2014-03/msg00552.html
I guess it would be better to avoid clobbering so many registers in
the inline case.
--
Will Newton
Toolchain Working Group, Linaro