Re: [PATCH v2 2/6] KVM: MMU: don't drop spte if overwrite it from W to RO

2010-11-18 Thread Marcelo Tosatti
On Thu, Nov 18, 2010 at 03:12:56PM +0800, Xiao Guangrong wrote: On 11/17/2010 11:57 PM, Avi Kivity wrote: set_pte: update_spte(sptep, spte); +/* + * If we overwrite a writable spte with a read-only one we + * should flush remote TLBs. Otherwise rmap_write_protect

Re: [PATCH v2 2/6] KVM: MMU: don't drop spte if overwrite it from W to RO

2010-11-18 Thread Avi Kivity
On 11/18/2010 05:32 PM, Marcelo Tosatti wrote: There is no need to flush on sync_page path since the guest is responsible for it. If we don't, the next rmap_write_protect() will incorrectly decide that there's no need to flush tlbs. Maybe it's not a problem if guest

Re: [PATCH v2 2/6] KVM: MMU: don't drop spte if overwrite it from W to RO

2010-11-17 Thread Marcelo Tosatti
On Wed, Nov 17, 2010 at 12:10:50PM +0800, Xiao Guangrong wrote: We just need flush tlb if overwrite a writable spte with a read-only one. And we should move this operation to set_spte() for sync_page path Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c

Re: [PATCH v2 2/6] KVM: MMU: don't drop spte if overwrite it from W to RO

2010-11-17 Thread Avi Kivity
On 11/17/2010 05:42 PM, Marcelo Tosatti wrote: On Wed, Nov 17, 2010 at 12:10:50PM +0800, Xiao Guangrong wrote: We just need flush tlb if overwrite a writable spte with a read-only one. And we should move this operation to set_spte() for sync_page path Signed-off-by: Xiao

Re: [PATCH v2 2/6] KVM: MMU: don't drop spte if overwrite it from W to RO

2010-11-17 Thread Xiao Guangrong
On 11/17/2010 11:57 PM, Avi Kivity wrote: set_pte: update_spte(sptep, spte); +/* + * If we overwrite a writable spte with a read-only one we + * should flush remote TLBs. Otherwise rmap_write_protect + * will find a read-only spte, even though the writable spte +

[PATCH v2 2/6] KVM: MMU: don't drop spte if overwrite it from W to RO

2010-11-16 Thread Xiao Guangrong
We just need flush tlb if overwrite a writable spte with a read-only one. And we should move this operation to set_spte() for sync_page path Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 20 +--- 1 files changed, 9 insertions(+), 11