Re: [PATCH v4 1/9] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall
flat view
From: Naveen N. Rao <hidden>
Date: 2016-02-16 05:03:42
On 2016/02/16 11:06AM, Cyril Bur wrote:
On Mon, 15 Feb 2016 22:29:17 +0530 "Naveen N. Rao" [off-list ref] wrote:quoted
On 2016/02/15 04:07PM, Cyril Bur wrote:quoted
Test that the non volatile floating point and Altivec registers get correctly preserved across the fork() syscall. fork() works nicely for this purpose, the registers should be the same for both parent and child Signed-off-by: Cyril Bur <redacted> ---
<snip>
quoted
quoted
+ +/* It is very important to note here that _extra is the extra amount of + * stack space needed. + * This space must be accessed at sp + 32!Hi Naveen, Thanks for the review.quoted
This looks to be specific to ABIv2. Is this series limited to ppc64le? If so, you might want to ensure this only builds there.Is ABIv1 still in use? Can we still compile for v1?
Yes, that's the earlier ppc64 BE (I'm assuming these tests can be run when booted in LPARs as well)
This is for series 64bit only, I've not really got any reason to believe this is LE only, shouldn't this work BE? The makefile enforces 64bit, I believe it is
This won't work for ABIv1 BE since the stack setup is a bit different. I think your patches assume that 32 bytes is the minimum stack size, but that's only for ABIv2. Also, the locations of CR and TOC save areas on the stack are quite different: http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#STACK
ok for kernel selftests to fail to compile if they aren't going to be able to run.quoted
Also: #define PPC_ABIV2_MIN_STACK_SIZE 32 or just: #define PPC_MIN_STACK 32 ... is helpful. And, you might want to base the rest of your code that use PUSH_BASIC_STACK() on that. If we ever want to have these tests run anywhere else, that'll help a lot. (See further below)So I thought about it. I agree that it would be nice, I just worry that I might get rabbitholed, I can see it going further and then providing stack accessors to abstract out even PPC_MIN_STACK except in a bunch of macros, and that's when I know I've gone too far. Perhaps I could look at adding this when I write more tests, I have grand plans to push way more tests.
Sure - just that if you ever intend to have these for ABIv1, it will be way easier to put together macros now rather than later. - Naveen