powerpc/64: Sanitise common exit code for interrupts
authorRohan McLure <rmclure@linux.ibm.com>
Thu, 1 Dec 2022 07:10:15 +0000 (18:10 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 2 Dec 2022 09:46:01 +0000 (20:46 +1100)
commit75c5d6b1e194c341371639469fcb8691afa0e254
treec223d9dc1544e3026522f44a5b8e86ef182f8469
parentcbf892ba56677b942020d2bc7ca9b79281fa0bcc
powerpc/64: Sanitise common exit code for interrupts

Interrupt code is shared between Book3E/S 64-bit systems for interrupt
handlers. Ensure that exit code correctly restores non-volatile gprs on
each system when CONFIG_INTERRUPT_SANITIZE_REGISTERS is enabled.

Also introduce macros for clearing/restoring registers on interrupt
entry for when this configuration option is either disabled or enabled.

Reviewed-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Rohan McLure <rmclure@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20221201071019.1953023-3-rmclure@linux.ibm.com
arch/powerpc/kernel/interrupt_64.S