All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH v2] KVM: MMU: Don't use RCU for lockless shadow walking
Date: Tue, 24 Apr 2012 13:42:05 +0300	[thread overview]
Message-ID: <4F96837D.2040808@redhat.com> (raw)
In-Reply-To: <4F967CD1.1020605@linux.vnet.ibm.com>

On 04/24/2012 01:13 PM, Xiao Guangrong wrote:
> On 04/24/2012 05:47 PM, Avi Kivity wrote:
>
>
> >  static void kvm_mmu_commit_zap_page(struct kvm *kvm,
> >  				    struct list_head *invalid_list)
> >  {
> > @@ -2021,17 +2006,17 @@ static void kvm_mmu_commit_zap_page(struct kvm *kvm,
> >  	if (list_empty(invalid_list))
> >  		return;
> > 
> > -	kvm_flush_remote_tlbs(kvm);
> > -
> > -	if (atomic_read(&kvm->arch.reader_counter)) {
> > -		kvm_mmu_isolate_pages(invalid_list);
> > -		sp = list_first_entry(invalid_list, struct kvm_mmu_page, link);
> > -		list_del_init(invalid_list);
> > +	/*
> > +	 * wmb: make sure everyone sees our modifications to the page tables
>
>
> Other lockless vcpu can see a old-copy of a spte, but it is ok since all page
> tables is valid to be used. (kvm_flush_remote_tlbs can stop page table to be
> freed)

We want kvm_commit_zap_page() to see the changes before freeing memory. 
But maybe it's the responsibility of kmem_cache_free()/kmem_cache_alloc().

> > +	 * rmb: make sure we see changes to vcpu->mode
>
>
> It is the responsibility of kvm_flush_remote_tlbs to see changes to vcpu->mode.
> No?

Yes.

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2012-04-24 10:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-24  9:47 [PATCH v2] KVM: MMU: Don't use RCU for lockless shadow walking Avi Kivity
2012-04-24 10:13 ` Xiao Guangrong
2012-04-24 10:42   ` Avi Kivity [this message]
2012-04-26 22:00 ` Marcelo Tosatti
2012-04-27  6:07   ` Xiao Guangrong
2012-04-27 21:49     ` Marcelo Tosatti
2012-04-29  9:38       ` Avi Kivity
2012-04-29  9:35   ` 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=4F96837D.2040808@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=xiaoguangrong@linux.vnet.ibm.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 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.