[PATCH 10/14] powerpc/64: use interrupt restart table to speed up return from interrupt

Nicholas Piggin npiggin at gmail.com
Wed Mar 17 10:46:01 AEDT 2021


Excerpts from Christophe Leroy's message of March 17, 2021 5:34 am:
> 
> 
> Le 15/03/2021 à 23:03, Nicholas Piggin a écrit :
>> The restart table facility is used to return from interrupt without
>> disabling MSR EE or RI.
> 
> What happens when an interrupt happens between the point you restore the user r1 and the rfi which 
> returns to user ?
> If an interrupt happens there, the interrupt prolog sees it as an interrupt coming from kernel, so 
> it uses r1 as is, but r1 points to user stack.

The interrupt is "soft-masked" because it arrives from kernel with an 
address below __end_soft_masked. Masked interrupts never touch the 
stack. It then checks the restart table and finds an entry, so it 
returns to the restart which loads the previous r1 from paca.

Thanks,
Nick



More information about the Linuxppc-dev mailing list