Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-12-01 Thread Marcelo Tosatti
On Wed, Dec 01, 2010 at 10:20:38AM +0800, Xiao Guangrong wrote: On 12/01/2010 03:20 AM, Gleb Natapov wrote: Firs of all if guest is PV the guest process cannot be killed. Second why is it a problem that we marked pfn as accessed on speculative path? What problem it causes especially since

[PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Xiao Guangrong
Retry #PF is the speculative path, so don't set the accessed bit, especially, stop prefault if shadow_accessed_mask = 0 Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 12 +++- arch/x86/kvm/x86.c

Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Gleb Natapov
On Tue, Nov 30, 2010 at 05:36:07PM +0800, Xiao Guangrong wrote: Retry #PF is the speculative path, so don't set the accessed bit, especially, stop prefault if shadow_accessed_mask = 0 Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |1 +

Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Xiao Guangrong
On 11/30/2010 09:29 PM, Gleb Natapov wrote: +if (!shadow_accessed_mask) +return; + I don't get this. As far as I can see VMX inits shadow_accessed_mask to be zero if ept is enabled. This line here means that we never prefault with ept enabled. It is opposite from what it

Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Gleb Natapov
On Wed, Dec 01, 2010 at 12:52:22AM +0800, Xiao Guangrong wrote: On 11/30/2010 09:29 PM, Gleb Natapov wrote: + if (!shadow_accessed_mask) + return; + I don't get this. As far as I can see VMX inits shadow_accessed_mask to be zero if ept is enabled. This line here means that

Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Xiao Guangrong
On 12/01/2010 01:50 AM, Gleb Natapov wrote: On Wed, Dec 01, 2010 at 12:52:22AM +0800, Xiao Guangrong wrote: On 11/30/2010 09:29 PM, Gleb Natapov wrote: + if (!shadow_accessed_mask) + return; + I don't get this. As far as I can see VMX inits shadow_accessed_mask to be zero if ept

Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Gleb Natapov
On Wed, Dec 01, 2010 at 02:15:29AM +0800, Xiao Guangrong wrote: On 12/01/2010 01:50 AM, Gleb Natapov wrote: On Wed, Dec 01, 2010 at 12:52:22AM +0800, Xiao Guangrong wrote: On 11/30/2010 09:29 PM, Gleb Natapov wrote: +if (!shadow_accessed_mask) +return; + I

Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Xiao Guangrong
On 12/01/2010 02:38 AM, Gleb Natapov wrote: It can't avoid the page to be evicted again since the page is marked accessed only when spte is droped or updated. I still do not understand why are you disabling prefault for ept. Why do you want to distinguish between actually accessed

Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Gleb Natapov
On Wed, Dec 01, 2010 at 03:11:11AM +0800, Xiao Guangrong wrote: On 12/01/2010 02:38 AM, Gleb Natapov wrote: It can't avoid the page to be evicted again since the page is marked accessed only when spte is droped or updated. I still do not understand why are you disabling prefault for

Re: [PATCH v3 2/3] KVM: MMU: fix accessed bit set on prefault path

2010-11-30 Thread Xiao Guangrong
On 12/01/2010 03:20 AM, Gleb Natapov wrote: Firs of all if guest is PV the guest process cannot be killed. Second why is it a problem that we marked pfn as accessed on speculative path? What problem it causes especially since it is very likely that the page will be accessed shortly anyway?