From patchwork Tue Sep 30 12:56:21 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohan Kumar M X-Patchwork-Id: 2094 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 5ED0CDE64F for ; Tue, 30 Sep 2008 22:56:46 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from e36.co.us.ibm.com (e36.co.us.ibm.com [32.97.110.154]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e36.co.us.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id C1FA7DE371 for ; Tue, 30 Sep 2008 22:56:30 +1000 (EST) Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.13.8/8.13.8) with ESMTP id m8UCuQj2005889 for ; Tue, 30 Sep 2008 08:56:26 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m8UCuQk5071162 for ; Tue, 30 Sep 2008 06:56:26 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m8UCtsqD010378 for ; Tue, 30 Sep 2008 06:55:56 -0600 Received: from explorer.in.ibm.com (explorer.in.ibm.com [9.124.31.23]) by d03av02.boulder.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m8UCtq3a010215; Tue, 30 Sep 2008 06:55:53 -0600 Received: by explorer.in.ibm.com (Postfix, from userid 500) id 3532A280C0; Tue, 30 Sep 2008 18:26:21 +0530 (IST) Date: Tue, 30 Sep 2008 18:26:21 +0530 From: Mohan Kumar M To: kexec@lists.infradead.org Subject: [PATCH] Relocatable kdump kernel support in kexec-tools Message-ID: <20080930125621.GC1945@in.ibm.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Cc: ppcdev , paulus@samba.org X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: mohan@in.ibm.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org 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 --- 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?