kexec: introduce a protection mechanism for the crashkernel reserved memory
[sfrench/cifs-2.6.git] / kernel / kexec_core.c
index 1391d3ee3b8666c07b677ffd35a5fd2f2b2882d7..48b73cc8e42508933dc4cb813c3eb77f87098a8f 100644 (file)
@@ -893,6 +893,7 @@ void crash_kexec(struct pt_regs *regs)
        old_cpu = atomic_cmpxchg(&panic_cpu, PANIC_CPU_INVALID, this_cpu);
        if (old_cpu == PANIC_CPU_INVALID) {
                /* This is the 1st CPU which comes here, so go ahead. */
+               printk_nmi_flush_on_panic();
                __crash_kexec(regs);
 
                /*
@@ -1410,7 +1411,7 @@ static int __init crash_save_vmcoreinfo_init(void)
        VMCOREINFO_STRUCT_SIZE(list_head);
        VMCOREINFO_SIZE(nodemask_t);
        VMCOREINFO_OFFSET(page, flags);
-       VMCOREINFO_OFFSET(page, _count);
+       VMCOREINFO_OFFSET(page, _refcount);
        VMCOREINFO_OFFSET(page, mapping);
        VMCOREINFO_OFFSET(page, lru);
        VMCOREINFO_OFFSET(page, _mapcount);
@@ -1562,3 +1563,9 @@ void __weak crash_map_reserved_pages(void)
 
 void __weak crash_unmap_reserved_pages(void)
 {}
+
+void __weak arch_kexec_protect_crashkres(void)
+{}
+
+void __weak arch_kexec_unprotect_crashkres(void)
+{}