lkml.org 
[lkml]   [2018]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH V3 2/13] KVM/MMU: Add tlb flush with range helper function
    From
    Date
    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.

    Paolo

    > +
    > + if (ret)
    > + kvm_flush_remote_tlbs(kvm);
    > +}
    > +

    \
     
     \ /
      Last update: 2018-10-01 17:27    [W:4.461 / U:0.452 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site