From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: Re: [PATCH] [fix] kernel does not compile without CONFIG_KVM_ARM_VGIC Date: Wed, 12 Mar 2014 15:31:11 -0700 Message-ID: <20140312223111.GA24808@cbox> References: <1393945842-6453-1-git-send-email-m.paolino@virtualopensystems.com> <5315F1D2.8070305@redhat.com> <7b51b9b296e342bcf85a3719513b2d0d@www.loen.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paolo Bonzini , Michele Paolino , kvmarm@lists.cs.columbia.edu, tech@virtualopensystems.com, kvm@vger.kernel.org To: Marc Zyngier Return-path: Received: from mail-pa0-f41.google.com ([209.85.220.41]:51806 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751766AbaCLWbL (ORCPT ); Wed, 12 Mar 2014 18:31:11 -0400 Received: by mail-pa0-f41.google.com with SMTP id fa1so178577pad.0 for ; Wed, 12 Mar 2014 15:31:11 -0700 (PDT) Content-Disposition: inline In-Reply-To: <7b51b9b296e342bcf85a3719513b2d0d@www.loen.fr> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Mar 06, 2014 at 03:30:46AM +0000, Marc Zyngier wrote: > Paolo, Michele, > > On 2014-03-04 15:31, Paolo Bonzini wrote: > >Il 04/03/2014 16:10, Michele Paolino ha scritto: > >>When the kernel is configured without CONFIG_KVM_ARM_VGIC, the > >>compilation process fails with : > >> > >>arch/arm/kvm/arm.c: In function 'kvm_vm_ioctl_set_device_addr': > >>arch/arm/kvm/arm.c:797:3: error: implicit declaration of > >> function 'kvm_vgic_addr' [-Werror=implicit-function-declaration] > >> return kvm_vgic_addr(kvm, type, &dev_addr->addr, true) > >> > >>Signed-off-by: Michele Paolino > >>--- > >> include/kvm/arm_vgic.h | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >>diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h > >>index be85127..0bab057 100644 > >>--- a/include/kvm/arm_vgic.h > >>+++ b/include/kvm/arm_vgic.h > >>@@ -143,8 +143,8 @@ struct kvm_vcpu; > >> struct kvm_run; > >> struct kvm_exit_mmio; > >> > >>-#ifdef CONFIG_KVM_ARM_VGIC > >> int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 > >>*addr, bool write); > >>+#ifdef CONFIG_KVM_ARM_VGIC > >> int kvm_vgic_hyp_init(void); > >> int kvm_vgic_init(struct kvm *kvm); > >> int kvm_vgic_create(struct kvm *kvm); > >> > > > >Christoffer, Marc, I can queue this directly for kvm/master if > >it's okay > >for you. > > This patch looks a bit wrong. Why would we need to configure the > vgic addresses if the vgic is explicitly disabled? > Furthermore, I doubt it leads to a kernel that actually links, as > the file containing kvm_vgic_addr will not be compiled... > > Instead, please consider applying the attached patch (quickly tested > on a Cubietruck). > > Thanks, > > M. > -- > Fast, cheap, reliable. Pick two. > From 0876a7f6851e011b24f61ccbada35a5e8b898dd2 Mon Sep 17 00:00:00 2001 > From: Marc Zyngier > Date: Thu, 6 Mar 2014 03:21:36 +0000 > Subject: [PATCH] ARM: KVM: fix non-VGIC compilation > > Add a stub for kvm_vgic_addr when compiling without > CONFIG_KVM_ARM_VGIC. The usefulness of this configurarion is extremely > doubtful, but let's fix it anyway (until we decide that we'll always > support a VGIC). > > Reported-by: Michele Paolino > Cc: Paolo Bonzini > Cc: Christoffer Dall > Signed-off-by: Marc Zyngier > --- > include/kvm/arm_vgic.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h > index be85127..f27000f 100644 > --- a/include/kvm/arm_vgic.h > +++ b/include/kvm/arm_vgic.h > @@ -171,6 +171,11 @@ static inline int kvm_vgic_set_addr(struct kvm *kvm, unsigned long type, u64 add > return 0; > } > > +static inline int kvm_vgic_addr(struct kvm *kvm, unsigned long type, u64 *addr, bool write) > +{ > + return -ENXIO; > +} > + > static inline int kvm_vgic_init(struct kvm *kvm) > { > return 0; > -- > 1.9.0 > This looks right to me. I can queue this for the next -rc release. Thanks, -Christoffer