Subject: Re: [PATCH v2 0/4] powerpc/64: syscalls in C

From: Segher Boessenkool <[email-masked]>
Date: Thu, 29 Aug 2019 06:51:22 -0500

On Thu, Aug 29, 2019 at 07:38:01PM +1000, Nicholas Piggin wrote:
> So... this actually seems to work. Haven't booted it, but the compiler
> seems to do what we want.

>From the GCC manual:

   After defining a global register variable, for the current compilation
  unit:

     * If the register is a call-saved register, call ABI is affected: the
       register will not be restored in function epilogue sequences after
       the variable has been assigned.  Therefore, functions cannot safely
       return to callers that assume standard ABI.

and

     * Accesses to the variable may be optimized as usual and the register
       remains available for allocation and use in any computations,
       provided that observable values of the variable are not affected.

This doesn't do what you think, or what you want, or what you think you
want ;-)

(And if you make all those regs -ffixed-* you are in for a world of hurt).

Segher