From patchwork Tue Jan 5 14:12:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 71033 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o05EHlcG012069 for ; Tue, 5 Jan 2010 14:17:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754570Ab0AEONf (ORCPT ); Tue, 5 Jan 2010 09:13:35 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754551Ab0AEONb (ORCPT ); Tue, 5 Jan 2010 09:13:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32010 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754550Ab0AEON3 (ORCPT ); Tue, 5 Jan 2010 09:13:29 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o05ECwEM006308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 5 Jan 2010 09:12:58 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o05ECv9b006720; Tue, 5 Jan 2010 09:12:58 -0500 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id 284A01336D4; Tue, 5 Jan 2010 16:12:55 +0200 (IST) 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 Subject: [PATCH v3 07/12] Maintain memslot version number Date: Tue, 5 Jan 2010 16:12:49 +0200 Message-Id: <1262700774-1808-8-git-send-email-gleb@redhat.com> In-Reply-To: <1262700774-1808-1-git-send-email-gleb@redhat.com> References: <1262700774-1808-1-git-send-email-gleb@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 600baf0..3f5ebc2 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -163,6 +163,7 @@ struct kvm { 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 a5077df..df3325c 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -737,6 +737,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);