Re: [PATCH V3 2/13] KVM/MMU: Add tlb flush with range helper function

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

 



Hi Paolo:
              Thanks for your review. Sorry for later response due to holiday.

On Mon, Oct 1, 2018 at 11:26 PM Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
>
> On 27/09/2018 05:48, Tianyu Lan wrote:
> > +
> > +     if (range && kvm_x86_ops->tlb_remote_flush_with_range) {
> > +             /*
> > +              * Read tlbs_dirty before flushing tlbs in order
> > +              * to track dirty tlbs during flushing.
> > +              */
> > +             long dirty_count = smp_load_acquire(&kvm->tlbs_dirty);
> > +
> > +             ret = kvm_x86_ops->tlb_remote_flush_with_range(kvm, range);
> > +             cmpxchg(&kvm->tlbs_dirty, dirty_count, 0);
>
> This is wrong, because it's not the entire TLB that is flushed.  So you
> cannot do the cmpxchg here.

Yes, nice catch. Will update in the next version.


-- 
Best regards
Tianyu Lan
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux