[PATCH] powerpc: 32 bit getcpu VDSO function uses 64 bit instructions

Peter Bergner bergner at vnet.ibm.com
Thu Nov 27 10:50:27 AEDT 2014


On Thu, 2014-11-27 at 09:38 +1100, Michael Ellerman wrote:
> On Thu, 2014-11-27 at 08:11 +1100, Anton Blanchard wrote:
> > I used some 64 bit instructions when adding the 32 bit getcpu VDSO
> > function. Fix it.
> 
> Ouch. The symptom is a SIGILL I presume?

Nope, you don't get a SIGILL when executing 64-bit instructions in
32-bit mode, so it'll happily just execute the instruction, doing
a full 64-bit compare.  I'm guessing that the upper 32-bits of both
r3 and r4 contain zeros, so we're probably just getting lucky.


> Could we catch this by forcing -m32 in the CFLAGS for vdso32 ?

As Segher mentioned, GCC passing -many down to the assembler means
-m32 won't help.  It was due to Anton disabling that gcc "feature",
that this was caught.

Peter





More information about the Linuxppc-dev mailing list