From patchwork Fri Mar 22 03:35:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Rothwell X-Patchwork-Id: 229878 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [IPv6:::1]) by ozlabs.org (Postfix) with ESMTP id CD9BE2C0152 for ; Fri, 22 Mar 2013 14:36:26 +1100 (EST) Received: from members.tip.net.au (haggis.pcug.org.au [203.10.76.10]) by ozlabs.org (Postfix) with ESMTP id 6E3E92C0095 for ; Fri, 22 Mar 2013 14:35:57 +1100 (EST) Received: from canb.auug.org.au (ibmaus65.lnk.telstra.net [165.228.126.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by members.tip.net.au (Postfix) with ESMTPSA id C8D27164109; Fri, 22 Mar 2013 14:35:51 +1100 (EST) Date: Fri, 22 Mar 2013 14:35:50 +1100 From: Stephen Rothwell To: Kevin Hilman Subject: [PATCH] KVM: fix powerpc build error for !CONFIG_KVM Message-Id: <20130322143550.c7ebe79c9fd97ec7a385ea16@canb.auug.org.au> X-Mailer: Sylpheed 3.3.0 (GTK+ 2.24.10; i486-pc-linux-gnu) Mime-Version: 1.0 Cc: Phil Carmody , Gleb Natapov , Marcelo Tosatti , LKML , linux-next@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Fixes these build error when CONFIG_KVM is not defined: In file included from arch/powerpc/include/asm/kvm_ppc.h:33:0, from arch/powerpc/kernel/setup_64.c:67: arch/powerpc/include/asm/kvm_book3s.h:65:20: error: field 'pte' has incomplete type arch/powerpc/include/asm/kvm_book3s.h:69:18: error: field 'vcpu' has incomplete type arch/powerpc/include/asm/kvm_book3s.h:98:34: error: 'HPTEG_HASH_NUM_PTE' undeclared here (not in a function) arch/powerpc/include/asm/kvm_book3s.h:99:39: error: 'HPTEG_HASH_NUM_PTE_LONG' undeclared here (not in a function) arch/powerpc/include/asm/kvm_book3s.h:100:35: error: 'HPTEG_HASH_NUM_VPTE' undeclared here (not in a function) arch/powerpc/include/asm/kvm_book3s.h:101:40: error: 'HPTEG_HASH_NUM_VPTE_LONG' undeclared here (not in a function) arch/powerpc/include/asm/kvm_book3s.h:129:4: error: 'struct kvm_run' declared inside parameter list [-Werror] arch/powerpc/include/asm/kvm_book3s.h:129:4: error: its scope is only this definition or declaration, which is probably not what you want [-Werror] ... and so on ... This was introduced by commit f445f11eb2cc265dd47da5b2e864df46cd6e5a82 "KVM: allow host header to be included even for !CONFIG_KVM" Cc: Kevin Hilman Cc: Marcelo Tosatti Signed-off-by: Stephen Rothwell --- include/linux/kvm_host.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) Kevin, does this still fix the error that commit f445f11eb2cc265dd47da5b2e864df46cd6e5a82 was fixing? diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a942863..90ebec0 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -1,8 +1,6 @@ #ifndef __KVM_HOST_H #define __KVM_HOST_H -#if IS_ENABLED(CONFIG_KVM) - /* * This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. @@ -751,6 +749,7 @@ static inline int kvm_deassign_device(struct kvm *kvm, } #endif /* CONFIG_IOMMU_API */ +#if IS_ENABLED(CONFIG_KVM) static inline void __guest_enter(void) { /* @@ -770,6 +769,10 @@ static inline void __guest_exit(void) vtime_account_system(current); current->flags &= ~PF_VCPU; } +#else +static inline void __guest_enter(void) { return; } +static inline void __guest_exit(void) { return; } +#endif /* IS_ENABLED(CONFIG_KVM) */ #ifdef CONFIG_CONTEXT_TRACKING extern void guest_enter(void); @@ -1057,8 +1060,4 @@ static inline bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu) } #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ -#else -static inline void __guest_enter(void) { return; } -static inline void __guest_exit(void) { return; } -#endif /* IS_ENABLED(CONFIG_KVM) */ #endif