From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9ttt-0000Dj-Uk for qemu-devel@nongnu.org; Fri, 07 Sep 2012 04:26:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9ttk-0006Gb-Ee for qemu-devel@nongnu.org; Fri, 07 Sep 2012 04:26:53 -0400 Received: from e23smtp05.au.ibm.com ([202.81.31.147]:46225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9ttj-0006GB-NA for qemu-devel@nongnu.org; Fri, 07 Sep 2012 04:26:44 -0400 Received: from /spool/local by e23smtp05.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 7 Sep 2012 18:25:45 +1000 Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q878HY8512517386 for ; Fri, 7 Sep 2012 18:17:35 +1000 Received: from d23av04.au.ibm.com (loopback [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q878QZmG017108 for ; Fri, 7 Sep 2012 18:26:35 +1000 From: Liu Sheng Date: Fri, 7 Sep 2012 16:26:28 +0800 Message-Id: <1347006389-543-3-git-send-email-liusheng@linux.vnet.ibm.com> In-Reply-To: <1347006389-543-1-git-send-email-liusheng@linux.vnet.ibm.com> References: <1347006389-543-1-git-send-email-liusheng@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 2/3] update kvm related the head file from kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org Cc: aliguori@us.ibm.com, mtosatti@redhat.com, qemu-devel@nongnu.org, xiaoguangrong@linux.vnet.ibm.com, avi@redhat.com, Liu Sheng updated the head file from kernel for readonly memory feature. Signed-off-by: Liu Sheng --- linux-headers/asm-x86/kvm.h | 1 + linux-headers/linux/kvm.h | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/linux-headers/asm-x86/kvm.h b/linux-headers/asm-x86/kvm.h index 246617e..521bf25 100644 --- a/linux-headers/asm-x86/kvm.h +++ b/linux-headers/asm-x86/kvm.h @@ -25,6 +25,7 @@ #define __KVM_HAVE_DEBUGREGS #define __KVM_HAVE_XSAVE #define __KVM_HAVE_XCRS +#define __KVM_HAVE_READONLY_MEM /* Architectural interrupt line count. */ #define KVM_NR_INTERRUPTS 256 diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index 4b9e575..02fae9e 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -101,9 +101,13 @@ struct kvm_userspace_memory_region { __u64 userspace_addr; /* start of the userspace allocated memory */ }; -/* for kvm_memory_region::flags */ -#define KVM_MEM_LOG_DIRTY_PAGES 1UL -#define KVM_MEMSLOT_INVALID (1UL << 1) +/* + * The bit 0 ~ bit 15 of kvm_memory_region::flags are visible for userspace, + * other bits are reserved for kvm internal use which are defined in + * include/linux/kvm_host.h. + */ +#define KVM_MEM_LOG_DIRTY_PAGES (1UL << 0) +#define KVM_MEM_READONLY (1UL << 1) /* for KVM_IRQ_LINE */ struct kvm_irq_level { @@ -222,6 +226,9 @@ struct kvm_run { __u8 data[8]; __u32 len; __u8 is_write; +#ifdef __KVM_HAVE_READONLY_MEM + __u8 write_readonly_mem; +#endif } mmio; /* KVM_EXIT_HYPERCALL */ struct { @@ -618,6 +625,9 @@ struct kvm_ppc_smmu_info { #define KVM_CAP_PPC_GET_SMMU_INFO 78 #define KVM_CAP_S390_COW 79 #define KVM_CAP_PPC_ALLOC_HTAB 80 +#ifdef __KVM_HAVE_READONLY_MEM +#define KVM_CAP_READONLY_MEM 81 +#endif #ifdef KVM_CAP_IRQ_ROUTING -- 1.7.7.6