public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mat <castet.matthieu@free.fr>, Andi Kleen <andi@firstfloor.org>,
	Siarhei Liakh <sliakh.lkml@gmail.com>,
	Xuxian Jiang <jiang@cs.ncsu.edu>, Ingo Molnar <mingo@elte.hu>,
	Arjan van de Ven <arjan@infradead.org>,
	lkml <linux-kernel@vger.kernel.org>, tglx <tglx@linutronix.de>
Subject: Re: -tip tree resume fail, bisect to 5bd5a45(x86: Add NX protection for kernel data)
Date: Wed, 01 Dec 2010 08:15:04 +0800	[thread overview]
Message-ID: <1291162504.2405.216.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <1291116438.32004.649.camel@laptop>

On Tue, 2010-11-30 at 19:27 +0800, Peter Zijlstra wrote:
> On Tue, 2010-11-30 at 13:00 +0800, Lin Ming wrote:
> > echo 0 > /sys/devices/system/cpu/cpu1/online;
> > echo 1 > /sys/devices/system/cpu/cpu1/online;
> > 
> > then machine just reboots...
> > 
> 
> That should work on current -tip (and my test machine confirms with a
> -tip of yesterday) due to:

Yes, I know.

I tested for Mat's request to confirm that CPU suspend/resume also
broken, not only S3.

And no interesting trace I can get because machine just reboots
immediately when CPU suspend/resume.

Thanks.

> 
> ---
> commit 691513f70d3957939a318da970987b876c720861
> Author: Lin Ming <ming.m.lin@intel.com>
> Date:   Mon Nov 22 14:03:28 2010 +0100
> 
>     x86: Resume trampoline must be executable
>     
>     commit 5bd5a452(x86: Add NX protection for kernel data) marked the
>     trampoline area NX - which unsurprisingly breaks resume and cpu
>     hotplug.
>     
>     Revert the portion of that commit, which touches the trampoline.
>     
>     Originally-from: Lin Ming <ming.m.lin@intel.com>
>     LKML-Reference: <1290410581.2405.24.camel@minggr.sh.intel.com>
>     Cc: Matthieu Castet <castet.matthieu@free.fr>
>     Cc: Siarhei Liakh <sliakh.lkml@gmail.com>
>     Cc: Xuxian Jiang <jiang@cs.ncsu.edu>
>     Cc: Ingo Molnar <mingo@elte.hu>
>     Cc: Arjan van de Ven <arjan@infradead.org>
>     Cc: Andi Kleen <andi@firstfloor.org>
>     Tested-by: Peter Zijlstra <peterz@infradead.org>
>     Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> 
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index ce59c05..71a5929 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -788,7 +788,6 @@ void mark_rodata_ro(void)
>  	unsigned long rodata_start =
>  		((unsigned long)__start_rodata + PAGE_SIZE - 1) & PAGE_MASK;
>  	unsigned long end = (unsigned long) &__end_rodata_hpage_align;
> -	unsigned long kernel_end = (((unsigned long)&__init_end + HPAGE_SIZE) & HPAGE_MASK);
>  	unsigned long text_end = PAGE_ALIGN((unsigned long) &__stop___ex_table);
>  	unsigned long rodata_end = PAGE_ALIGN((unsigned long) &__end_rodata);
>  	unsigned long data_start = (unsigned long) &_sdata;
> @@ -803,7 +802,7 @@ void mark_rodata_ro(void)
>  	 * The rodata section (but not the kernel text!) should also be
>  	 * not-executable.
>  	 */
> -	set_memory_nx(rodata_start, (kernel_end - rodata_start) >> PAGE_SHIFT);
> +	set_memory_nx(rodata_start, (end - rodata_start) >> PAGE_SHIFT);
>  
>  	rodata_test();
>  
> 



  reply	other threads:[~2010-12-01  0:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-22  7:23 -tip tree resume fail, bisect to 5bd5a45(x86: Add NX protection for kernel data) Lin Ming
2010-11-22  8:07 ` Ingo Molnar
2010-11-22  9:20   ` Andi Kleen
2010-11-22 10:29     ` castet.matthieu
2010-11-22 10:47       ` Andi Kleen
2010-11-22 13:03 ` Peter Zijlstra
2010-11-22 16:29   ` castet.matthieu
2010-11-22 16:35     ` Peter Zijlstra
2010-11-22 16:42       ` Andi Kleen
2010-11-23 22:55         ` mat
2010-11-26 17:31           ` mat
2010-11-26 23:39             ` Lin Ming
2010-11-30  5:00             ` Lin Ming
2010-11-30 11:27               ` Peter Zijlstra
2010-12-01  0:15                 ` Lin Ming [this message]
2011-01-23 19:06                   ` matthieu castet
2011-01-24 22:22                     ` matthieu castet
2011-01-25 12:36                       ` Lin Ming
2011-03-09 23:16                       ` matthieu castet
2011-03-10  2:39                         ` Lin Ming
2010-12-24 17:26               ` matthieu castet
2010-12-27  2:10                 ` Lin Ming
2011-01-05 18:58                   ` matthieu castet
2010-11-22 13:42 ` [tip:x86/security] x86: Resume trampoline must be executable tip-bot for Lin Ming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1291162504.2405.216.camel@minggr.sh.intel.com \
    --to=ming.m.lin@intel.com \
    --cc=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=castet.matthieu@free.fr \
    --cc=jiang@cs.ncsu.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=sliakh.lkml@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox