Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754371AbYJGRtR (ORCPT ); Tue, 7 Oct 2008 13:49:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753353AbYJGRtA (ORCPT ); Tue, 7 Oct 2008 13:49:00 -0400 Received: from e28smtp06.in.ibm.com ([59.145.155.6]:54043 "EHLO e28esmtp06.in.ibm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751303AbYJGRtA (ORCPT ); Tue, 7 Oct 2008 13:49:00 -0400 Date: Tue, 7 Oct 2008 23:18:52 +0530 From: "K.Prasad" To: Alan Stern Cc: linux-kernel@vger.kernel.org, Roland McGrath , akpm@linux-foundation.org, mingo@elte.hu, jason.wessel@windriver.com, avi@qumranet.com, richardj_moore@uk.ibm.com Subject: Re: [RFC Patch 6/9] Use virtual debug registers in process/thread handling code Message-ID: <20081007174852.GE4130@in.ibm.com> Reply-To: prasad@linux.vnet.ibm.com References: <20081007114451.GA25875@in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2355 Lines: 73 On Tue, Oct 07, 2008 at 11:40:46AM -0400, Alan Stern wrote: > On Tue, 7 Oct 2008, K.Prasad wrote: > > > This patch enables the use of abstract/virtual debug registers in > > process-handling routines. > > ... > > --- linux-bkpt-lkml-27-rc9.orig/arch/x86/kernel/process_32.c > > +++ linux-bkpt-lkml-27-rc9/arch/x86/kernel/process_32.c > > @@ -56,6 +56,8 @@ > > #include > > #include > > #include > > +#include > > +#include > > > > asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); > > > > @@ -158,9 +160,11 @@ void cpu_idle(void) > > void __show_registers(struct pt_regs *regs, int all) > > { > > unsigned long cr0 = 0L, cr2 = 0L, cr3 = 0L, cr4 = 0L; > > - unsigned long d0, d1, d2, d3, d6, d7; > > + unsigned long u_debugreg[8]; > > unsigned long sp; > > unsigned short ss, gs; > > + struct thread_hw_breakpoint *thbi = current->thread.hw_breakpoint_info; > > + int i; > > > > if (user_mode_vm(regs)) { > > sp = regs->sp; > > @@ -201,17 +205,18 @@ void __show_registers(struct pt_regs *re > > printk("CR0: %08lx CR2: %08lx CR3: %08lx CR4: %08lx\n", > > cr0, cr2, cr3, cr4); > > > > - get_debugreg(d0, 0); > > - get_debugreg(d1, 1); > > - get_debugreg(d2, 2); > > - get_debugreg(d3, 3); > > + if (thbi) { > > + for (i = 0; i < HB_NUM; ++i) > > + u_debugreg[i] = thbi->vdr_bps[i].info.address; > > + u_debugreg[7] = thbi->vdr7; > > + } > > + u_debugreg[6] = current->thread.vdr6; > > + > > printk("DR0: %08lx DR1: %08lx DR2: %08lx DR3: %08lx\n", > > - d0, d1, d2, d3); > > + u_debugreg[0], u_debugreg[1], > > + u_debugreg[2], u_debugreg[3]); > > > > - get_debugreg(d6, 6); > > - get_debugreg(d7, 7); > > - printk("DR6: %08lx DR7: %08lx\n", > > - d6, d7); > > + printk("DR6: %08lx DR7: %08lx\n", u_debugreg[6], u_debugreg[7]); > > I don't like this at all. show_registers() should display the physical > register contents, not the virtualized values. Ditto for the 64-byte > version of this routine. > > Alan Stern > Agreed, will modify this! Thanks, K.Prasad -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/