Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-13 Thread Rafael J. Wysocki
On Sunday, June 12, 2016 10:11:38 AM Logan Gunthorpe wrote: > Hey Rafael, > > Awesome, this patch fixes the problem! Nice work. Great, thanks for testing! I've just sent an "official" version of it. Thanks, Rafael

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-12 Thread Logan Gunthorpe
Hey Rafael, Awesome, this patch fixes the problem! Nice work. Thanks, Logan On 12/06/16 08:31 AM, Rafael J. Wysocki wrote: On Saturday, June 11, 2016 10:48:08 PM Logan Gunthorpe wrote: Hey, Hi, On 11/06/16 07:05 PM, Rafael J. Wysocki wrote: 1) Commit ab76f7b4ab only extends the NX bit b

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-12 Thread Rafael J. Wysocki
On Saturday, June 11, 2016 10:48:08 PM Logan Gunthorpe wrote: > Hey, Hi, > On 11/06/16 07:05 PM, Rafael J. Wysocki wrote: > >> 1) Commit ab76f7b4ab only extends the NX bit between __ex_table and > >> rodata; which, by my understanding, shouldn't be used by anything. And > >> __ex_table and rodata

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-11 Thread Logan Gunthorpe
Hey, On 11/06/16 07:05 PM, Rafael J. Wysocki wrote: 1) Commit ab76f7b4ab only extends the NX bit between __ex_table and rodata; which, by my understanding, shouldn't be used by anything. And __ex_table and rodata are fixed by the kernel's binary so both symbols should be the same in both the ima

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-11 Thread Rafael J. Wysocki
On Saturday, June 11, 2016 11:39:48 AM Logan Gunthorpe wrote: > Hey Rafael, > > I tried this patch as well and there was no change. > > I have a couple tentative observations to make though. None of this is > 100% clear to me so please correct me if I'm wrong anywhere: > > 1) Commit ab76f7b4ab

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-11 Thread Logan Gunthorpe
Hey Rafael, I tried this patch as well and there was no change. I have a couple tentative observations to make though. None of this is 100% clear to me so please correct me if I'm wrong anywhere: 1) Commit ab76f7b4ab only extends the NX bit between __ex_table and rodata; which, by my underst

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-11 Thread Logan Gunthorpe
Hey Rafael, Thank for looking into this. I tried the patch below applied to v4.6 and I still got a lockup on resume. Additionally there was a kernel warning at arch/x86/mm/pageattr.c:1414 change_page_attr_set_clr+0x2bb/0x440 and another one right afterwards at kernel/smp.c:416 smp_call_functi

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-11 Thread Rafael J. Wysocki
On Saturday, June 11, 2016 03:47:59 AM Rafael J. Wysocki wrote: > On Saturday, June 11, 2016 02:13:45 AM Rafael J. Wysocki wrote: > > On Saturday, June 11, 2016 12:33:31 AM Rafael J. Wysocki wrote: > > > On Friday, June 10, 2016 04:28:01 PM Logan Gunthorpe wrote: > > > > > > > > On 10/06/16 04:29

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Rafael J. Wysocki
On Saturday, June 11, 2016 02:13:45 AM Rafael J. Wysocki wrote: > On Saturday, June 11, 2016 12:33:31 AM Rafael J. Wysocki wrote: > > On Friday, June 10, 2016 04:28:01 PM Logan Gunthorpe wrote: > > > > > > On 10/06/16 04:29 PM, Rafael J. Wysocki wrote: > > > > OK, I have a theory, but I need a bit

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Rafael J. Wysocki
On Saturday, June 11, 2016 12:33:31 AM Rafael J. Wysocki wrote: > On Friday, June 10, 2016 04:28:01 PM Logan Gunthorpe wrote: > > > > On 10/06/16 04:29 PM, Rafael J. Wysocki wrote: > > > OK, I have a theory, but I need a bit of help. > > > > > > This may be a dumb question, but I don't quite reme

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Rafael J. Wysocki
On Friday, June 10, 2016 04:28:01 PM Logan Gunthorpe wrote: > > On 10/06/16 04:29 PM, Rafael J. Wysocki wrote: > > OK, I have a theory, but I need a bit of help. > > > > This may be a dumb question, but I don't quite remember the answer readily. > > > > Given a physical address, how do I get the

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Logan Gunthorpe
On 10/06/16 04:29 PM, Rafael J. Wysocki wrote: > OK, I have a theory, but I need a bit of help. > > This may be a dumb question, but I don't quite remember the answer readily. > > Given a physical address, how do I get the corresponding virtual one under > the kernel identity mapping? Is that

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Rafael J. Wysocki
On Friday, June 10, 2016 11:27:29 PM Rafael J. Wysocki wrote: > On Friday, June 10, 2016 11:09:22 AM Kees Cook wrote: > > On Thu, Jun 9, 2016 at 9:14 PM, Logan Gunthorpe wrote: > > > Hey, > > > > > > I've still be trying to figure this out as I have time. > > > > > > I tried printing a couple rest

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Rafael J. Wysocki
On Friday, May 20, 2016 02:59:30 PM Kees Cook wrote: > On Fri, May 20, 2016 at 2:46 PM, Rafael J. Wysocki wrote: > > On Fri, May 20, 2016 at 3:56 PM, Stephen Smalley wrote: > >> On 05/20/2016 07:34 AM, Rafael J. Wysocki wrote: > >>> On Fri, May 20, 2016 at 9:15 AM, Ingo Molnar wrote: > > >>

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Rafael J. Wysocki
On Friday, June 10, 2016 11:09:22 AM Kees Cook wrote: > On Thu, Jun 9, 2016 at 9:14 PM, Logan Gunthorpe wrote: > > Hey, > > > > I've still be trying to figure this out as I have time. > > > > I tried printing a couple restore addresses and nothing I can find seems > > anywhere near the rodata/ex_t

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Kees Cook
On Fri, Jun 10, 2016 at 11:16 AM, Logan Gunthorpe wrote: > Hey, > > On 10/06/16 12:09 PM, Kees Cook wrote: >>> restore_code: 880157c3b000 >>> jump_addr: 81446be0 >>> >>> >>> diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c >>> index 009947d..6efedb7 100644 >>>

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Logan Gunthorpe
Hey, On 10/06/16 12:09 PM, Kees Cook wrote: >> restore_code: 880157c3b000 >> jump_addr: 81446be0 >> >> >> diff --git a/arch/x86/power/hibernate_64.c b/arch/x86/power/hibernate_64.c >> index 009947d..6efedb7 100644 >> --- a/arch/x86/power/hibernate_64.c >> +++ b/arch/x86/power/hibernate

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-06-10 Thread Kees Cook
On Thu, Jun 9, 2016 at 9:14 PM, Logan Gunthorpe wrote: > Hey, > > I've still be trying to figure this out as I have time. > > I tried printing a couple restore addresses and nothing I can find seems > anywhere near the rodata/ex_table boundary. > > I tried with the (badly formatted) below and got

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-05-21 Thread Kees Cook
On Fri, May 20, 2016 at 6:57 PM, Logan Gunthorpe wrote: > On 20/05/16 04:16 PM, Kees Cook wrote: >> >> On Fri, May 20, 2016 at 2:59 PM, Kees Cook wrote: >>> >>> On Fri, May 20, 2016 at 2:46 PM, Rafael J. Wysocki >>> wrote: On Fri, May 20, 2016 at 3:56 PM, Stephen Smalley wrote: >

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-05-20 Thread Kees Cook
On Fri, May 20, 2016 at 2:59 PM, Kees Cook wrote: > On Fri, May 20, 2016 at 2:46 PM, Rafael J. Wysocki wrote: >> On Fri, May 20, 2016 at 3:56 PM, Stephen Smalley wrote: >>> On 05/20/2016 07:34 AM, Rafael J. Wysocki wrote: On Fri, May 20, 2016 at 9:15 AM, Ingo Molnar wrote: > > * Lo

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-05-20 Thread Kees Cook
On Fri, May 20, 2016 at 2:46 PM, Rafael J. Wysocki wrote: > On Fri, May 20, 2016 at 3:56 PM, Stephen Smalley wrote: >> On 05/20/2016 07:34 AM, Rafael J. Wysocki wrote: >>> On Fri, May 20, 2016 at 9:15 AM, Ingo Molnar wrote: * Logan Gunthorpe wrote: > Hi, > > I have be

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-05-20 Thread Rafael J. Wysocki
On Fri, May 20, 2016 at 3:56 PM, Stephen Smalley wrote: > On 05/20/2016 07:34 AM, Rafael J. Wysocki wrote: >> On Fri, May 20, 2016 at 9:15 AM, Ingo Molnar wrote: >>> >>> * Logan Gunthorpe wrote: >>> Hi, I have been working on a bug that causes my laptop to freeze during resum

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-05-20 Thread Stephen Smalley
On 05/20/2016 07:34 AM, Rafael J. Wysocki wrote: > On Fri, May 20, 2016 at 9:15 AM, Ingo Molnar wrote: >> >> * Logan Gunthorpe wrote: >> >>> Hi, >>> >>> I have been working on a bug that causes my laptop to freeze during >>> resume from hibernation. I did a bisect to find the offending commit: >>

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-05-20 Thread Rafael J. Wysocki
On Fri, May 20, 2016 at 9:15 AM, Ingo Molnar wrote: > > * Logan Gunthorpe wrote: > >> Hi, >> >> I have been working on a bug that causes my laptop to freeze during >> resume from hibernation. I did a bisect to find the offending commit: >> >> [ab76f7b4ab] x86/mm: Set NX on gap between __ex_table

Re: PROBLEM: Resume form hibernate broken by setting NX on gap

2016-05-20 Thread Ingo Molnar
* Logan Gunthorpe wrote: > Hi, > > I have been working on a bug that causes my laptop to freeze during > resume from hibernation. I did a bisect to find the offending commit: > > [ab76f7b4ab] x86/mm: Set NX on gap between __ex_table and rodata > > There is more information in the bugzilla rep