kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: kvm@vger.kernel.org
Subject: Re: [patch 2/3] KVM: MMU: skip global pgtables on sync due to cr3 switch
Date: Fri, 31 Oct 2008 17:36:03 -0200	[thread overview]
Message-ID: <20081031193603.GC21772@dmt.cnet> (raw)
In-Reply-To: <49045426.1080807@redhat.com>

On Sun, Oct 26, 2008 at 01:27:34PM +0200, Avi Kivity wrote:
> Marcelo Tosatti wrote:
>> Skip syncing global pages on cr3 switch (but not on cr4/cr0). This is
>> important for Linux 32-bit guests with PAE, where the kmap page is
>> marked as global.
>>
>>   
>
> Patch is good, but won't apply without the first.
>
>>  {
>>  	u64 spte;
>>  	int ret = 0;
>>  	u64 mt_mask = shadow_mt_mask;
>> +	struct kvm_mmu_page *sp = page_header(__pa(shadow_pte));
>> +
>> +	if (!global && sp->global) {
>> +		sp->global = 0;
>>   
>
> A slight deficiency in this approach is that a page can't transition  
> from !global to global.  I don't think this is frequent, so we don't  
> need to deal with it.

Yep.

> But a more accurate approach is to keep a count  
> of non-global present mappings, and to activate the global logic when  
> this count is nonzero.

I don't think the overhead it adds is significant for the added
complexity? 


  reply	other threads:[~2008-10-31 19:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-25 22:31 [patch 0/3] oos shadow optimizations Marcelo Tosatti
2008-10-25 22:31 ` [patch 1/3] KVM: MMU: collapse remote TLB flushes on root sync Marcelo Tosatti
2008-10-26 11:17   ` Avi Kivity
2008-10-29 23:26     ` Marcelo Tosatti
2008-10-30 10:04       ` Avi Kivity
2008-10-31 19:30         ` Marcelo Tosatti
2008-10-25 22:31 ` [patch 2/3] KVM: MMU: skip global pgtables on sync due to cr3 switch Marcelo Tosatti
2008-10-26 11:27   ` Avi Kivity
2008-10-31 19:36     ` Marcelo Tosatti [this message]
2008-10-31 19:43       ` Avi Kivity
2008-10-31 19:50         ` Marcelo Tosatti
2008-10-31 19:59           ` Avi Kivity
2008-10-25 22:31 ` [patch 3/3] KVM: MMU: prepopulate the shadow on invlpg Marcelo Tosatti
2008-10-26 11:48   ` Avi Kivity
2008-10-31 19:47     ` Marcelo Tosatti
2008-10-31 19:58       ` Avi Kivity
2008-10-31 22:33         ` Marcelo Tosatti
2008-11-02  8:39           ` Avi Kivity
2008-11-02 16:08             ` Marcelo Tosatti
2008-11-02 16:14               ` Avi Kivity

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=20081031193603.GC21772@dmt.cnet \
    --to=mtosatti@redhat.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.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).