From patchwork Fri Sep 7 08:26:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Sheng X-Patchwork-Id: 182341 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id E96022C0082 for ; Fri, 7 Sep 2012 18:27:18 +1000 (EST) Received: from localhost ([::1]:54568 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9tuG-0000vF-Vc for incoming@patchwork.ozlabs.org; Fri, 07 Sep 2012 04:27:16 -0400 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 d23relay04.au.ibm.com (202.81.31.246) by e23smtp05.au.ibm.com (202.81.31.211) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 7 Sep 2012 18:25:42 +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 Received: from localhost ([9.123.236.160]) by d23av04.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q878QYAg017046; Fri, 7 Sep 2012 18:26:35 +1000 From: Liu Sheng To: kvm@vger.kernel.org Date: Fri, 7 Sep 2012 16:26:28 +0800 Message-Id: <1347006389-543-3-git-send-email-liusheng@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.5.4 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> x-cbid: 12090708-1396-0000-0000-000001D68F3D X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 202.81.31.147 Cc: aliguori@us.ibm.com, mtosatti@redhat.com, qemu-devel@nongnu.org, xiaoguangrong@linux.vnet.ibm.com, avi@redhat.com, Liu Sheng Subject: [Qemu-devel] [PATCH 2/3] update kvm related the head file from kernel X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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