From patchwork Wed Jun 23 05:59:29 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takuya Yoshikawa X-Patchwork-Id: 107548 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o5N5wpM7016533 for ; Wed, 23 Jun 2010 05:58:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751261Ab0FWF6t (ORCPT ); Wed, 23 Jun 2010 01:58:49 -0400 Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:56407 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750873Ab0FWF6s (ORCPT ); Wed, 23 Jun 2010 01:58:48 -0400 Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id AECC1248389; Wed, 23 Jun 2010 14:58:47 +0900 (JST) Received: from serv1.oss.ntt.co.jp (serv1.oss.ntt.co.jp [172.19.0.2]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 9E46D248306; Wed, 23 Jun 2010 14:58:47 +0900 (JST) Received: from yshtky3.kern.oss.ntt.co.jp (unknown [172.17.1.115]) by serv1.oss.ntt.co.jp (Postfix) with SMTP id 78D9513C300; Wed, 23 Jun 2010 14:58:47 +0900 (JST) Date: Wed, 23 Jun 2010 14:59:29 +0900 From: Takuya Yoshikawa To: avi@redhat.com, mtosatti@redhat.com, agraf@suse.de Cc: kvm@vger.kernel.org, kvm-ia64@vger.kernel.org, kvm-ppc@vger.kernel.org, takuya.yoshikawa@gmail.com Subject: [PATCH v2 1/4] KVM: ia64: fix dirty_log_lock spin_lock section not to include get_dirty_log() Message-Id: <20100623145929.0d1b8b97.yoshikawa.takuya@oss.ntt.co.jp> In-Reply-To: <20100623145807.07a07c4c.yoshikawa.takuya@oss.ntt.co.jp> References: <20100623145807.07a07c4c.yoshikawa.takuya@oss.ntt.co.jp> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 23 Jun 2010 05:58:51 +0000 (UTC) diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c index bd510be..d85b5d2 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; }