xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Tamas K Lengyel <tamas.lengyel@zentific.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: Question about VPID during MOV-TO-CR3
Date: Wed, 21 Sep 2016 08:18:23 -0600	[thread overview]
Message-ID: <CAErYnsi3vWKH12oyNGHNK_U9W67A8DD9qtkw9SePg53Biht2kw@mail.gmail.com> (raw)
In-Reply-To: <57E27BB90200007800110F8B@prv-mh.provo.novell.com>

On Wed, Sep 21, 2016 at 4:23 AM, Jan Beulich <JBeulich@suse.com> wrote:
>>>> On 20.09.16 at 19:29, <tamas.lengyel@zentific.com> wrote:
>> I'm trying to figure out the design decision regarding the handling of
>> guest MOV-TO-CR3 operations and TLB flushes. AFAICT since support for
>> VPID has been added to Xen, every guest MOV-TO-CR3 flushes the TLB
>> (vmx_cr_access -> hvm_mov_to_cr -> hvm_set_cr3 -> paging_update_cr3 ->
>> hap_update_cr3 -> vmx_update_guest_cr -> hvm_asid_flush_vcpu). From a
>> TLB utilization point-of-view this seems to be rather wasteful.
>> Furthermore, it even breaks the guests' ability to take advantage of
>> PCID, as the TLB just guts flushed when a new process is scheduled.
>> Does anyone have an insight into what was the rationale behind this?
>
> Since you don't quote the specific commit(s), I would guess that
> this was mainly an attempt by the author(s) to keep things simple
> for themselves, i.e. not having to properly think through under
> which conditions less than a full TLB flush would suffice.

The commit that added VPID and the TLB flush is
e2cf9bd6e055ea678da129b776f4521f6a0b50fe x86, vmx: Enable VPID
(Virtual Processor Identification). So this has been there as long as
Xen supported VPID. The only case where flushing the TLB on a guest
MOV-TO-CR3 that possibly would make sense to me is if we are running a
PV guest. But this is hvm/vmx, so why would we care about what the
guest does to its cr3 from a TLB standpoint? Wouldn't the guest OS
need be in charge of that? With the TLBs being tagged there is no
side-effect the guest can induce on any other domain whether it
flushes its TLB or not.

Tamas

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

  reply	other threads:[~2016-09-21 14:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20 17:29 Question about VPID during MOV-TO-CR3 Tamas K Lengyel
2016-09-21 10:23 ` Jan Beulich
2016-09-21 14:18   ` Tamas K Lengyel [this message]
2016-09-21 14:44     ` Jan Beulich
2016-09-21 15:09       ` Tamas K Lengyel
2016-09-21 15:16         ` Tamas K Lengyel
2016-09-21 15:23           ` Jan Beulich
2016-09-21 15:30             ` Tamas K Lengyel
2016-09-21 18:26               ` Tamas K Lengyel
2016-09-22  9:00                 ` Jan Beulich
2016-09-22 10:39                   ` Tamas K Lengyel
2016-09-22 11:35                     ` Jan Beulich
2016-09-22  8:56               ` Jan Beulich
2016-09-22 10:35                 ` Tamas K Lengyel
2016-09-22 11:27                   ` Jan Beulich
2016-09-22 11:37                     ` Tamas K Lengyel
2016-09-22 17:18                       ` Tamas K Lengyel
2016-09-23  8:24                         ` Jan Beulich
2016-09-23  8:35                           ` Razvan Cojocaru
2016-09-23 15:26                           ` Tamas K Lengyel
2016-09-23 15:39                             ` Jan Beulich
2016-09-23 15:50                               ` Tamas K Lengyel
2016-09-23 20:45                                 ` Tamas K Lengyel
2016-09-26  6:24                                   ` Jan Beulich
2016-09-26 16:12                                     ` Tamas K Lengyel
2016-09-27 13:49                                       ` Jan Beulich
2016-10-01 19:05                                         ` Tamas K Lengyel
2016-10-04  7:41                                           ` Jan Beulich
2016-10-04 14:12                                             ` Tamas K Lengyel
2016-10-04 14:29                                               ` Jan Beulich
2016-10-04 15:06                                                 ` Tim Deegan
2016-10-07 15:32                                                   ` Jan Beulich
2016-10-07 15:41                                                     ` Tamas K Lengyel
2016-10-07 16:00                                                       ` Jan Beulich

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=CAErYnsi3vWKH12oyNGHNK_U9W67A8DD9qtkw9SePg53Biht2kw@mail.gmail.com \
    --to=tamas.lengyel@zentific.com \
    --cc=JBeulich@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).