From patchwork Tue Jul 6 16:24:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 110451 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 o66GUNCM018060 for ; Tue, 6 Jul 2010 16:32:42 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755404Ab0GFQZf (ORCPT ); Tue, 6 Jul 2010 12:25:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11138 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753550Ab0GFQZe (ORCPT ); Tue, 6 Jul 2010 12:25:34 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o66GP4Hk017334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 6 Jul 2010 12:25:04 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o66GP39l032389; Tue, 6 Jul 2010 12:25:03 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id BA464134412; Tue, 6 Jul 2010 19:25:00 +0300 (IDT) From: Gleb Natapov To: kvm@vger.kernel.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, avi@redhat.com, mingo@elte.hu, a.p.zijlstra@chello.nl, tglx@linutronix.de, hpa@zytor.com, riel@redhat.com, cl@linux-foundation.org, mtosatti@redhat.com Subject: [PATCH v4 07/12] Maintain memslot version number Date: Tue, 6 Jul 2010 19:24:55 +0300 Message-Id: <1278433500-29884-8-git-send-email-gleb@redhat.com> In-Reply-To: <1278433500-29884-1-git-send-email-gleb@redhat.com> References: <1278433500-29884-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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]); Tue, 06 Jul 2010 16:32:42 +0000 (UTC) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index e796326..64f62f1 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -177,6 +177,7 @@ struct kvm { raw_spinlock_t requests_lock; struct mutex slots_lock; struct mm_struct *mm; /* userspace tied to this vm */ + u32 memslot_version; struct kvm_memslots *memslots; struct srcu_struct srcu; #ifdef CONFIG_KVM_APIC_ARCHITECTURE diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a60b6b0..733558c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -730,6 +730,7 @@ skip_lpage: slots->memslots[mem->slot] = new; old_memslots = kvm->memslots; rcu_assign_pointer(kvm->memslots, slots); + kvm->memslot_version++; synchronize_srcu_expedited(&kvm->srcu); kvm_arch_commit_memory_region(kvm, mem, old, user_alloc);