This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/4] aarch64: Re-implement setcontext without sigreturn syscall
- From: Will Newton <will dot newton at linaro dot org>
- To: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 19 Mar 2014 17:13:38 +0000
- Subject: Re: [PATCH 2/4] aarch64: Re-implement setcontext without sigreturn syscall
- Authentication-results: sourceware.org; auth=none
- References: <1394707543-9690-1-git-send-email-will dot newton at linaro dot org> <1394707543-9690-2-git-send-email-will dot newton at linaro dot org> <CAFqB+PywPqEXin+60vQDvVv0R94pgnibpqinSY-soozv=+YbEg at mail dot gmail dot com>
On 19 March 2014 16:39, Marcus Shawcroft <marcus.shawcroft@gmail.com> wrote:
> Hi Will,
>
> On 13 March 2014 10:45, Will Newton <will.newton@linaro.org> wrote:
>
> The use of x9 is clearly a none issue now. Which also means that the
> syscall code in sysdeps.h can be relaxed somewhat... That aside I
> have another comment on the parsing of extension blocks in the signal
> context:
>
>> + cfi_offset( d8, oV0 + 8 * SZVREG)
>> + cfi_offset( d9, oV0 + 9 * SZVREG)
>> + cfi_offset(d10, oV0 + 10 * SZVREG)
>> + cfi_offset(d11, oV0 + 11 * SZVREG)
>> + cfi_offset(d12, oV0 + 12 * SZVREG)
>> + cfi_offset(d13, oV0 + 13 * SZVREG)
>> + cfi_offset(d14, oV0 + 14 * SZVREG)
>> + cfi_offset(d15, oV0 + 15 * SZVREG)
>
>
>> + ldp x18, x19, [x0, oX0 + 18 * SZREG]
>> + ldp x20, x21, [x0, oX0 + 20 * SZREG]
>> + ldp x22, x23, [x0, oX0 + 22 * SZREG]
>> + ldp x24, x25, [x0, oX0 + 24 * SZREG]
>> + ldp x26, x27, [x0, oX0 + 26 * SZREG]
>> + ldp x28, x29, [x0, oX0 + 28 * SZREG]
>> + ldr x30, [x0, oX0 + 30 * SZREG]
>> + ldr x2, [x0, oSP]
>> + mov sp, x2
>> +
>> + /* Check for FP SIMD context. */
>> + add x2, x0, #oEXTENSION
>> +
>> + mov w3, #(FPSIMD_MAGIC & 0xffff)
>> + movk w3, #(FPSIMD_MAGIC >> 16), lsl #16
>> + ldr w1, [x2, #oHEAD + oMAGIC]
>> + cmp w1, w3
>> + b.ne 2f
>
> The code should not assume the next block will be the fp/simd block.
> The code should iterate over all of the remaining blocks using the
> size field looking for the magic marker of the fp/simd block or the
> null marker.
>
> This also implies the cfi_offset code above using oVo is incorrect.
> Note the existing use of oVo is used to construct context, it is valid
> for us to choose such a layout where the fpsimd block follows
> immediately after the initial context, but we should not assume the
> kernel will use such a layout.
As per the commit message this code will only be run on contexts
created by getcontext/makecontext and not on kernel created contexts.
I can add support for handling arbitrarily shaped contexts, but it may
cause some unnecessary complexity in the code.
--
Will Newton
Toolchain Working Group, Linaro