[PATCH v4 1/9] selftests/powerpc: Test the preservation of FPU and VMX regs across syscall

Naveen N. Rao naveen.n.rao at linux.vnet.ibm.com
Tue Feb 16 16:02:55 AEDT 2016


On 2016/02/16 11:06AM, Cyril Bur wrote:
> On Mon, 15 Feb 2016 22:29:17 +0530
> "Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> wrote:
> 
> > On 2016/02/15 04:07PM, Cyril Bur wrote:
> > > 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 <cyrilbur at gmail.com>
> > > ---

<snip>

> > > +
> > > +/* 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.
> 
> > 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.
> 
> > 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



More information about the Linuxppc-dev mailing list