[PATCH v2 11/14] powerpc/64s: Clear/restore caller gprs in syscall interrupt/return

Rohan McLure rmclure at linux.ibm.com
Mon Aug 15 10:29:53 AEST 2022


> On 11 Aug 2022, at 8:11 pm, Andrew Donnellan <ajd at linux.ibm.com> wrote:
> 
> On Mon, 2022-07-25 at 16:31 +1000, Rohan McLure wrote:
>> Clear user state in gprs (assign to zero) to reduce the influence of
>> user
>> registers on speculation within kernel syscall handlers. Clears occur
>> at the very beginning of the sc and scv 0 interrupt handlers, with
>> restores occurring following the execution of the syscall handler.
>> 
>> One function of syscall_exit_prepare is to determine when non-
>> volatile
>> regs must be restored, and it still serves that purpose on 32-bit.
>> Use
>> it now for determining where to find XER, CTR, CR.
> 
> I'm not sure exactly how syscall_exit_prepare comes into this?

Apologies, this comment belongs in patch 14 and concerns interrupt_exit_user_prepare.


More information about the Linuxppc-dev mailing list