]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
powerpc/fadump: remove dependency with CONFIG_KEXEC
authorHari Bathini <hbathini@linux.vnet.ibm.com>
Mon, 8 May 2017 22:56:24 +0000 (15:56 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 9 May 2017 00:15:11 +0000 (17:15 -0700)
Now that crashkernel parameter parsing and vmcoreinfo related code is
moved under CONFIG_CRASH_CORE instead of CONFIG_KEXEC_CORE, remove
dependency with CONFIG_KEXEC for CONFIG_FA_DUMP.  While here, get rid of
definitions of fadump_append_elf_note() & fadump_final_note() functions
to reuse similar functions compiled under CONFIG_CRASH_CORE.

Link: http://lkml.kernel.org/r/149035343956.6881.1536459326017709354.stgit@hbathini.in.ibm.com
Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>
Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/powerpc/Kconfig
arch/powerpc/include/asm/fadump.h
arch/powerpc/kernel/crash.c
arch/powerpc/kernel/fadump.c
arch/powerpc/kernel/setup-common.c

index f07f727cbfd211cdf29375cd6ad3faa7012b0652..d8834e8bfb05cf8e1f7cea7be01a5d8db04f5b1a 100644 (file)
@@ -571,21 +571,23 @@ config RELOCATABLE_TEST
          relocation code.
 
 config CRASH_DUMP
-       bool "Build a kdump crash kernel"
+       bool "Build a dump capture kernel"
        depends on PPC64 || 6xx || FSL_BOOKE || (44x && !SMP)
        select RELOCATABLE if PPC64 || 44x || FSL_BOOKE
        help
-         Build a kernel suitable for use as a kdump capture kernel.
+         Build a kernel suitable for use as a dump capture kernel.
          The same kernel binary can be used as production kernel and dump
          capture kernel.
 
 config FA_DUMP
        bool "Firmware-assisted dump"
-       depends on PPC64 && PPC_RTAS && CRASH_DUMP && KEXEC_CORE
+       depends on PPC64 && PPC_RTAS
+       select CRASH_CORE
+       select CRASH_DUMP
        help
          A robust mechanism to get reliable kernel crash dump with
          assistance from firmware. This approach does not use kexec,
-         instead firmware assists in booting the kdump kernel
+         instead firmware assists in booting the capture kernel
          while preserving memory contents. Firmware-assisted dump
          is meant to be a kdump replacement offering robustness and
          speed not possible without system firmware assistance.
index 0031806475f0f1b22645336d427bfee9fd9b0462..60b91084f33c7083caa3accc9d3aaf14c19417c7 100644 (file)
@@ -73,6 +73,8 @@
        reg_entry++;                                                    \
 })
 
+extern int crashing_cpu;
+
 /* Kernel Dump section info */
 struct fadump_section {
        __be32  request_flag;
index 47b63de81f9bf6a1894c4268cc37351e6d275ca4..cbabb5adccd958d66442f4af17d701225bc81ef8 100644 (file)
@@ -43,8 +43,6 @@
 #define IPI_TIMEOUT            10000
 #define REAL_MODE_TIMEOUT      10000
 
-/* This keeps a track of which one is the crashing cpu. */
-int crashing_cpu = -1;
 static int time_to_dump;
 
 #define CRASH_HANDLER_MAX 3
index 243dbef7e9265c47a4fd9efc1bf5b087deea2cf7..d2e1476d98709e0d85b48ef8234092b4fb5c7583 100644 (file)
@@ -527,34 +527,6 @@ fadump_read_registers(struct fadump_reg_entry *reg_entry, struct pt_regs *regs)
        return reg_entry;
 }
 
-static u32 *fadump_append_elf_note(u32 *buf, char *name, unsigned type,
-                                               void *data, size_t data_len)
-{
-       struct elf_note note;
-
-       note.n_namesz = strlen(name) + 1;
-       note.n_descsz = data_len;
-       note.n_type   = type;
-       memcpy(buf, &note, sizeof(note));
-       buf += (sizeof(note) + 3)/4;
-       memcpy(buf, name, note.n_namesz);
-       buf += (note.n_namesz + 3)/4;
-       memcpy(buf, data, note.n_descsz);
-       buf += (note.n_descsz + 3)/4;
-
-       return buf;
-}
-
-static void fadump_final_note(u32 *buf)
-{
-       struct elf_note note;
-
-       note.n_namesz = 0;
-       note.n_descsz = 0;
-       note.n_type   = 0;
-       memcpy(buf, &note, sizeof(note));
-}
-
 static u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
 {
        struct elf_prstatus prstatus;
@@ -565,8 +537,8 @@ static u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)
         * prstatus.pr_pid = ????
         */
        elf_core_copy_kernel_regs(&prstatus.pr_reg, regs);
-       buf = fadump_append_elf_note(buf, KEXEC_CORE_NOTE_NAME, NT_PRSTATUS,
-                               &prstatus, sizeof(prstatus));
+       buf = append_elf_note(buf, CRASH_CORE_NOTE_NAME, NT_PRSTATUS,
+                             &prstatus, sizeof(prstatus));
        return buf;
 }
 
@@ -707,7 +679,7 @@ static int __init fadump_build_cpu_notes(const struct fadump_mem_struct *fdm)
                        note_buf = fadump_regs_to_elf_notes(note_buf, &regs);
                }
        }
-       fadump_final_note(note_buf);
+       final_note(note_buf);
 
        if (fdh) {
                pr_debug("Updating elfcore header (%llx) with cpu notes\n",
index 5c10b5925ac22d29322e50f246f622354f717914..69e077180db64e8cce88144c736fd87923fc93a7 100644 (file)
@@ -125,6 +125,11 @@ int ppc_do_canonicalize_irqs;
 EXPORT_SYMBOL(ppc_do_canonicalize_irqs);
 #endif
 
+#ifdef CONFIG_CRASH_CORE
+/* This keeps a track of which one is the crashing cpu. */
+int crashing_cpu = -1;
+#endif
+
 /* also used by kexec */
 void machine_shutdown(void)
 {