summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>2010-06-23 07:59:29 +0200
committerAvi Kivity <avi@redhat.com>2010-08-01 09:47:15 +0200
commit4482b06c0459469c101a1da3f4b24594da557f99 (patch)
tree55da76c52f91676943219722d3f09f61aa8d7012
parentKVM: PPC: Make BAT only guest segments work (diff)
downloadlinux-4482b06c0459469c101a1da3f4b24594da557f99.tar.xz
linux-4482b06c0459469c101a1da3f4b24594da557f99.zip
KVM: ia64: fix dirty_log_lock spin_lock section not to include get_dirty_log()
kvm_get_dirty_log() calls copy_to_user(). So we need to narrow the dirty_log_lock spin_lock section not to include this. Signed-off-by: Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp> Signed-off-by: Avi Kivity <avi@redhat.com>
-rw-r--r--arch/ia64/kvm/kvm-ia64.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index bd510beb43af..d85b5d2d52d1 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -1817,10 +1817,12 @@ static int kvm_ia64_sync_dirty_log(struct kvm *kvm,
n = kvm_dirty_bitmap_bytes(memslot);
base = memslot->base_gfn / BITS_PER_LONG;
+ spin_lock(&kvm->arch.dirty_log_lock);
for (i = 0; i < n/sizeof(long); ++i) {
memslot->dirty_bitmap[i] = dirty_bitmap[base + i];
dirty_bitmap[base + i] = 0;
}
+ spin_unlock(&kvm->arch.dirty_log_lock);
r = 0;
out:
return r;
@@ -1835,7 +1837,6 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
int is_dirty = 0;
mutex_lock(&kvm->slots_lock);
- spin_lock(&kvm->arch.dirty_log_lock);
r = kvm_ia64_sync_dirty_log(kvm, log);
if (r)
@@ -1855,7 +1856,6 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm,
r = 0;
out:
mutex_unlock(&kvm->slots_lock);
- spin_unlock(&kvm->arch.dirty_log_lock);
return r;
}