From patchwork Fri Apr 9 09:35:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takuya Yoshikawa X-Patchwork-Id: 91671 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o399WP4v014432 for ; Fri, 9 Apr 2010 09:32:25 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754074Ab0DIJcX (ORCPT ); Fri, 9 Apr 2010 05:32:23 -0400 Received: from serv2.oss.ntt.co.jp ([222.151.198.100]:44186 "EHLO serv2.oss.ntt.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751958Ab0DIJcW (ORCPT ); Fri, 9 Apr 2010 05:32:22 -0400 Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id DEF21248272; Fri, 9 Apr 2010 18:32:21 +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 CDF2D248243; Fri, 9 Apr 2010 18:32:21 +0900 (JST) Received: from yshtky3.kern.oss.ntt.co.jp (unknown [172.17.1.110]) by serv1.oss.ntt.co.jp (Postfix) with SMTP id A96D311C111; Fri, 9 Apr 2010 18:32:21 +0900 (JST) Date: Fri, 9 Apr 2010 18:35:55 +0900 From: Takuya Yoshikawa To: avi@redhat.com, mtosatti@redhat.com Cc: kvm@vger.kernel.org, fernando@oss.ntt.co.jp Subject: [PATCH RFC 4/5] KVM: add new members to the memory slot for double buffering of bitmaps Message-Id: <20100409183555.18a64dc7.yoshikawa.takuya@oss.ntt.co.jp> In-Reply-To: <20100409182732.857de4db.yoshikawa.takuya@oss.ntt.co.jp> References: <20100409182732.857de4db.yoshikawa.takuya@oss.ntt.co.jp> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.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]); Fri, 09 Apr 2010 09:32:25 +0000 (UTC) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index 0c49c88..b502bca 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h @@ -25,6 +25,9 @@ #include #include +/* Select x86 specific features in */ +#define __KVM_HAVE_USER_DIRTYBITMAP + #define KVM_MAX_VCPUS 64 #define KVM_MEMORY_SLOTS 32 /* memory slots that does not exposed to userspace */ diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index dd6bcf4..07092d6 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -110,7 +110,13 @@ struct kvm_memory_slot { unsigned long npages; unsigned long flags; unsigned long *rmap; +#ifndef __KVM_HAVE_USER_DIRTYBITMAP unsigned long *dirty_bitmap; +#else + unsigned long __user *dirty_bitmap; + unsigned long __user *dirty_bitmap_old; + bool is_dirty; +#endif struct { unsigned long rmap_pde; int write_count;