Re: [PATCH 1/4] KVM: Add APIs for unlocked TLB flush

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 08, 2012 at 12:09:38PM +0300, Avi Kivity wrote:
> On 05/08/2012 04:55 AM, Marcelo Tosatti wrote:
> > > > Yes, so, we can change kvm_mark_tlb_dirty to:
> > > >
> > > > +static inline void kvm_mark_tlb_dirty(struct kvm *kvm)
> > > > +{
> > > > +	/*
> > > > +	 * Make any changes to the page tables visible to remote flushers.
> > > > +	 */
> > > > +	smb_mb();
> > > > +	kvm->tlb_state.dirtied_count++;
> > > > +}
> > > >
> > > 
> > > Yes.  We'll have to change it again if we ever dirty sptes outside the
> > > lock, but that's okay.
> >
> > Please don't. There are readers outside mmu_lock, so it should be
> > atomic.
> 
> Why does it need to be atomic?  All it needs is to be properly barriered
> (provided by spin_unlock(mmu_lock).

It does not _need_ to be atomic. It is easier to verify and self 
contained.

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


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux