Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-12 Thread Andy Lutomirski
Berthier, Emmanuel; Tejun Heo >> Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception >> >> On Sun, Dec 7, 2014 at 10:40 AM, Robert Jarzmik >> wrote: >> > Hi Andy, >> > >> > Andy Lutomirski writes: >> >> On Dec 6, 2014 2:31 AM, "R

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-12 Thread Berthier, Emmanuel
> From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Sunday, December 7, 2014 8:10 PM > To: Jarzmik, Robert > Cc: linux-kernel@vger.kernel.org; H. Peter Anvin; X86 ML; Thomas Gleixner; > Berthier, Emmanuel; Tejun Heo > Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-12 Thread Berthier, Emmanuel
From: Andy Lutomirski [mailto:l...@amacapital.net] Sent: Sunday, December 7, 2014 8:10 PM To: Jarzmik, Robert Cc: linux-kernel@vger.kernel.org; H. Peter Anvin; X86 ML; Thomas Gleixner; Berthier, Emmanuel; Tejun Heo Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception On Sun, Dec 7, 2014

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-12 Thread Andy Lutomirski
; Tejun Heo Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception On Sun, Dec 7, 2014 at 10:40 AM, Robert Jarzmik robert.jarz...@intel.com wrote: Hi Andy, Andy Lutomirski l...@amacapital.net writes: On Dec 6, 2014 2:31 AM, Robert Jarzmik robert.jarz...@intel.com wrote: We would have a LBR

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-07 Thread Andy Lutomirski
On Sun, Dec 7, 2014 at 10:40 AM, Robert Jarzmik wrote: > Hi Andy, > > Andy Lutomirski writes: >> On Dec 6, 2014 2:31 AM, "Robert Jarzmik" wrote: >>> We would have a "LBR resource" variable to track who owns the LBR : >>> - nobody : LBR_UNCLAIMED >>> - the exception handler :

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-07 Thread Robert Jarzmik
Hi Andy, Andy Lutomirski writes: > On Dec 6, 2014 2:31 AM, "Robert Jarzmik" wrote: >> We would have a "LBR resource" variable to track who owns the LBR : >> - nobody : LBR_UNCLAIMED >> - the exception handler : LBR_EXCEPTION_DEBUG_USAGE > > Which exception handler? There can be several on the

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-07 Thread Robert Jarzmik
Hi Andy, Andy Lutomirski l...@amacapital.net writes: On Dec 6, 2014 2:31 AM, Robert Jarzmik robert.jarz...@intel.com wrote: We would have a LBR resource variable to track who owns the LBR : - nobody : LBR_UNCLAIMED - the exception handler : LBR_EXCEPTION_DEBUG_USAGE Which exception handler?

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-07 Thread Andy Lutomirski
On Sun, Dec 7, 2014 at 10:40 AM, Robert Jarzmik robert.jarz...@intel.com wrote: Hi Andy, Andy Lutomirski l...@amacapital.net writes: On Dec 6, 2014 2:31 AM, Robert Jarzmik robert.jarz...@intel.com wrote: We would have a LBR resource variable to track who owns the LBR : - nobody :

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-06 Thread Robert Jarzmik
Andy Lutomirski writes: > I don't really care about the number of instructions. Right, a couple of test/jz/jnz is negligible in the exception path, that's what I also think. > But there are still all the nasty cases: > > - Context switch during exception processing (both in the C handler >

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-06 Thread Robert Jarzmik
Andy Lutomirski l...@amacapital.net writes: I don't really care about the number of instructions. Right, a couple of test/jz/jnz is negligible in the exception path, that's what I also think. But there are still all the nasty cases: - Context switch during exception processing (both in the

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-05 Thread Berthier, Emmanuel
> From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Thursday, December 4, 2014 7:10 PM > To: Berthier, Emmanuel > Cc: Thomas Gleixner; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML > Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception > >> And the general problem

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-05 Thread Berthier, Emmanuel
From: Andy Lutomirski [mailto:l...@amacapital.net] Sent: Thursday, December 4, 2014 7:10 PM To: Berthier, Emmanuel Cc: Thomas Gleixner; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception And the general problem with this approach (even

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-04 Thread Andy Lutomirski
On Thu, Dec 4, 2014 at 8:01 AM, Berthier, Emmanuel wrote: >> From: Andy Lutomirski [mailto:l...@amacapital.net] >> Sent: Wednesday, December 3, 2014 8:30 PM >> To: Berthier, Emmanuel >> Cc: Thomas Gleixner; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML >> Subject:

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-04 Thread Berthier, Emmanuel
> From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Wednesday, December 3, 2014 8:30 PM > To: Berthier, Emmanuel > Cc: Thomas Gleixner; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML > Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception > > The final patch will bypass

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-04 Thread Berthier, Emmanuel
From: Andy Lutomirski [mailto:l...@amacapital.net] Sent: Wednesday, December 3, 2014 8:30 PM To: Berthier, Emmanuel Cc: Thomas Gleixner; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception The final patch will bypass the new code in case

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-04 Thread Andy Lutomirski
] [LBR] Dump LBRs on Exception The final patch will bypass the new code in case of UserSpace page fault, so performance impact will be very low. LBRs copy takes much more time than LBR stop/start. The simple is the better: .macro STOP_LBR #ifdef CONFIG_LBR_DUMP_ON_EXCEPTION

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-03 Thread Andy Lutomirski
On Wed, Dec 3, 2014 at 10:25 AM, Berthier, Emmanuel wrote: >> From: Andy Lutomirski [mailto:l...@amacapital.net] >> Sent: Tuesday, December 2, 2014 9:12 PM >> To: Thomas Gleixner >> Cc: Berthier, Emmanuel; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML >> Subject:

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-03 Thread Berthier, Emmanuel
> From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Tuesday, December 2, 2014 9:12 PM > To: Thomas Gleixner > Cc: Berthier, Emmanuel; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML > Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception > > On Tue, Dec 2, 2014 at 11:5

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-03 Thread Berthier, Emmanuel
From: Andy Lutomirski [mailto:l...@amacapital.net] Sent: Tuesday, December 2, 2014 9:12 PM To: Thomas Gleixner Cc: Berthier, Emmanuel; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception On Tue, Dec 2, 2014 at 11:56 AM, Thomas Gleixner t

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-03 Thread Andy Lutomirski
] [LBR] Dump LBRs on Exception On Tue, Dec 2, 2014 at 11:56 AM, Thomas Gleixner t...@linutronix.de wrote: On Tue, 2 Dec 2014, Andy Lutomirski wrote: TBH, I'm wondering whether this is actually a good idea. It might be more valuable and less scary to try to make this work for BUG instead

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-02 Thread Andy Lutomirski
On Tue, Dec 2, 2014 at 11:56 AM, Thomas Gleixner wrote: > On Tue, 2 Dec 2014, Andy Lutomirski wrote: >> TBH, I'm wondering whether this is actually a good idea. It might be >> more valuable and less scary to try to make this work for BUG instead. >> To get the most impact, it might be worth

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-02 Thread Thomas Gleixner
On Tue, 2 Dec 2014, Andy Lutomirski wrote: > TBH, I'm wondering whether this is actually a good idea. It might be > more valuable and less scary to try to make this work for BUG instead. > To get the most impact, it might be worth allocating a new exception > vector for BUG and using 'int

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-02 Thread Berthier, Emmanuel
> From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Friday, November 28, 2014 4:15 PM > To: Berthier, Emmanuel > Cc: Thomas Gleixner; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML > Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception > > On Fri, Nov 28, 2014

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-02 Thread Andy Lutomirski
On Tue, Dec 2, 2014 at 11:09 AM, Berthier, Emmanuel wrote: >> From: Andy Lutomirski [mailto:l...@amacapital.net] >> Sent: Friday, November 28, 2014 4:15 PM >> To: Berthier, Emmanuel >> Cc: Thomas Gleixner; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML >> Subject:

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-02 Thread Andy Lutomirski
] [LBR] Dump LBRs on Exception On Fri, Nov 28, 2014 at 12:44 AM, Berthier, Emmanuel emmanuel.berth...@intel.com wrote: diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index df088bb..f39cded 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-02 Thread Berthier, Emmanuel
From: Andy Lutomirski [mailto:l...@amacapital.net] Sent: Friday, November 28, 2014 4:15 PM To: Berthier, Emmanuel Cc: Thomas Gleixner; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception On Fri, Nov 28, 2014 at 12:44 AM, Berthier, Emmanuel

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-02 Thread Thomas Gleixner
On Tue, 2 Dec 2014, Andy Lutomirski wrote: TBH, I'm wondering whether this is actually a good idea. It might be more valuable and less scary to try to make this work for BUG instead. To get the most impact, it might be worth allocating a new exception vector for BUG and using 'int

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-12-02 Thread Andy Lutomirski
On Tue, Dec 2, 2014 at 11:56 AM, Thomas Gleixner t...@linutronix.de wrote: On Tue, 2 Dec 2014, Andy Lutomirski wrote: TBH, I'm wondering whether this is actually a good idea. It might be more valuable and less scary to try to make this work for BUG instead. To get the most impact, it might be

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-28 Thread Andy Lutomirski
rzmik, Robert; LKML >> Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception >> >> On Thu, Nov 27, 2014 at 1:22 PM, Thomas Gleixner >> wrote: >> >> /* >> >> * Exception entry points. >> >> */ >> >> @@ -1063,6 +110

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-28 Thread Berthier, Emmanuel
> From: Thomas Gleixner [mailto:t...@linutronix.de] > Sent: Thursday, November 27, 2014 10:23 PM > To: Berthier, Emmanuel > Cc: H. Peter Anvin; x...@kernel.org; Jarzmik, Robert; LKML; Andy Lutomirski > Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception > > On Thu, 27 Nov 20

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-28 Thread Berthier, Emmanuel
> -Original Message- > From: Andy Lutomirski [mailto:l...@amacapital.net] > Sent: Thursday, November 27, 2014 10:56 PM > To: Thomas Gleixner > Cc: Berthier, Emmanuel; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML > Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception &

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-28 Thread Berthier, Emmanuel
-Original Message- From: Andy Lutomirski [mailto:l...@amacapital.net] Sent: Thursday, November 27, 2014 10:56 PM To: Thomas Gleixner Cc: Berthier, Emmanuel; H. Peter Anvin; X86 ML; Jarzmik, Robert; LKML Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception On Thu, Nov 27, 2014 at 1

