Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-15 Thread Thomas Gleixner
Mathieu Desnoyers writes: > - On May 14, 2020, at 1:28 PM, Thomas Gleixner t...@linutronix.de wrote: > >> Mathieu Desnoyers writes: >>> - On May 5, 2020, at 9:49 AM, Thomas Gleixner t...@linutronix.de wrote: + +static __always_inline void debug_exit(unsigned long dr7) +{

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-14 Thread Andy Lutomirski
On Tue, May 5, 2020 at 7:16 AM Thomas Gleixner wrote: > > From: Peter Zijlstra > > DR6/7 should be handled before nmi_enter() is invoked and restore after > nmi_exit() to minimize the exposure. > > Split it out into helper inlines and bring it into the correct order. > +* > +*

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-14 Thread Steven Rostedt
On Wed, 13 May 2020 22:24:56 -0400 (EDT) Mathieu Desnoyers wrote: > Also, considering that "inline" is not sufficient to ensure the compiler > does not emit a traceable function, I suspect you'll also want to mark > "native_get_debugreg" and "native_set_debugreg" always inline as well. I was

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-14 Thread Mathieu Desnoyers
- On May 14, 2020, at 1:28 PM, Thomas Gleixner t...@linutronix.de wrote: > Mathieu Desnoyers writes: >> - On May 5, 2020, at 9:49 AM, Thomas Gleixner t...@linutronix.de wrote: >>> + >>> +static __always_inline void debug_exit(unsigned long dr7) >>> +{ >>> + set_debugreg(dr7, 7); >>> +}

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-14 Thread Thomas Gleixner
Mathieu Desnoyers writes: > - On May 5, 2020, at 9:49 AM, Thomas Gleixner t...@linutronix.de wrote: >> + >> +static __always_inline void debug_exit(unsigned long dr7) >> +{ >> +set_debugreg(dr7, 7); >> +} > > Out of curiosity, what prevents the compiler from moving instructions > outside

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-13 Thread Mathieu Desnoyers
- On May 5, 2020, at 9:49 AM, Thomas Gleixner t...@linutronix.de wrote: > From: Peter Zijlstra > > DR6/7 should be handled before nmi_enter() is invoked and restore after > nmi_exit() to minimize the exposure. > > Split it out into helper inlines and bring it into the correct order. >

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-08 Thread Peter Zijlstra
On Fri, May 08, 2020 at 01:58:30PM +0200, Thomas Gleixner wrote: > Peter Zijlstra writes: > >> > +static __always_inline void debug_enter(unsigned long *dr6, unsigned > >> > long *dr7) > >> > +{ > >> > +/* > >> > + * Disable breakpoints during exception handling; recursive > >>

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-08 Thread Thomas Gleixner
Peter Zijlstra writes: >> > +static __always_inline void debug_enter(unsigned long *dr6, unsigned long >> > *dr7) >> > +{ >> > + /* >> > + * Disable breakpoints during exception handling; recursive exceptions >> > + * are exceedingly 'fun'. >> > + * >> > + * Since this function is

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-08 Thread Peter Zijlstra
On Thu, May 07, 2020 at 07:18:45PM +0200, Alexandre Chartre wrote: > > On 5/5/20 3:49 PM, Thomas Gleixner wrote: > > From: Peter Zijlstra > > > > DR6/7 should be handled before nmi_enter() is invoked and restore after > > nmi_exit() to minimize the exposure. > > > > Split it out into helper

Re: [patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-07 Thread Alexandre Chartre
On 5/5/20 3:49 PM, Thomas Gleixner wrote: From: Peter Zijlstra DR6/7 should be handled before nmi_enter() is invoked and restore after nmi_exit() to minimize the exposure. Split it out into helper inlines and bring it into the correct order. Signed-off-by: Peter Zijlstra Signed-off-by:

[patch V4 part 4 15/24] x86/db: Split out dr6/7 handling

2020-05-05 Thread Thomas Gleixner
From: Peter Zijlstra DR6/7 should be handled before nmi_enter() is invoked and restore after nmi_exit() to minimize the exposure. Split it out into helper inlines and bring it into the correct order. Signed-off-by: Peter Zijlstra Signed-off-by: Thomas Gleixner ---