From patchwork Fri Nov 27 08:59:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefani Seibold X-Patchwork-Id: 39620 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 7EF251009F0 for ; Fri, 27 Nov 2009 21:00:47 +1100 (EST) X-Greylist: delayed 1751 seconds by postgrey-1.32 at bilbo; Fri, 27 Nov 2009 20:28:33 EST Received: from www84.your-server.de (www84.your-server.de [213.133.104.84]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 61BA31007D2 for ; Fri, 27 Nov 2009 20:28:33 +1100 (EST) Received: from [88.64.31.243] (helo=[192.168.0.4]) by www84.your-server.de with esmtpsa (SSLv3:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1NDwfd-0008OI-FB; Fri, 27 Nov 2009 09:59:17 +0100 Subject: [PATCH] fix PPC floating point debug From: Stefani Seibold To: linux-kernel , linuxppc-dev@lists.ozlabs.org Date: Fri, 27 Nov 2009 09:59:00 +0100 Message-ID: <1259312340.9648.6.camel@wall-e> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-Authenticated-Sender: stefani@seibold.net X-Virus-Scanned: Clear (ClamAV 0.95.1/10087/Fri Nov 27 03:24:29 2009) X-Mailman-Approved-At: Fri, 27 Nov 2009 21:00:41 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.12 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 The PPC architecture is unable to debug applications using hardware floating point, because it would not save the floating point registers. After returning from the debugger, the contents of register was modified. This patch fix this bug. Signed-off-by: Stefani Seibold --- traps.c | 6 ++++++ 1 file changed, 6 insertions(+) --- linux-2.6.32-rc5/arch/powerpc/kernel/traps.c.orig 2009-11-27 09:47:37.989943124 +0100 +++ linux-2.6.32-rc5/arch/powerpc/kernel/traps.c 2009-11-27 09:47:41.088330825 +0100 @@ -559,6 +559,8 @@ void instruction_breakpoint_exception(st return; if (debugger_iabr_match(regs)) return; + if (regs->msr & MSR_FP) + giveup_fpu(current); _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip); } @@ -577,6 +579,8 @@ void __kprobes single_step_exception(str if (debugger_sstep(regs)) return; + if (regs->msr & MSR_FP) + giveup_fpu(current); _exception(SIGTRAP, regs, TRAP_TRACE, regs->nip); } @@ -834,6 +838,8 @@ void __kprobes program_check_exception(s regs->nip += 4; return; } + if (regs->msr & MSR_FP) + giveup_fpu(current); _exception(SIGTRAP, regs, TRAP_BRKPT, regs->nip); return; }