Excerpts from Christophe Leroy's message of March 17, 2021 5:34 am:
Le 15/03/2021 à 23:03, Nicholas Piggin a écrit :
quoted
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