Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-20 Thread Xiao Guangrong
On Nov 21, 2013, at 3:47 AM, Marcelo Tosatti wrote: > On Wed, Nov 20, 2013 at 10:20:09PM +0800, Xiao Guangrong wrote: >>> But what guarantee does userspace require, from GET_DIRTY_LOG, while vcpus >>> are >>> executing? >> >> Aha. Single calling GET_DIRTY_LOG is useless since new dirty page

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-20 Thread Marcelo Tosatti
On Wed, Nov 20, 2013 at 10:20:09PM +0800, Xiao Guangrong wrote: > > But what guarantee does userspace require, from GET_DIRTY_LOG, while vcpus > > are > > executing? > > Aha. Single calling GET_DIRTY_LOG is useless since new dirty page can be > generated > when GET_DIRTY_LOG is being returned.

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-20 Thread Xiao Guangrong
On Nov 20, 2013, at 8:29 AM, Marcelo Tosatti wrote: > On Wed, Aug 07, 2013 at 12:06:49PM +0800, Xiao Guangrong wrote: >> On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: >>> On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: Make sure we can see the writable spte before the dirt

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-20 Thread Xiao Guangrong
On Nov 20, 2013, at 8:29 AM, Marcelo Tosatti mtosa...@redhat.com wrote: On Wed, Aug 07, 2013 at 12:06:49PM +0800, Xiao Guangrong wrote: On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: Make sure we can see the writable spte before

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-20 Thread Marcelo Tosatti
On Wed, Nov 20, 2013 at 10:20:09PM +0800, Xiao Guangrong wrote: But what guarantee does userspace require, from GET_DIRTY_LOG, while vcpus are executing? Aha. Single calling GET_DIRTY_LOG is useless since new dirty page can be generated when GET_DIRTY_LOG is being returned. If user

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-20 Thread Xiao Guangrong
On Nov 21, 2013, at 3:47 AM, Marcelo Tosatti mtosa...@redhat.com wrote: On Wed, Nov 20, 2013 at 10:20:09PM +0800, Xiao Guangrong wrote: But what guarantee does userspace require, from GET_DIRTY_LOG, while vcpus are executing? Aha. Single calling GET_DIRTY_LOG is useless since new dirty

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-19 Thread Marcelo Tosatti
On Tue, Nov 19, 2013 at 10:29:20PM -0200, Marcelo Tosatti wrote: > A call to GET_DIRTY_LOG guarantees to return correct information about > dirty pages before invocation of the previous GET_DIRTY_LOG call. > Can you explain why it is OK to relax this rule? That is, this might be OK, but better

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-19 Thread Marcelo Tosatti
On Wed, Aug 07, 2013 at 12:06:49PM +0800, Xiao Guangrong wrote: > On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: > > On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: > >> Make sure we can see the writable spte before the dirt bitmap is visible > >> > >> We do this is for

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-19 Thread Marcelo Tosatti
On Wed, Aug 07, 2013 at 12:06:49PM +0800, Xiao Guangrong wrote: On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: Make sure we can see the writable spte before the dirt bitmap is visible We do this is for

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-11-19 Thread Marcelo Tosatti
On Tue, Nov 19, 2013 at 10:29:20PM -0200, Marcelo Tosatti wrote: A call to GET_DIRTY_LOG guarantees to return correct information about dirty pages before invocation of the previous GET_DIRTY_LOG call. Can you explain why it is OK to relax this rule? That is, this might be OK, but better

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-08-08 Thread Xiao Guangrong
[ Post again after adjusting the format since the mail list rejected to deliver my previous one. ] On Aug 8, 2013, at 11:06 PM, Marcelo Tosatti wrote: > On Wed, Aug 07, 2013 at 12:06:49PM +0800, Xiao Guangrong wrote: >> On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: >>> On Tue, Jul 30, 2013 at

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-08-08 Thread Marcelo Tosatti
On Wed, Aug 07, 2013 at 12:06:49PM +0800, Xiao Guangrong wrote: > On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: > > On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: > >> Make sure we can see the writable spte before the dirt bitmap is visible > >> > >> We do this is for

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-08-08 Thread Marcelo Tosatti
On Wed, Aug 07, 2013 at 12:06:49PM +0800, Xiao Guangrong wrote: On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: Make sure we can see the writable spte before the dirt bitmap is visible We do this is for

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-08-08 Thread Xiao Guangrong
[ Post again after adjusting the format since the mail list rejected to deliver my previous one. ] On Aug 8, 2013, at 11:06 PM, Marcelo Tosatti mtosa...@redhat.com wrote: On Wed, Aug 07, 2013 at 12:06:49PM +0800, Xiao Guangrong wrote: On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: On Tue,

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-08-06 Thread Xiao Guangrong
On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: > On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: >> Make sure we can see the writable spte before the dirt bitmap is visible >> >> We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based >> on the dirty bitmap, we

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-08-06 Thread Marcelo Tosatti
On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: > Make sure we can see the writable spte before the dirt bitmap is visible > > We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based > on the dirty bitmap, we should ensure the writable spte can be found in

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-08-06 Thread Marcelo Tosatti
On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: Make sure we can see the writable spte before the dirt bitmap is visible We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based on the dirty bitmap, we should ensure the writable spte can be found in rmap

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-08-06 Thread Xiao Guangrong
On 08/07/2013 09:48 AM, Marcelo Tosatti wrote: On Tue, Jul 30, 2013 at 09:02:02PM +0800, Xiao Guangrong wrote: Make sure we can see the writable spte before the dirt bitmap is visible We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based on the dirty bitmap, we should

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-07-31 Thread Xiao Guangrong
On 07/30/2013 09:26 PM, Paolo Bonzini wrote: > Il 30/07/2013 15:02, Xiao Guangrong ha scritto: >> Make sure we can see the writable spte before the dirt bitmap is visible >> >> We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based >> on the dirty bitmap, we should ensure the

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-07-31 Thread Xiao Guangrong
On 07/30/2013 09:26 PM, Paolo Bonzini wrote: Il 30/07/2013 15:02, Xiao Guangrong ha scritto: Make sure we can see the writable spte before the dirt bitmap is visible We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based on the dirty bitmap, we should ensure the writable

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-07-30 Thread Paolo Bonzini
Il 30/07/2013 15:02, Xiao Guangrong ha scritto: > Make sure we can see the writable spte before the dirt bitmap is visible > > We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based > on the dirty bitmap, we should ensure the writable spte can be found in rmap > before the

[PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-07-30 Thread Xiao Guangrong
Make sure we can see the writable spte before the dirt bitmap is visible We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based on the dirty bitmap, we should ensure the writable spte can be found in rmap before the dirty bitmap is visible. Otherwise, we cleared the dirty

[PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-07-30 Thread Xiao Guangrong
Make sure we can see the writable spte before the dirt bitmap is visible We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based on the dirty bitmap, we should ensure the writable spte can be found in rmap before the dirty bitmap is visible. Otherwise, we cleared the dirty

Re: [PATCH 04/12] KVM: MMU: log dirty page after marking spte writable

2013-07-30 Thread Paolo Bonzini
Il 30/07/2013 15:02, Xiao Guangrong ha scritto: Make sure we can see the writable spte before the dirt bitmap is visible We do this is for kvm_vm_ioctl_get_dirty_log() write-protects the spte based on the dirty bitmap, we should ensure the writable spte can be found in rmap before the dirty