summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/head_64.S
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2022-09-26 15:56:20 +1000
committerMichael Ellerman <mpe@ellerman.id.au>2022-09-28 19:22:13 +1000
commite1100cee059ad0bea6a668177e835baa087a0c65 (patch)
tree30d137b21beef7499d9fcc7d27a4cc9199e33b84 /arch/powerpc/kernel/head_64.S
parent519b2e317e39ac99ce589a7c8480c47a17d62638 (diff)
downloadlwn-e1100cee059ad0bea6a668177e835baa087a0c65.tar.gz
lwn-e1100cee059ad0bea6a668177e835baa087a0c65.zip
powerpc/64s/interrupt: halt early boot interrupts if paca is not set up
Ensure r13 is zero from very early in boot until it gets set to the boot paca pointer. This allows early program and mce handlers to halt if there is no valid paca, rather than potentially run off into the weeds. This preserves register and memory contents for low level debugging tools. Nothing could be printed to console at this point in any case because even udbg is only set up after the boot paca is set, so this shouldn't be missed. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220926055620.2676869-6-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r--arch/powerpc/kernel/head_64.S3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index c63e0c086f03..cfc09a96a420 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -487,6 +487,9 @@ __start_initialization_multiplatform:
/* Make sure we are running in 64 bits mode */
bl enable_64b_mode
+ /* Zero r13 (paca) so early program check / mce don't use it */
+ li r13,0
+
/* Get TOC pointer (current runtime address) */
bl relative_toc