public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Chen Yu <yu.c.chen@intel.com>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H . Peter Anvin" <hpa@zytor.com>,
	linux-pm@vger.kernel.org,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	Borislav Petkov <bp@suse.de>,
	Zhu Guihua <zhugh.fnst@cn.fujitsu.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation
Date: Mon, 6 Jun 2016 16:25:06 +0200	[thread overview]
Message-ID: <20160606142506.GE30909@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1465222749-8388-1-git-send-email-yu.c.chen@intel.com>

On Mon, Jun 06, 2016 at 10:19:09PM +0800, Chen Yu wrote:
> @@ -1595,8 +1596,21 @@ static inline void mwait_play_dead(void)
>  	 * This should be a memory location in a cache line which is
>  	 * unlikely to be touched by other processors.  The actual
>  	 * content is immaterial as it is not actually modified in any way.
> +	 *
> +	 * However in hibernation resume process, this address could be
> +	 * touched by BSP when restoring page frames, if the page table
> +	 * for this address is not coherent across hibernation(due to
> +	 * inconsistence of e820 memory map), access from APs might
> +	 * cause exception. So change the mwait address to zero page,
> +	 * which is located in .bss, in this way we can avoid illegal
> +	 * access from APs because page table for kernel mapping
> +	 * of text/data/bss should keeps unchanged according to
> +	 * hibernation semantic.
>  	 */
> -	mwait_ptr = &current_thread_info()->flags;
> +	if (hibernation_in_resume())
> +		mwait_ptr = empty_zero_page;
> +	else
> +		mwait_ptr = &current_thread_info()->flags;

Why is this conditional? Is there any case in which the zero page is not
also correct?

  reply	other threads:[~2016-06-06 14:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-06 14:19 [PATCH][RFC] x86, hotplug: Use zero page for monitor when resuming from hibernation Chen Yu
2016-06-06 14:25 ` Peter Zijlstra [this message]
2016-06-06 15:59   ` Chen, Yu C
2016-06-06 16:40     ` Peter Zijlstra
2016-06-06 17:34       ` Brian Gerst
2016-06-06 21:05       ` H. Peter Anvin
2016-06-07  8:03 ` Pavel Machek
2016-06-07  8:44   ` Chen Yu
2016-06-07  9:13     ` Borislav Petkov
2016-06-07  9:43       ` Chen Yu

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=20160606142506.GE30909@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bp@suse.de \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    --cc=zhugh.fnst@cn.fujitsu.com \
    /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