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