Merge tag 'powerpc-6.10-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-block.git] / arch / powerpc / include / asm / interrupt.h
index 7b610864b3645eeee706a9be4e91ba8c782558f5..2d6c886b40f4479eb75a9dc32166996e137bc5ad 100644 (file)
@@ -336,6 +336,14 @@ static inline void interrupt_nmi_enter_prepare(struct pt_regs *regs, struct inte
        if (IS_ENABLED(CONFIG_KASAN))
                return;
 
+       /*
+        * Likewise, do not use it in real mode if percpu first chunk is not
+        * embedded. With CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK enabled there
+        * are chances where percpu allocation can come from vmalloc area.
+        */
+       if (percpu_first_chunk_is_paged)
+               return;
+
        /* Otherwise, it should be safe to call it */
        nmi_enter();
 }
@@ -351,6 +359,8 @@ static inline void interrupt_nmi_exit_prepare(struct pt_regs *regs, struct inter
                // no nmi_exit for a pseries hash guest taking a real mode exception
        } else if (IS_ENABLED(CONFIG_KASAN)) {
                // no nmi_exit for KASAN in real mode
+       } else if (percpu_first_chunk_is_paged) {
+               // no nmi_exit if percpu first chunk is not embedded
        } else {
                nmi_exit();
        }