lkml.org 
[lkml]   [2010]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/2] KVM MMU: fix race in invlpg code


    Avi Kivity wrote:

    >> spin_lock(&vcpu->kvm->mmu_lock);
    >> + index = kvm_page_table_hashfn(gfn);
    >> + bucket =&vcpu->kvm->arch.mmu_page_hash[index];
    >> + hlist_for_each_entry_safe(s, node, tmp, bucket, hash_link)
    >> + if (s == sp) {
    >> + if (s->gfn == gfn&& s->role.word == role.word)
    >> + live = true;
    >> + break;
    >> + }
    >> +
    >> + if (!live)
    >> + goto unlock_exit;
    >> +
    >>
    >
    > Did you try the root_count method? I think it's cleaner.

    Avi, Thanks for your idea.

    I have considered this method, but i'm not sure when it's the good time
    to real free this page, and i think we also need a way to synchronize the
    real free path and this path. Do you have any comment for it :-(

    Xiao


    \
     
     \ /
      Last update: 2010-05-05 14:51    [W:0.029 / U:0.124 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site