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

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to