x86: call free_init_pages() with irqs enabled in alternative_instructions()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / x86 / kernel / alternative.c
index 11b03d3c6fdaf36a65f2d86aa769eddd44e914e6..dff1c9e1c2eefa6032e862a993255424e07757f7 100644 (file)
@@ -415,9 +415,6 @@ void __init alternative_instructions(void)
                        alternatives_smp_unlock(__smp_locks, __smp_locks_end,
                                                _text, _etext);
                }
-               free_init_pages("SMP alternatives",
-                               (unsigned long)__smp_locks,
-                               (unsigned long)__smp_locks_end);
        } else {
                alternatives_smp_module_add(NULL, "core kernel",
                                            __smp_locks, __smp_locks_end,
@@ -428,6 +425,11 @@ void __init alternative_instructions(void)
        apply_paravirt(__parainstructions, __parainstructions_end);
        local_irq_restore(flags);
 
+       if (smp_alt_once)
+               free_init_pages("SMP alternatives",
+                               (unsigned long)__smp_locks,
+                               (unsigned long)__smp_locks_end);
+
        restart_nmi();
 #ifdef CONFIG_X86_MCE
        restart_mce();