xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Keir Fraser <keir.xen@gmail.com>
To: Mukesh Rathor <mukesh.rathor@oracle.com>
Cc: "Xen-devel@lists.xensource.com" <Xen-devel@lists.xensource.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [help]: VPID tagged TLBs question.
Date: Sat, 28 Apr 2012 06:45:20 +0100	[thread overview]
Message-ID: <CBC14280.31BFE%keir.xen@gmail.com> (raw)
In-Reply-To: <20120427182501.197681ff@mantra.us.oracle.com>

On 28/04/2012 02:25, "Mukesh Rathor" <mukesh.rathor@oracle.com> wrote:

> On Thu, 26 Apr 2012 08:23:29 +0100
> Keir Fraser <keir.xen@gmail.com> wrote:
> 
>> On 26/04/2012 02:07, "Mukesh Rathor" <mukesh.rathor@oracle.com> wrote:
>> 
>>> However, I don't understand the use of hvm_asid_flush_core which
>>> it appears will cause all HVM vcpu's to get new vpid/asid, hence,
>>> discard all previously used VPID tagged TLBs. In particular,
>>> consider a PV guest:
>>> 
>>> write_ptbase -> write_cr3 -> hvm_flush_guest_tlbs ->
>>> hvm_asid_flush_core().
>>> 
>>> Since the PV guest is only using VPID 0 tagged TLBs, why do we need
>>> to flush all TLBs for all HVM guests?
>> 
>> It's just being conservative, as callers of write_cr3 may assume that
>> the TLB is entirely flushed, for all guests.
> 
> Well, for write_cr3 path at least, we just need to invalidate all TLBs
> in the local pcpu. So it seems for this path we could just do
> invvpid with type 2, ie, invalidate all vpids except 0. Prob also need
> to do 'invept 2'. what do you think, worth it?

Try lashing it up and measure it. :-) My guess would be that it is not worth
it.

Our current algorithm minimises INVVPID instructions, just eats through the
VPID space instead. Depending on the cost of INVVPID, versus the cost of
having never-used-again stale tagged entries clogging up the TLB, our
algorithm may be a bit better or worse than one that more aggressively uses
INVVPID. My guess (which is only a guess!) is that the difference will be
totally insignificant and unmeasurable.

 -- Keir

> thanks,
> Mukesh
> 
> 

      reply	other threads:[~2012-04-28  5:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-26  1:07 [help]: VPID tagged TLBs question Mukesh Rathor
2012-04-26  7:23 ` Keir Fraser
2012-04-28  1:25   ` Mukesh Rathor
2012-04-28  5:45     ` Keir Fraser [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=CBC14280.31BFE%keir.xen@gmail.com \
    --to=keir.xen@gmail.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Xen-devel@lists.xensource.com \
    --cc=mukesh.rathor@oracle.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;
as well as URLs for NNTP newsgroup(s).