This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] aarch64: Save and restore SVE registers in ld.so


On 08/02/2018 10:25 AM, Florian Weimer wrote:
> On 08/02/2018 04:18 PM, Carlos O'Donell wrote:
>> On 08/02/2018 09:32 AM, Szabolcs Nagy wrote:
>>> On 02/08/18 14:05, Richard Henderson wrote:
>>>> On 08/02/2018 03:29 AM, Florian Weimer wrote:
>>>>> On 08/02/2018 12:23 AM, rth@twiddle.net wrote:
>>>>>> +/*
>>>>>> + * For functions conforming to the procedure call standard as
>>>>>> + * amended for SVE support (ARM_100986_0000_00_en (SVEpcs 00bet1)),
>>>>>> + * we must save the entire contents of Z0-Z7 as well as P0-P3.
>>>>>> + */
>>>>>
>>>>> What's the worst-case additional stack usage due to this change?
>>>>
>>>> The current architectural maximum vector size is 256 bytes,
>>>> so 2176 bytes total.
>>>>
>>>
>>> that limit can increase in the future and saving 8 z regs is not enough,
>>> you need to save all 32 if the resolver code may touch the 32 fp regs.
>>> (so with 256byte regs it's 8k + 128bytes for 4 pregs)
>>
>> AArch64 has PTHREAD_MIN_STACK of 128KiB so this should be more than enough
>> to save and restore SVE registers for some simple function calling.
> 
> On the other hand, there is also this:
> 
> /* Minimum stack size for a signal handler.  */
> #define MINSIGSTKSZ     5120
> 
> /* System default stack size.  */
> #define SIGSTKSZ        16384
> 
> Since the kernel will also push >8KiB on the signal handler stack, SIGSTKSZ is no longer sufficient.

Absolutely correct.

Clearly old binaries won't work, and you have to bump these values and then
draw a line in the sand for SVE working, or not working.

We could bump SIGSTKSZ and MINSIGSTKSZ, and then use a flag day ABI change
with object style markup like x86 did for Intel CET.

You markup all of the objects, check the markup at runtime, and enable or
disable the use of SVE at runtime if you have a mixed set of objects that
can't possibly work.

-- 
Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]