linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Relocatable kdump kernel support in kexec-tools
@ 2008-09-30 12:56 Mohan Kumar M
  2008-10-08  6:11 ` Simon Horman
  0 siblings, 1 reply; 2+ messages in thread
From: Mohan Kumar M @ 2008-09-30 12:56 UTC (permalink / raw)
  To: kexec; +Cc: ppcdev, paulus

Relocatable kdump kernel support in kexec-tools

This patch adds relocatable kernel support for kdump in the kexec-tools
code. A signature (0xfeed1234) is passed in r6 from panic code to the
purgatory code through kexec_sequence function. The signature is used to
differentiate between relocatable kdump kernel and non-kdump kernels.

The purgatory code compares the signature and sets the __kdump_flag in
head_64.S by using the offset with respect to next kernel load address.
During the boot up, kernel code checks __kdump_flag and if it is set, the
kernel will behave as relocatable kdump kernel.

Signed-off-by: Mohan Kumar M <mohan@in.ibm.com>
---
diff --git a/purgatory/arch/ppc64/v2wrap.S b/purgatory/arch/ppc64/v2wrap.S
index b3563de..f69dad2 100644
--- a/purgatory/arch/ppc64/v2wrap.S
+++ b/purgatory/arch/ppc64/v2wrap.S
@@ -45,6 +45,7 @@
 	oris    rn,rn,name##@h;         \
 	ori     rn,rn,name##@l
 
+#define KDUMP_SIGNATURE 0xfeed1234
 
 	.machine ppc64
 	.globl purgatory_start
@@ -64,6 +65,7 @@ master:
 	isync
 	mr      17,3            # save cpu id to r17
 	mr      15,4            # save physical address in reg15
+	mr      18,6            # save kdump flag in reg18
 
 	LOADADDR(6,my_toc)
 	ld      2,0(6)          #setup toc
@@ -94,6 +96,12 @@ master:
 	mtctr	4		# prepare branch too
 	mr      3,16            # restore dt address
 
+	LOADADDR(6,KDUMP_SIGNATURE)
+	cmpd	18,6
+	bne	regular
+	li	7,1
+	std	7,24(4)		# mark kdump flag at kernel
+regular:
 	lwz	7,0(4)		# get the first instruction that we stole
 	stw	7,0(0)		# and put it in the slave loop at 0
 				# skip cache flush, do we care?

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Relocatable kdump kernel support in kexec-tools
  2008-09-30 12:56 [PATCH] Relocatable kdump kernel support in kexec-tools Mohan Kumar M
@ 2008-10-08  6:11 ` Simon Horman
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Horman @ 2008-10-08  6:11 UTC (permalink / raw)
  To: Mohan Kumar M; +Cc: ppcdev, kexec, paulus

On Tue, Sep 30, 2008 at 06:26:21PM +0530, Mohan Kumar M wrote:
> Relocatable kdump kernel support in kexec-tools
> 
> This patch adds relocatable kernel support for kdump in the kexec-tools
> code. A signature (0xfeed1234) is passed in r6 from panic code to the
> purgatory code through kexec_sequence function. The signature is used to
> differentiate between relocatable kdump kernel and non-kdump kernels.
> 
> The purgatory code compares the signature and sets the __kdump_flag in
> head_64.S by using the offset with respect to next kernel load address.
> During the boot up, kernel code checks __kdump_flag and if it is set, the
> kernel will behave as relocatable kdump kernel.

Thanks Mohan, applied.

-- 
Simon Horman
  VA Linux Systems Japan K.K., Sydney, Australia Satellite Office
  H: www.vergenet.net/~horms/             W: www.valinux.co.jp/en

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-10-08  6:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-30 12:56 [PATCH] Relocatable kdump kernel support in kexec-tools Mohan Kumar M
2008-10-08  6:11 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).