From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 2/3] update kvm related the head file from kernel Date: Fri, 07 Sep 2012 12:17:09 +0200 Message-ID: <5049C9A5.2060909@siemens.com> References: <1347006389-543-1-git-send-email-liusheng@linux.vnet.ibm.com> <1347006389-543-3-git-send-email-liusheng@linux.vnet.ibm.com> <5049B523.8090303@siemens.com> <5049C0C8.3060106@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Liu Sheng , "kvm@vger.kernel.org" , "avi@redhat.com" , "mtosatti@redhat.com" , "qemu-devel@nongnu.org" , "aliguori@us.ibm.com" To: Xiao Guangrong Return-path: Received: from thoth.sbs.de ([192.35.17.2]:24841 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932235Ab2IGKRX (ORCPT ); Fri, 7 Sep 2012 06:17:23 -0400 In-Reply-To: <5049C0C8.3060106@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On 2012-09-07 11:39, Xiao Guangrong wrote: > Hi Jan, > > Thanks for your review. > > On 09/07/2012 04:49 PM, Jan Kiszka wrote: > >>> +#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 >> >> Sorry for commenting on the wrong patch, this must be fixed in the >> kernel: no more conditional CAPs, please. > > There are some common code depend on KVM_CAP_READONLY_MEM, such as, Let is depend on KVM_HAVE or some CONFIG_xxx, not on something that is going to be exported as userspace API. Jan > check_memory_region_flags() and write_readonly_mem field in mmio-exit-info. > > Yes, we can use #ifdef CONFIG_X86 to enable it only on x86, but it > is hard to expand this feather to other arches in the further. > > So, i used __KVM_HAVE_READONLY_MEM and only defined it on x86. :) > -- Siemens AG, Corporate Technology, CT RTC ITP SDP-DE Corporate Competence Center Embedded Linux