RE: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-28 Thread Berthier, Emmanuel
From: Thomas Gleixner [mailto:t...@linutronix.de] Sent: Thursday, November 27, 2014 10:23 PM To: Berthier, Emmanuel Cc: H. Peter Anvin; x...@kernel.org; Jarzmik, Robert; LKML; Andy Lutomirski Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception On Thu, 27 Nov 2014, Emmanuel Berthier wrote

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-28 Thread Andy Lutomirski
; LKML Subject: Re: [PATCH v2] [LBR] Dump LBRs on Exception On Thu, Nov 27, 2014 at 1:22 PM, Thomas Gleixner t...@linutronix.de wrote: /* * Exception entry points. */ @@ -1063,6 +1103,8 @@ ENTRY(\sym) subq $ORIG_RAX-R15, %rsp CFI_ADJUST_CFA_OFFSET ORIG_RAX-R15

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-27 Thread Andy Lutomirski
On Thu, Nov 27, 2014 at 1:22 PM, Thomas Gleixner wrote: > On Thu, 27 Nov 2014, Emmanuel Berthier wrote: >> diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c >> b/arch/x86/kernel/cpu/perf_event_intel_lbr.c >> index 45fa730..0a69365 100644 >> --- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-27 Thread Thomas Gleixner
On Thu, 27 Nov 2014, Emmanuel Berthier wrote: > diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c > b/arch/x86/kernel/cpu/perf_event_intel_lbr.c > index 45fa730..0a69365 100644 > --- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c > +++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c > @@ -4,7

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-27 Thread Thomas Gleixner
On Thu, 27 Nov 2014, Emmanuel Berthier wrote: diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c index 45fa730..0a69365 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_lbr.c +++ b/arch/x86/kernel/cpu/perf_event_intel_lbr.c @@ -4,7 +4,7 @@

Re: [PATCH v2] [LBR] Dump LBRs on Exception

2014-11-27 Thread Andy Lutomirski
On Thu, Nov 27, 2014 at 1:22 PM, Thomas Gleixner t...@linutronix.de wrote: On Thu, 27 Nov 2014, Emmanuel Berthier wrote: diff --git a/arch/x86/kernel/cpu/perf_event_intel_lbr.c b/arch/x86/kernel/cpu/perf_event_intel_lbr.c index 45fa730..0a69365 100644 ---