From: Avi Kivity <avi@redhat.com>
To: kvm-ia64@vger.kernel.org
Subject: Re: [PATCH v2 3/4] KVM: cleanup: remove kvm_get_dirty_log()
Date: Wed, 23 Jun 2010 08:48:29 +0000 [thread overview]
Message-ID: <4C21CA5D.4060800@redhat.com> (raw)
In-Reply-To: <20100623150134.9fb5915b.yoshikawa.takuya@oss.ntt.co.jp>
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
next prev parent reply other threads:[~2010-06-23 8:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-23 6:01 [PATCH v2 3/4] KVM: cleanup: remove kvm_get_dirty_log() Takuya Yoshikawa
2010-06-23 8:48 ` Avi Kivity [this message]
2010-06-23 8:56 ` Takuya Yoshikawa
2010-06-23 9:00 ` Avi Kivity
2010-06-24 0:58 ` Marcelo Tosatti
2010-06-24 8:10 ` Avi Kivity
2010-06-25 19:25 ` Alexander Graf
2010-06-26 0:38 ` Takuya Yoshikawa
2010-06-26 0:55 ` Takuya Yoshikawa
2010-06-26 9:38 ` Alexander Graf
2010-06-27 7:32 ` Avi Kivity
2010-06-28 8:14 ` Takuya Yoshikawa
2010-06-28 9:36 ` Avi Kivity
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=4C21CA5D.4060800@redhat.com \
--to=avi@redhat.com \
--cc=kvm-ia64@vger.kernel.org \
/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