Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1558250

Re: [PATCH v4 3/5] powerpc/fadump: remove dependency with CONFIG_KEXEC

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 3/5] powerpc/fadump: remove dependency with CONFIG_KEXEC
Date Fri, 13 Jan 2017 12:30:02 +0100
Message-ID <sZ8ds-dR-19@gated-at.bofh.it> (permalink)
References <sWk1s-63E-25@gated-at.bofh.it> <sWkb7-66L-23@gated-at.bofh.it>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 7bit
X-Tm-As-Mml disable
X-Content-Scanned Fidelis XPS MAILER
X-Cbid 17011311-0016-0000-0000-000003C611D4
X-Ibm-Av-Detection SAVI=unused REMOTE=unused XFE=unused
X-Cbparentid 17011311-0017-0000-0000-00002896ED5D
X-Proofpoint-Virus-Version vendor=fsecure engine=2.50.10432:,, definitions=2017-01-13_07:,, signatures=0
X-Proofpoint-Spam-Details rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1612050000 definitions=main-1701130164
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 153
Organization linux.* mail to news gateway
X-Original-Cc fenghua.yu@intel.com, tony.luck@intel.com, linux-ia64@vger.kernel.org, dyoung@redhat.com, kexec@lists.infradead.org, ebiederm@xmission.com, Michael Ellerman <mpe@ellerman.id.au>, linuxppc-dev@lists.ozlabs.org, vgoyal@redhat.com
X-Original-Date Fri, 13 Jan 2017 16:57:37 +0530
X-Original-Message-ID <532609e1-115c-c15e-08dd-5d1e42053426@linux.vnet.ibm.com>
X-Original-References <148363729327.11570.6244765717789390817.stgit@hbathini.in.ibm.com> <148363751120.11570.5394055766937537863.stgit@hbathini.in.ibm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1558250

Show key headers only | View raw


On 01/05/2017 11:02 PM, Hari Bathini wrote:
> 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.
> 
> Signed-off-by: Hari Bathini <hbathini@linux.vnet.ibm.com>

Reviewed-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

> ---
>  arch/powerpc/Kconfig               |   10 ++++++----
>  arch/powerpc/include/asm/fadump.h  |    2 ++
>  arch/powerpc/kernel/crash.c        |    2 --
>  arch/powerpc/kernel/fadump.c       |   34 +++-------------------------------
>  arch/powerpc/kernel/setup-common.c |    5 +++++
>  5 files changed, 16 insertions(+), 37 deletions(-)
> 
> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
> index a8ee573..b9726be 100644
> --- a/arch/powerpc/Kconfig
> +++ b/arch/powerpc/Kconfig
> @@ -513,21 +513,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 && !COMPILE_TEST) || 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.
> diff --git a/arch/powerpc/include/asm/fadump.h b/arch/powerpc/include/asm/fadump.h
> index 0031806..60b9108 100644
> --- a/arch/powerpc/include/asm/fadump.h
> +++ b/arch/powerpc/include/asm/fadump.h
> @@ -73,6 +73,8 @@
>  	reg_entry++;							\
>  })
> 
> +extern int crashing_cpu;
> +
>  /* Kernel Dump section info */
>  struct fadump_section {
>  	__be32	request_flag;
> diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
> index 47b63de..cbabb5a 100644
> --- a/arch/powerpc/kernel/crash.c
> +++ b/arch/powerpc/kernel/crash.c
> @@ -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
> diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
> index 8f0c7c5..db0b339 100644
> --- a/arch/powerpc/kernel/fadump.c
> +++ b/arch/powerpc/kernel/fadump.c
> @@ -486,34 +486,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;
> @@ -524,8 +496,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;
>  }
> 
> @@ -666,7 +638,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",
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index f516ac5..60badb1 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -116,6 +116,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)
>  {
> 

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 0/5] kexec/fadump: remove dependency with CONFIG_KEXEC  and reuse crashkernel parameter for fadump Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:30 +0100
  [PATCH v4 5/5] powerpc/fadump: update documentation about  crashkernel parameter reuse Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
  [PATCH v4 2/5] ia64: reuse append_elf_note() and final_note()  functions Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
    Re: [PATCH v4 2/5] ia64: reuse append_elf_note() and final_note()  functions Dave Young <dyoung@redhat.com> - 2017-01-06 03:10 +0100
  [PATCH v4 1/5] crash: move crashkernel parsing and vmcore related  code under CONFIG_CRASH_CORE Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
    Re: [PATCH v4 1/5] crash: move crashkernel parsing and vmcore  related code under CONFIG_CRASH_CORE Dave Young <dyoung@redhat.com> - 2017-01-06 03:10 +0100
  [PATCH v4 3/5] powerpc/fadump: remove dependency with CONFIG_KEXEC Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
    Re: [PATCH v4 3/5] powerpc/fadump: remove dependency with  CONFIG_KEXEC Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com> - 2017-01-13 12:30 +0100
  [PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for  fadump memory reservation Hari Bathini <hbathini@linux.vnet.ibm.com> - 2017-01-05 18:40 +0100
    Re: [PATCH v4 4/5] powerpc/fadump: reuse crashkernel parameter for  fadump memory reservation Mahesh Jagannath Salgaonkar <mahesh@linux.vnet.ibm.com> - 2017-01-13 13:00 +0100

csiph-web