public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Avi Kivity <avi@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	KVM list <kvm@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] KVM MMU: fix race in invlpg code
Date: Wed, 05 May 2010 20:45:33 +0800	[thread overview]
Message-ID: <4BE1686D.9000902@cn.fujitsu.com> (raw)
In-Reply-To: <4BE1650B.7080809@redhat.com>



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

  reply	other threads:[~2010-05-05 12:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05 12:19 [PATCH 1/2] KVM MMU: fix for forgot mark parent->unsync_children bit Xiao Guangrong
2010-05-05 12:21 ` [PATCH 2/2] KVM MMU: fix race in invlpg code Xiao Guangrong
2010-05-05 12:31   ` Avi Kivity
2010-05-05 12:45     ` Xiao Guangrong [this message]
2010-05-05 12:52       ` Avi Kivity
2010-05-05 12:30 ` [PATCH 1/2] KVM MMU: fix for forgot mark parent->unsync_children bit Avi Kivity
2010-05-05 12:35   ` Xiao Guangrong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BE1686D.9000902@cn.fujitsu.com \
    --to=xiaoguangrong@cn.fujitsu.com \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox