From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH v2 3/4] KVM: cleanup: remove kvm_get_dirty_log() Date: Wed, 23 Jun 2010 11:48:29 +0300 Message-ID: <4C21CA5D.4060800@redhat.com> References: <20100623145807.07a07c4c.yoshikawa.takuya@oss.ntt.co.jp> <20100623150134.9fb5915b.yoshikawa.takuya@oss.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, agraf-l3A5Bk7waGM@public.gmane.org, kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kvm-ia64-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kvm-ppc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, takuya.yoshikawa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org To: Takuya Yoshikawa Return-path: In-Reply-To: <20100623150134.9fb5915b.yoshikawa.takuya-gVGce1chcLdL9jVzuh4AOg@public.gmane.org> Sender: kvm-ppc-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: kvm.vger.kernel.org On 06/23/2010 09:01 AM, Takuya Yoshikawa wrote: > kvm_get_dirty_log() is a helper function for kvm_vm_ioctl_get_dirty_log() which > is currently used by ia64 and ppc and the following is what it is doing: > > - sanity checks > - bitmap scan to check if the slot is dirty > - copy_to_user() > > Considering the fact that x86 is not using this anymore and sanity checks must > be done before kvm_ia64_sync_dirty_log(), we can say that this is not working > for code sharing effectively. So we just remove this. > > > diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c > index 801d9f3..bea6f7c 100644 > --- a/arch/powerpc/kvm/book3s.c > +++ b/arch/powerpc/kvm/book3s.c > @@ -1185,28 +1185,43 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, > struct kvm_memory_slot *memslot; > struct kvm_vcpu *vcpu; > ulong ga, ga_end; > - int is_dirty = 0; > - int r; > + unsigned long is_dirty = 0; > + int r, i; > unsigned long n; > > mutex_lock(&kvm->slots_lock); > > - r = kvm_get_dirty_log(kvm, log,&is_dirty); > - if (r) > + r = -EINVAL; > + if (log->slot>= KVM_MEMORY_SLOTS) > + goto out; > + > + memslot =&kvm->memslots->memslots[log->slot]; > Not introduced by this patch, but shouldn't this use rcu_dereference()? -- error compiling committee.c: too many arguments to function