From patchwork Tue Feb 26 22:21:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Mackerras X-Patchwork-Id: 1048584 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=kvm-ppc-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ozlabs.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="dEsxM1sT"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 448Cy35r2tz9s7T for ; Wed, 27 Feb 2019 09:23:23 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729129AbfBZWXW (ORCPT ); Tue, 26 Feb 2019 17:23:22 -0500 Received: from ozlabs.org ([203.11.71.1]:55869 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729030AbfBZWXW (ORCPT ); Tue, 26 Feb 2019 17:23:22 -0500 Received: by ozlabs.org (Postfix, from userid 1003) id 448Cy00tV5z9s7T; Wed, 27 Feb 2019 09:23:19 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1551219800; bh=1z5BkuyLmhCXAyZkpQABOgmNlHdnLQFxvBIbmrNeO1M=; h=Date:From:To:Cc:Subject:From; b=dEsxM1sTt3QPt53XUZnyNlud7n+Si1+Il9O/ytbmBzDr1LpOxSSVYuGfw3F0iBSfh OgAgf6UQTkslXTpVK4Wn+CX28g2NhLzFGBcQHy9dUkB6zIkdG4RBFbPObtCom49EtR fS5q+CcAzbHbrWLnOBV0Qd/ZTewnr8gKPPLHO4fpigpGbUG7hNj/+lDRCRxyfEdDCC HNcVUH3GZK89qVzgufw3eCAGsxPpLvUSq3K9TIoX77Xapbx5vYVU1TgqiI5H+81+w2 4MjaE2I3Ch9qLABvLvz8a/Wf1u5yCQRGRxKjOq09T2YhicQHHxryfRr0k+Ftp8O9HG dCJe9M6eLw/IQ== Date: Wed, 27 Feb 2019 09:21:56 +1100 From: Paul Mackerras To: kvm@vger.kernel.org, kvm-ppc@vger.kernel.org Cc: linuxppc-dev@ozlabs.org Subject: [PATCH] KVM: PPC: Fix compilation when KVM is not enabled Message-ID: <20190226222156.GD28015@blackberry> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: kvm-ppc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm-ppc@vger.kernel.org Compiling with CONFIG_PPC_POWERNV=y and KVM disabled currently gives an error like this: CC arch/powerpc/kernel/dbell.o In file included from arch/powerpc/kernel/dbell.c:20:0: arch/powerpc/include/asm/kvm_ppc.h: In function ‘xics_on_xive’: arch/powerpc/include/asm/kvm_ppc.h:625:9: error: implicit declaration of function ‘xive_enabled’ [-Werror=implicit-function-declaration] return xive_enabled() && cpu_has_feature(CPU_FTR_HVMODE); ^ cc1: all warnings being treated as errors scripts/Makefile.build:276: recipe for target 'arch/powerpc/kernel/dbell.o' failed make[3]: *** [arch/powerpc/kernel/dbell.o] Error 1 Fix this by making the xics_on_xive() definition conditional on the same symbol (CONFIG_KVM_BOOK3S_64_HANDLER) that determines whether we include or not, since that's the header that defines xive_enabled(). Fixes: 03f953329bd8 ("KVM: PPC: Book3S: Allow XICS emulation to work in nested hosts using XIVE") Signed-off-by: Paul Mackerras --- arch/powerpc/include/asm/kvm_ppc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/kvm_ppc.h b/arch/powerpc/include/asm/kvm_ppc.h index d283d31..ac22b28 100644 --- a/arch/powerpc/include/asm/kvm_ppc.h +++ b/arch/powerpc/include/asm/kvm_ppc.h @@ -619,7 +619,7 @@ static inline int kvmppc_xive_set_irq(struct kvm *kvm, int irq_source_id, u32 ir static inline void kvmppc_xive_push_vcpu(struct kvm_vcpu *vcpu) { } #endif /* CONFIG_KVM_XIVE */ -#ifdef CONFIG_PPC_POWERNV +#if defined(CONFIG_PPC_POWERNV) && defined(CONFIG_KVM_BOOK3S_64_HANDLER) static inline bool xics_on_xive(void) { return xive_enabled() && cpu_has_feature(CPU_FTR_HVMODE);