diff mbox

[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 (mailing list archive)
State New, archived
Headers show

Commit Message

Takuya Yoshikawa April 9, 2010, 9:35 a.m. UTC
None
diff mbox

Patch

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 <asm/mtrr.h>
 #include <asm/msr-index.h>
 
+/* Select x86 specific features in <linux/kvm_host.h> */
+#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;