From patchwork Wed Jun 10 09:08:29 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "K.Prasad" X-Patchwork-Id: 28394 X-Patchwork-Delegate: david@gibson.dropbear.id.au Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 5B921B70D3 for ; Wed, 10 Jun 2009 19:19:05 +1000 (EST) Received: by ozlabs.org (Postfix) id 492D0DDD1C; Wed, 10 Jun 2009 19:19:05 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (bilbo.ozlabs.org [203.10.76.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "bilbo.ozlabs.org", Issuer "CAcert Class 3 Root" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 46E07DDD0C for ; Wed, 10 Jun 2009 19:19:05 +1000 (EST) Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by bilbo.ozlabs.org (Postfix) with ESMTP id 551A7B8B16 for ; Wed, 10 Jun 2009 19:09:34 +1000 (EST) Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id C0D05B7A2B for ; Wed, 10 Jun 2009 19:08:38 +1000 (EST) Received: by ozlabs.org (Postfix) id B357ADDD1B; Wed, 10 Jun 2009 19:08:38 +1000 (EST) Delivered-To: linuxppc-dev@ozlabs.org Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "e23smtp02.au.ibm.com", Issuer "Equifax" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id 84E4ADDD0C for ; Wed, 10 Jun 2009 19:08:38 +1000 (EST) Received: from d23relay01.au.ibm.com (d23relay01.au.ibm.com [202.81.31.243]) by e23smtp02.au.ibm.com (8.13.1/8.13.1) with ESMTP id n5A96qub016893 for ; Wed, 10 Jun 2009 19:06:52 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay01.au.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n5A98aHt467318 for ; Wed, 10 Jun 2009 19:08:36 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n5A98akU018081 for ; Wed, 10 Jun 2009 19:08:36 +1000 Received: from in.ibm.com (prasadkr-t60p.in.ibm.com [9.124.31.42]) by d23av04.au.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n5A98TuL017886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Jun 2009 19:08:33 +1000 Date: Wed, 10 Jun 2009 14:38:29 +0530 From: "K.Prasad" To: David Gibson , linuxppc-dev@ozlabs.org Subject: [Patch 6/6] Adapt kexec and samples code to recognise PPC64 hardware breakpoint usage Message-ID: <20090610090829.GG14478@in.ibm.com> References: <20090610090316.898961359@prasadkr_t60p.in.ibm.com> MIME-Version: 1.0 Content-Disposition: inline; filename=ppc64_modify_kexec_sample_code_06 User-Agent: Mutt/1.5.18 (2008-05-17) Cc: Michael Neuling , Benjamin Herrenschmidt , paulus@samba.org, Alan Stern , "K.Prasad" , Roland McGrath X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list 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@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Modify kexec code to disable DABR registers before a reboot. Adapt the samples code to populate PPC64-arch specific fields. Signed-off-by: K.Prasad --- arch/powerpc/kernel/machine_kexec_64.c | 3 +++ samples/hw_breakpoint/data_breakpoint.c | 4 ++++ 2 files changed, 7 insertions(+) Index: linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c =================================================================== --- linux-2.6-tip.hbkpt.orig/arch/powerpc/kernel/machine_kexec_64.c +++ linux-2.6-tip.hbkpt/arch/powerpc/kernel/machine_kexec_64.c @@ -24,6 +24,7 @@ #include /* _end */ #include #include +#include int default_machine_kexec_prepare(struct kimage *image) { @@ -214,6 +215,7 @@ static void kexec_prepare_cpus(void) put_cpu(); local_irq_disable(); + hw_breakpoint_disable(); } #else /* ! SMP */ @@ -233,6 +235,7 @@ static void kexec_prepare_cpus(void) if (ppc_md.kexec_cpu_down) ppc_md.kexec_cpu_down(0, 0); local_irq_disable(); + hw_breakpoint_disable(); } #endif /* SMP */ Index: linux-2.6-tip.hbkpt/samples/hw_breakpoint/data_breakpoint.c =================================================================== --- linux-2.6-tip.hbkpt.orig/samples/hw_breakpoint/data_breakpoint.c +++ linux-2.6-tip.hbkpt/samples/hw_breakpoint/data_breakpoint.c @@ -54,6 +54,10 @@ static int __init hw_break_module_init(v sample_hbp.info.type = HW_BREAKPOINT_WRITE; sample_hbp.info.len = HW_BREAKPOINT_LEN_4; #endif /* CONFIG_X86 */ +#ifdef CONFIG_PPC64 + sample_hbp.info.name = ksym_name; + sample_hbp.info.type = HW_BREAKPOINT_WRITE; +#endif /* CONFIG_PPC64 */ sample_hbp.triggered = (void *)sample_hbp_handler;