[Kgdb-bugreport] [PATCH 1/2] x86, hw_breakpoint, kgdb: kgdb to use hw_breakpoint API

2010-01-28 Thread Jason Wessel
In the 2.6.33 kernel, the hw_breakpoint API is now used for the performance event counters. The hw_breakpoint_handler() now consumes the hw breakpoints that were previously set by kgdb arch specific code. In order for kgdb to work in conjunction with this core API change, kgdb must use some of th

[Kgdb-bugreport] [PATCH 2/2] perf, hw_breakpoint, kgdb: No mutex taken for kernel debugger

2010-01-28 Thread Jason Wessel
This patch fixes the regression in functionality where the kernel debugger and the perf API do not nicely share hw breakpoint reservations. The kernel debugger cannot use any mutex_lock() calls because it can start the kernel running from an invalid context. A mutex free version of the reservatio

[Kgdb-bugreport] [GIT PULL] kgdb regression fixes for 2.6.33

2010-01-28 Thread Jason Wessel
Linus, please pull the kgdb git tree fixes for 2.6.33-rc5 git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/linux-2.6-kgdb.git for_linus Summary: * Fix the kgdb regression in functionality caused by the new hw breakpoint API changes in 2.6.33. This leaves us with some cleanup in

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to usehw_breakpointAPI

2010-01-28 Thread Frederic Weisbecker
On Thu, Jan 28, 2010 at 02:23:13PM -0600, Jason Wessel wrote: > Frederic Weisbecker wrote: > > On Thu, Jan 28, 2010 at 01:58:26PM -0600, Jason Wessel wrote: > > > >> New version which loses the call back registration, because if we > >> register as a different breakpoint type, perf won't reject

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to usehw_breakpointAPI

2010-01-28 Thread Frederic Weisbecker
On Thu, Jan 28, 2010 at 02:27:54PM -0600, Jason Wessel wrote: > I'll move this to the gdbstub in the next merge window, because it looks > like there might also be other archs that gain the > arch/*/kernel/hw_breakpoint.c. Yeah, PowerPc, S390 and ARM are in progress. > I can also move the logic

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to usehw_breakpointAPI

2010-01-28 Thread Jason Wessel
Frederic Weisbecker wrote: > On Thu, Jan 28, 2010 at 01:58:26PM -0600, Jason Wessel wrote: > >> New version which loses the call back registration, because if we >> register as a different breakpoint type, perf won't reject it. >> > > > > I don't understand what you mean here. > > > > T

Re: [Kgdb-bugreport] [PATCH 3/3] perf, hw_breakpoint, kgdb: No mutex taken forkerneldebugger

2010-01-28 Thread Jason Wessel
Frederic Weisbecker wrote: >> If it fails the debugger tried to remove it again later. It seems to >> me like it is a don't care corner case. You get a printk if it ever >> does happen (which it really shouldn't). > > > > Yeah truly it's a corner case, especially if the debugger can handle

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to usehw_breakpointAPI

2010-01-28 Thread Jason Wessel
Frederic Weisbecker wrote: > On Thu, Jan 28, 2010 at 11:44:52AM -0600, Jason Wessel wrote: > >> Frederic Weisbecker wrote: >> >>> Good simplification, but that doesn't appear related to kgdb, >>> this should be done in a separate patch, for the perf/core tree. >>> >>> >>> >> Speci

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to use hw_breakpointAPI

2010-01-28 Thread Frederic Weisbecker
On Thu, Jan 28, 2010 at 01:58:26PM -0600, Jason Wessel wrote: > New version which loses the call back registration, because if we > register as a different breakpoint type, perf won't reject it. I don't understand what you mean here. > I didn't > see that loop hole in the API the first time

Re: [Kgdb-bugreport] [PATCH 3/3] perf, hw_breakpoint, kgdb: No mutex taken for kerneldebugger

2010-01-28 Thread Frederic Weisbecker
On Thu, Jan 28, 2010 at 11:49:14AM -0600, Jason Wessel wrote: > Frederic Weisbecker wrote: > >> +static int hw_break_release_slot(int breakno) > >> +{ > >> + struct perf_event **pevent; > >> + int ret; > >> + int cpu; > >> + > >> + for_each_online_cpu(cpu) { > >> + pevent = per_cpu_ptr

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to use hw_breakpointAPI

2010-01-28 Thread Frederic Weisbecker
On Thu, Jan 28, 2010 at 11:44:52AM -0600, Jason Wessel wrote: > Frederic Weisbecker wrote: > > Good simplification, but that doesn't appear related to kgdb, > > this should be done in a separate patch, for the perf/core tree. > > > > > > Specifically this is required so that kgdb can modify the

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to use hw_breakpointAPI

2010-01-28 Thread Jason Wessel
New version which loses the call back registration, because if we register as a different breakpoint type, perf won't reject it. I didn't see that loop hole in the API the first time around. Also the dr7 fixup in hw_breakpoint.c is not needed. The trickery for entering twice into the __kgdb_noti

Re: [Kgdb-bugreport] [PATCH 3/3] perf, hw_breakpoint, kgdb: No mutex taken for kerneldebugger

2010-01-28 Thread Jason Wessel
Frederic Weisbecker wrote: > On Wed, Jan 27, 2010 at 04:25:24PM -0600, Jason Wessel wrote: > >> The kernel debugger cannot use any mutex_lock() calls because it can >> start the kernel running from an invalid context. >> >> The possibility for a breakpoint reservation to be concurrently >> proce

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to use hw_breakpointAPI

2010-01-28 Thread Jason Wessel
Frederic Weisbecker wrote: > On Mon, Jan 25, 2010 at 10:26:37PM -0600, Jason Wessel wrote: > >> @@ -466,7 +466,7 @@ static int __kprobes hw_breakpoint_handler(struct >> die_args *args) >> { >> int i, cpu, rc = NOTIFY_STOP; >> struct perf_event *bp; >> -unsigned long dr7, dr6; >>

Re: [Kgdb-bugreport] [PATCH 3/3] perf, hw_breakpoint, kgdb: No mutex taken for kernel debugger

2010-01-28 Thread Frederic Weisbecker
On Wed, Jan 27, 2010 at 04:25:24PM -0600, Jason Wessel wrote: > The kernel debugger cannot use any mutex_lock() calls because it can > start the kernel running from an invalid context. > > The possibility for a breakpoint reservation to be concurrently > processed at the time that kgdb interrupts

Re: [Kgdb-bugreport] [PATCH 1/4] x86, hw_breakpoint, kgdb: kgdb to use hw_breakpoint API

2010-01-28 Thread Frederic Weisbecker
On Mon, Jan 25, 2010 at 10:26:37PM -0600, Jason Wessel wrote: > @@ -466,7 +466,7 @@ static int __kprobes hw_breakpoint_handler(struct > die_args *args) > { > int i, cpu, rc = NOTIFY_STOP; > struct perf_event *bp; > - unsigned long dr7, dr6; > + unsigned long dr6; > unsig