Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Andy Lutomirski
On Tue, Jul 26, 2016 at 3:24 PM, Josh Poimboeuf wrote: > On Tue, Jul 26, 2016 at 01:59:20PM -0700, Andy Lutomirski wrote: >> On Tue, Jul 26, 2016 at 9:26 AM, Josh Poimboeuf wrote: >> > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: >>

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Andy Lutomirski
On Tue, Jul 26, 2016 at 3:24 PM, Josh Poimboeuf wrote: > On Tue, Jul 26, 2016 at 01:59:20PM -0700, Andy Lutomirski wrote: >> On Tue, Jul 26, 2016 at 9:26 AM, Josh Poimboeuf wrote: >> > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: >> >> On Sat, Jul 23, 2016 at 7:04 AM, Josh

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Steven Rostedt
On Tue, 26 Jul 2016 17:24:54 -0500 Josh Poimboeuf wrote: > > This should be impossible unless that last entry is MCE. If we > > actually fire an event that isn't MCE early in NMI entry, something > > already went very wrong. > > So we don't need to support breakpoints in

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Steven Rostedt
On Tue, 26 Jul 2016 17:24:54 -0500 Josh Poimboeuf wrote: > > This should be impossible unless that last entry is MCE. If we > > actually fire an event that isn't MCE early in NMI entry, something > > already went very wrong. > > So we don't need to support breakpoints in the early NMI entry

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Tue, Jul 26, 2016 at 01:59:20PM -0700, Andy Lutomirski wrote: > On Tue, Jul 26, 2016 at 9:26 AM, Josh Poimboeuf wrote: > > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: > >> On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf > >>

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Tue, Jul 26, 2016 at 01:59:20PM -0700, Andy Lutomirski wrote: > On Tue, Jul 26, 2016 at 9:26 AM, Josh Poimboeuf wrote: > > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: > >> On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf > >> wrote: > >> >> > Unless I'm missing something,

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Andy Lutomirski
On Tue, Jul 26, 2016 at 9:26 AM, Josh Poimboeuf wrote: > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: >> On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: >> >> > Unless I'm missing something, I think it should be fine for nested

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Andy Lutomirski
On Tue, Jul 26, 2016 at 9:26 AM, Josh Poimboeuf wrote: > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: >> On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: >> >> > Unless I'm missing something, I think it should be fine for nested NMIs, >> >> > since they're all on the

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Tue, Jul 26, 2016 at 01:49:06PM -0400, Brian Gerst wrote: > On Tue, Jul 26, 2016 at 12:47 PM, Josh Poimboeuf wrote: > > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: > >> On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf > >> wrote:

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Tue, Jul 26, 2016 at 01:49:06PM -0400, Brian Gerst wrote: > On Tue, Jul 26, 2016 at 12:47 PM, Josh Poimboeuf wrote: > > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: > >> On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf > >> wrote: > >> > Am I correct in understanding that

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Tue, Jul 26, 2016 at 01:51:27PM -0400, Steven Rostedt wrote: > On Tue, 26 Jul 2016 11:26:42 -0500 > Josh Poimboeuf wrote: > > > > Ok, I think that makes sense to me now. As I understand it, the > > "outermost" RIP is the authoritative one, because it was written by the

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Tue, Jul 26, 2016 at 01:51:27PM -0400, Steven Rostedt wrote: > On Tue, 26 Jul 2016 11:26:42 -0500 > Josh Poimboeuf wrote: > > > > Ok, I think that makes sense to me now. As I understand it, the > > "outermost" RIP is the authoritative one, because it was written by the > > original NMI.

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Steven Rostedt
On Tue, 26 Jul 2016 11:26:42 -0500 Josh Poimboeuf wrote: > Ok, I think that makes sense to me now. As I understand it, the > "outermost" RIP is the authoritative one, because it was written by the > original NMI. Any nested NMIs will update the original and/or iret >

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Steven Rostedt
On Tue, 26 Jul 2016 11:26:42 -0500 Josh Poimboeuf wrote: > Ok, I think that makes sense to me now. As I understand it, the > "outermost" RIP is the authoritative one, because it was written by the > original NMI. Any nested NMIs will update the original and/or iret > RIPs, which will only

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Brian Gerst
On Tue, Jul 26, 2016 at 12:47 PM, Josh Poimboeuf wrote: > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: >> On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: >> > Am I correct in understanding that there can only be one level of

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Brian Gerst
On Tue, Jul 26, 2016 at 12:47 PM, Josh Poimboeuf wrote: > On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: >> On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: >> > Am I correct in understanding that there can only be one level of NMI >> > nesting at any given time? If so,

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: > On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: > > Am I correct in understanding that there can only be one level of NMI > > nesting at any given time? If so, could we make it easier on the > >

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: > On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: > > Am I correct in understanding that there can only be one level of NMI > > nesting at any given time? If so, could we make it easier on the > > unwinder by putting the

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: > On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: > >> > Unless I'm missing something, I think it should be fine for nested NMIs, > >> > since they're all on the same stack. I can try to test it. What

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-26 Thread Josh Poimboeuf
On Mon, Jul 25, 2016 at 05:09:44PM -0700, Andy Lutomirski wrote: > On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: > >> > Unless I'm missing something, I think it should be fine for nested NMIs, > >> > since they're all on the same stack. I can try to test it. What in > >> > particular

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-25 Thread Andy Lutomirski
On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: > On Fri, Jul 22, 2016 at 05:15:03PM -0700, Andy Lutomirski wrote: >> On Fri, Jul 22, 2016 at 4:54 PM, Josh Poimboeuf wrote: >> >> > +static bool in_hardirq_stack(unsigned long *stack, struct

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-25 Thread Andy Lutomirski
On Sat, Jul 23, 2016 at 7:04 AM, Josh Poimboeuf wrote: > On Fri, Jul 22, 2016 at 05:15:03PM -0700, Andy Lutomirski wrote: >> On Fri, Jul 22, 2016 at 4:54 PM, Josh Poimboeuf wrote: >> >> > +static bool in_hardirq_stack(unsigned long *stack, struct stack_info >> >> > *info, >> >> > +

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-23 Thread Josh Poimboeuf
On Fri, Jul 22, 2016 at 05:15:03PM -0700, Andy Lutomirski wrote: > On Fri, Jul 22, 2016 at 4:54 PM, Josh Poimboeuf wrote: > >> > +static bool in_hardirq_stack(unsigned long *stack, struct stack_info > >> > *info, > >> > +unsigned long *visit_mask)

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-23 Thread Josh Poimboeuf
On Fri, Jul 22, 2016 at 05:15:03PM -0700, Andy Lutomirski wrote: > On Fri, Jul 22, 2016 at 4:54 PM, Josh Poimboeuf wrote: > >> > +static bool in_hardirq_stack(unsigned long *stack, struct stack_info > >> > *info, > >> > +unsigned long *visit_mask) > >> > +{ > >> > +

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-23 Thread Josh Poimboeuf
On Fri, Jul 22, 2016 at 04:52:10PM -0700, Andy Lutomirski wrote: > On Fri, Jul 22, 2016 at 4:26 PM, Andy Lutomirski wrote: > > On Thu, Jul 21, 2016 at 2:21 PM, Josh Poimboeuf wrote: > >> valid_stack_ptr() is buggy: it assumes that all stacks are of size

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-23 Thread Josh Poimboeuf
On Fri, Jul 22, 2016 at 04:52:10PM -0700, Andy Lutomirski wrote: > On Fri, Jul 22, 2016 at 4:26 PM, Andy Lutomirski wrote: > > On Thu, Jul 21, 2016 at 2:21 PM, Josh Poimboeuf wrote: > >> valid_stack_ptr() is buggy: it assumes that all stacks are of size > >> THREAD_SIZE, which is not true for

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-22 Thread Andy Lutomirski
On Fri, Jul 22, 2016 at 4:54 PM, Josh Poimboeuf wrote: >> > +static bool in_hardirq_stack(unsigned long *stack, struct stack_info >> > *info, >> > +unsigned long *visit_mask) >> > +{ >> > + unsigned long *begin = (unsigned long >> >

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-22 Thread Andy Lutomirski
On Fri, Jul 22, 2016 at 4:54 PM, Josh Poimboeuf wrote: >> > +static bool in_hardirq_stack(unsigned long *stack, struct stack_info >> > *info, >> > +unsigned long *visit_mask) >> > +{ >> > + unsigned long *begin = (unsigned long >> >

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-22 Thread Josh Poimboeuf
On Fri, Jul 22, 2016 at 04:26:46PM -0700, Andy Lutomirski wrote: > On Thu, Jul 21, 2016 at 2:21 PM, Josh Poimboeuf wrote: > > valid_stack_ptr() is buggy: it assumes that all stacks are of size > > THREAD_SIZE, which is not true for exception stacks. So the > > walk_stack()

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-22 Thread Josh Poimboeuf
On Fri, Jul 22, 2016 at 04:26:46PM -0700, Andy Lutomirski wrote: > On Thu, Jul 21, 2016 at 2:21 PM, Josh Poimboeuf wrote: > > valid_stack_ptr() is buggy: it assumes that all stacks are of size > > THREAD_SIZE, which is not true for exception stacks. So the > > walk_stack() callbacks will need to

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-22 Thread Andy Lutomirski
On Fri, Jul 22, 2016 at 4:26 PM, Andy Lutomirski wrote: > On Thu, Jul 21, 2016 at 2:21 PM, Josh Poimboeuf wrote: >> valid_stack_ptr() is buggy: it assumes that all stacks are of size >> THREAD_SIZE, which is not true for exception stacks. So the >>

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-22 Thread Andy Lutomirski
On Fri, Jul 22, 2016 at 4:26 PM, Andy Lutomirski wrote: > On Thu, Jul 21, 2016 at 2:21 PM, Josh Poimboeuf wrote: >> valid_stack_ptr() is buggy: it assumes that all stacks are of size >> THREAD_SIZE, which is not true for exception stacks. So the >> walk_stack() callbacks will need to know the

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-22 Thread Andy Lutomirski
On Thu, Jul 21, 2016 at 2:21 PM, Josh Poimboeuf wrote: > valid_stack_ptr() is buggy: it assumes that all stacks are of size > THREAD_SIZE, which is not true for exception stacks. So the > walk_stack() callbacks will need to know the location of the beginning > of the stack

Re: [PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-22 Thread Andy Lutomirski
On Thu, Jul 21, 2016 at 2:21 PM, Josh Poimboeuf wrote: > valid_stack_ptr() is buggy: it assumes that all stacks are of size > THREAD_SIZE, which is not true for exception stacks. So the > walk_stack() callbacks will need to know the location of the beginning > of the stack as well as the end. >

[PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-21 Thread Josh Poimboeuf
valid_stack_ptr() is buggy: it assumes that all stacks are of size THREAD_SIZE, which is not true for exception stacks. So the walk_stack() callbacks will need to know the location of the beginning of the stack as well as the end. Another issue is that in general the various features of a stack

[PATCH 10/19] x86/dumpstack: add get_stack_info() interface

2016-07-21 Thread Josh Poimboeuf
valid_stack_ptr() is buggy: it assumes that all stacks are of size THREAD_SIZE, which is not true for exception stacks. So the walk_stack() callbacks will need to know the location of the beginning of the stack as well as the end. Another issue is that in general the various features of a stack