]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
powerpc/64: mark irqs hard disabled in boot paca
authorNicholas Piggin <npiggin@gmail.com>
Mon, 26 Sep 2022 05:43:00 +0000 (15:43 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 28 Sep 2022 09:22:11 +0000 (19:22 +1000)
This prevents interrupts in early boot (e.g., program check) from
enabling MSR[EE], potentially causing endian mismatch or other
crashes when reporting early boot traps.

Fixes: 4423eb5ae32ec ("powerpc/64/interrupt: make normal synchronous interrupts enable MSR[EE] if possible")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20220926054305.2671436-3-npiggin@gmail.com
arch/powerpc/kernel/setup_64.c

index 6434a3f6acb589ae2c8ed09d5a8c31babe9727f6..e1ac803c9046dcbf16d6a80432219377954c8889 100644 (file)
@@ -182,8 +182,10 @@ static void __init fixup_boot_paca(void)
        get_paca()->cpu_start = 1;
        /* Allow percpu accesses to work until we setup percpu data */
        get_paca()->data_offset = 0;
-       /* Mark interrupts disabled in PACA */
+       /* Mark interrupts soft and hard disabled in PACA */
        irq_soft_mask_set(IRQS_DISABLED);
+       get_paca()->irq_happened = PACA_IRQ_HARD_DIS;
+       WARN_ON(mfmsr() & MSR_EE);
 }
 
 static void __init configure_exceptions(void)