radix_enabled() uses a jump label which is only valid after mmu_feature_keys_init() is called. Before that point, on a pSeries hash guest, early_check_vec5() clears MMU_FTR_TYPE_RADIX in cur_cpu_spec->mmu_features but the jump label has not yet been patched, so radix_enabled() incorrectly returns true.
Replace radix_enabled() with early_radix_enabled() which does a plain bitmask check against cur_cpu_spec->mmu_features and is correct at all times, including before jump label initialization. Add the missing #include <asm/mmu.h> since early_radix_enabled() is declared there. Signed-off-by: Venkat Rao Bagalkote <[email protected]> --- arch/powerpc/include/asm/interrupt.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h index 1b45a49e9bed..36a654e780f7 100644 --- a/arch/powerpc/include/asm/interrupt.h +++ b/arch/powerpc/include/asm/interrupt.h @@ -71,6 +71,7 @@ #include <asm/kprobes.h> #include <asm/runlatch.h> +#include <asm/mmu.h> #ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG /* @@ -290,7 +291,7 @@ interrupt_handler long func(struct pt_regs *regs) \ state = irqentry_nmi_enter(regs); \ } else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && \ firmware_has_feature(FW_FEATURE_LPAR) && \ - !radix_enabled()) { \ + !early_radix_enabled()) { \ /* no nmi_entry for a pseries hash guest \ * taking a real mode exception */ \ } else if (IS_ENABLED(CONFIG_KASAN)) { \ @@ -307,7 +308,7 @@ interrupt_handler long func(struct pt_regs *regs) \ irqentry_nmi_exit(regs, state); \ } else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) && \ firmware_has_feature(FW_FEATURE_LPAR) && \ - !radix_enabled()) { \ + !early_radix_enabled()) { \ /* no nmi_exit for a pseries hash guest \ * taking a real mode exception */ \ } else if (IS_ENABLED(CONFIG_KASAN)) { \ -- 2.45.2
