xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Simon Gaiser <simon@invisiblethingslab.com>
To: Jan Beulich <JBeulich@suse.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH] x86/XPTI: fix S3 resume (and CPU offlining in general)
Date: Thu, 24 May 2018 14:00:00 +0000	[thread overview]
Message-ID: <5946c6fe-73f0-bfbb-bc0b-2026d1231f79@invisiblethingslab.com> (raw)
In-Reply-To: <5B06C0F902000078001C5925@prv1-mh.provo.novell.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 1290 bytes --]

Jan Beulich:
> In commit d1d6fc97d6 ("x86/xpti: really hide almost all of Xen image")
> I've failed to remember the fact that multiple CPUs share a stub
> mapping page. Therefore it is wrong to unconditionally zap the mapping
> when bringing down a CPU; it may only be unmapped when no other online
> CPU uses that same page.
> 
> Reported-by: Simon Gaiser <simon@invisiblethingslab.com>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/arch/x86/smpboot.c
> +++ b/xen/arch/x86/smpboot.c
> @@ -876,7 +876,21 @@ static void cleanup_cpu_root_pgt(unsigne
>  
>      free_xen_pagetable(rpt);
>  
> -    /* Also zap the stub mapping for this CPU. */
> +    /*
> +     * Also zap the stub mapping for this CPU, if no other online one uses
> +     * the same page.
> +     */
> +    if ( stub_linear )
> +    {
> +        unsigned int other;
> +
> +        for_each_online_cpu(other)
> +            if ( !((per_cpu(stubs.addr, other) ^ stub_linear) >> PAGE_SHIFT) )
> +            {
> +                stub_linear = 0;
> +                break;
> +            }
> +    }
>      if ( stub_linear )
>      {
>          l3_pgentry_t *l3t = l4e_to_l3e(common_pgt);

Tried this on-top of staging (fc5805daef) and I still get the same
double fault.


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2018-05-24 14:00 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-24 13:41 [PATCH] x86/XPTI: fix S3 resume (and CPU offlining in general) Jan Beulich
2018-05-24 13:48 ` Andrew Cooper
2018-05-24 14:05   ` Jan Beulich
2018-05-24 14:00 ` Simon Gaiser [this message]
2018-05-24 14:08   ` Jan Beulich
2018-05-24 14:14     ` Simon Gaiser
2018-05-24 14:18       ` Andrew Cooper
2018-05-24 14:22         ` Jan Beulich
2018-05-24 14:24           ` Andrew Cooper
2018-05-24 14:31             ` Jan Beulich
2018-05-24 14:35         ` Simon Gaiser
2018-05-24 14:53           ` Andrew Cooper
2018-05-24 15:10             ` George Dunlap
2018-05-24 15:16             ` Simon Gaiser
2018-05-24 14:28       ` Jan Beulich
2018-05-24 15:10         ` Simon Gaiser
2018-05-24 15:31           ` Jan Beulich
2018-05-24 15:46           ` Jan Beulich
2018-05-24 16:12             ` Simon Gaiser
     [not found] <5B06C0F902000078001C5925@suse.com>
2018-05-28  4:26 ` Juergen Gross

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=5946c6fe-73f0-bfbb-bc0b-2026d1231f79@invisiblethingslab.com \
    --to=simon@invisiblethingslab.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jgross@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /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;
as well as URLs for NNTP newsgroup(s).