[PATCH v2] powerpc/64: system call implement the bulk of the logic in C

Nicholas Piggin npiggin at gmail.com
Thu Sep 5 14:29:13 AEST 2019


Michael Ellerman's on September 5, 2019 2:14 pm:
> Nicholas Piggin <npiggin at gmail.com> writes:
>> System call entry and particularly exit code is beyond the limit of what
>> is reasonable to implement in asm.
>>
>> This conversion moves all conditional branches out of the asm code,
>> except for the case that all GPRs should be restored at exit.
>>
>> Null syscall test is about 5% faster after this patch, because the exit
>> work is handled under local_irq_disable, and the hard mask and pending
>> interrupt replay is handled after that, which avoids games with MSR.
>>
>> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
>> ---
>> Since v1:
>> - Fix big endian build (mpe)
>> - Fix order of exit tracing to after the result registers have been set.
>> - Move ->softe store before MSR[EE] is set, fix the now obsolete comment.
>> - More #ifdef tidyups and writing the accounting helpers nicer (Christophe)
>> - Minor things like move the TM debug store into C
> 
> This doesn't build in a few configs.
> 
> It needed:
> 
> +#else
> +static inline void kuap_check_amr(void) { }
> 
> In kup-radix.h to fix the KUAP=n build.

Thanks.

> 
> It still fails to build on ppc64e with:
> 
>   arch/powerpc/kernel/syscall_64.c:161:2: error: implicit declaration of function '__mtmsrd' [-Werror=implicit-function-declaration]

Ah, no __mtmsrd or RI on BookE, so that will need a new function in
hw_irq.h. I think I also need to do the irq tracing with RI=1 now I 
think about it.

I'll resend a fixed patch.

Thanks,
Nick


More information about the Linuxppc-dev mailing list