All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <JBeulich@suse.com>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Tim Deegan <tim@xen.org>, Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] x86/p2m: Stop other vcpus using a nested p2m before clearing it
Date: Wed, 8 Feb 2017 18:08:03 +0000	[thread overview]
Message-ID: <f61b661d-fded-1485-5144-9aaf4f759db2@citrix.com> (raw)
In-Reply-To: <a7e79557-7802-486e-9913-6e09364b8fab@citrix.com>

On 08/02/17 18:06, George Dunlap wrote:
> On 08/02/17 13:20, Andrew Cooper wrote:
>> On 08/02/17 13:13, Jan Beulich wrote:
>>>>>> On 07.02.17 at 19:48, <andrew.cooper3@citrix.com> wrote:
>>>> Until the IPI has completed, other processors might be running on this nested
>>>> p2m object.  clear_domain_page() does not guarantee to make 8-byte atomic
>>>> updates, which means that a pagewalk on a remote processor might encounter a
>>>> partial update.
>>>>
>>>> This is currently safe as other issues prevents a nested p2m ever being shared
>>>> between two cpus (although this is contrary to the original plan).
>>>>
>>>> Setting p2m->np2m_base to P2M_BASE_EADDR before the IPI ensures that the IPI'd
>>>> processors won't continue to use the flushed mappings.
>>>>
>>>> While modifying this function, remove all the trailing whitespace and tweak
>>>> style in the affected areas.
>>>>
>>>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>>> Reviewed-by: Jan Beulich <jbeulich@suse.com>
>>> but ...
>>>
>>>> @@ -1633,19 +1635,21 @@ p2m_flush_table(struct p2m_domain *p2m)
>>>>  
>>>>      /* This is no longer a valid nested p2m for any address space */
>>>>      p2m->np2m_base = P2M_BASE_EADDR;
>>>> -    
>>>> -    /* Zap the top level of the trie */
>>>> -    mfn = pagetable_get_mfn(p2m_get_pagetable(p2m));
>>>> -    clear_domain_page(mfn);
>>>>  
>>>>      /* Make sure nobody else is using this p2m table */
>>>>      nestedhvm_vmcx_flushtlb(p2m);
>>>>  
>>>> +    /* Zap the top level of the trie */
>>> s/trie/tree/ here, as you touch it anyway?
>>
>> Trie here refers to the datastructure https://en.wikipedia.org/wiki/Trie
>> which is the structure implemented by processor pagetables.  It is more
>> specific than just calling them trees.
> 
> Never heard that before, but we seem to already have at least six
> instances in the hypervisor (and an ocaml file called 'trie.mli'), so I
> guess there's precedent. :-)
> 
> Reviewed-by: George Dunlap <george.dunlap@citrix.com>
> 
> I'll check this one in.

Or maybe I won't. :-)

 -George


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

      reply	other threads:[~2017-02-08 18:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 18:48 [PATCH] x86/p2m: Stop other vcpus using a nested p2m before clearing it Andrew Cooper
2017-02-08  9:46 ` Tim Deegan
2017-02-08 13:13 ` Jan Beulich
2017-02-08 13:20   ` Andrew Cooper
2017-02-08 18:06     ` George Dunlap
2017-02-08 18:08       ` George Dunlap [this message]

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=f61b661d-fded-1485-5144-9aaf4f759db2@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.