public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [fix] kernel does not compile without CONFIG_KVM_ARM_VGIC
@ 2014-03-04 15:10 Michele Paolino
  2014-03-04 15:31 ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Michele Paolino @ 2014-03-04 15:10 UTC (permalink / raw)
  To: kvmarm, tech, kvm; +Cc: m.paolino

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 <m.paolino@virtualopensystems.com>
---
 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);
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] [fix] kernel does not compile without CONFIG_KVM_ARM_VGIC
  2014-03-04 15:10 [PATCH] [fix] kernel does not compile without CONFIG_KVM_ARM_VGIC Michele Paolino
@ 2014-03-04 15:31 ` Paolo Bonzini
  2014-03-06  3:30   ` Marc Zyngier
  0 siblings, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2014-03-04 15:31 UTC (permalink / raw)
  To: Michele Paolino, kvmarm, tech, kvm

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 <m.paolino@virtualopensystems.com>
> ---
>  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.

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] [fix] kernel does not compile without  CONFIG_KVM_ARM_VGIC
  2014-03-04 15:31 ` Paolo Bonzini
@ 2014-03-06  3:30   ` Marc Zyngier
  2014-03-12 22:31     ` Christoffer Dall
  2014-03-12 22:32     ` Christoffer Dall
  0 siblings, 2 replies; 5+ messages in thread
From: Marc Zyngier @ 2014-03-06  3:30 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Michele Paolino, kvmarm, tech, kvm, christoffer.dall

[-- Attachment #1: Type: text/plain, Size: 1640 bytes --]

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 <m.paolino@virtualopensystems.com>
>> ---
>>  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.

[-- Attachment #2: 0001-ARM-KVM-fix-non-VGIC-compilation.patch --]
[-- Type: text/plain, Size: 1153 bytes --]

From 0876a7f6851e011b24f61ccbada35a5e8b898dd2 Mon Sep 17 00:00:00 2001
From: Marc Zyngier <marc.zyngier@arm.com>
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 <m.paolino@virtualopensystems.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] [fix] kernel does not compile without CONFIG_KVM_ARM_VGIC
  2014-03-06  3:30   ` Marc Zyngier
@ 2014-03-12 22:31     ` Christoffer Dall
  2014-03-12 22:32     ` Christoffer Dall
  1 sibling, 0 replies; 5+ messages in thread
From: Christoffer Dall @ 2014-03-12 22:31 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Paolo Bonzini, Michele Paolino, kvmarm, tech, kvm

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 <m.paolino@virtualopensystems.com>
> >>---
> >> 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 <marc.zyngier@arm.com>
> 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 <m.paolino@virtualopensystems.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] [fix] kernel does not compile without CONFIG_KVM_ARM_VGIC
  2014-03-06  3:30   ` Marc Zyngier
  2014-03-12 22:31     ` Christoffer Dall
@ 2014-03-12 22:32     ` Christoffer Dall
  1 sibling, 0 replies; 5+ messages in thread
From: Christoffer Dall @ 2014-03-12 22:32 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Paolo Bonzini, Michele Paolino, kvmarm, tech, kvm

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 <m.paolino@virtualopensystems.com>
> >>---
> >> 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 <marc.zyngier@arm.com>
> 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 <m.paolino@virtualopensystems.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Christoffer Dall <christoffer.dall@linaro.org>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  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
> 

Ah, never mind, it was already applied.  Thanks Paolo.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-03-12 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-04 15:10 [PATCH] [fix] kernel does not compile without CONFIG_KVM_ARM_VGIC Michele Paolino
2014-03-04 15:31 ` Paolo Bonzini
2014-03-06  3:30   ` Marc Zyngier
2014-03-12 22:31     ` Christoffer Dall
2014-03-12 22:32     ` Christoffer Dall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox