Re: Fwd: [Bug 150021] New: kernel panic: "kernel tried to execute NX-protected page" when resuming from hibernate to disk

From: Rafael J. Wysocki
Date: Wed Jul 27 2016 - 19:24:56 EST


On Thursday, July 28, 2016 01:20:53 AM Rafael J. Wysocki wrote:
> On Wednesday, July 27, 2016 05:17:38 PM Josh Poimboeuf wrote:
> > On Thu, Jul 28, 2016 at 12:12:15AM +0200, Rafael J. Wysocki wrote:
> > > On Wednesday, July 27, 2016 12:59:18 PM Josh Poimboeuf wrote:
> > > > Hm... I have a theory, but I'm not sure about it. I noticed that
> > > > x86_acpi_enter_sleep_state(),
> > >
> > > I think you mean x86_acpi_suspend_lowlevel().
> >
> > Oops!
> >
> > > > which is involved in suspend, overwrites
> > > > several global variables (e.g, initial_code) which are used by the CPU
> > > > boot code in head_64.S. But surprisingly, it doesn't restore those
> > > > variables to their original values after it resumes.
> > >
> > > Is the head_64.S code also used to bring up offline CPUs?
> >
> > Yes.
>
> OK
>
> So it is really interesting why and how that stuff works for everybody.
>
> Basically, CPU online should fail after a suspend-resume cycle, but it
> doesn't most of the time AFAICS.

do_boot_cpu() restores those values, so I think we're safe from that angle.

That should apply to the CPU online during resume from hibernation too.

Thanks,
Rafael