public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] s390: Include kvm_host.h header only if KVM is enabled
@ 2014-12-08 20:24 Pranith Kumar
  2014-12-08 23:59 ` Paul E. McKenney
  0 siblings, 1 reply; 4+ messages in thread
From: Pranith Kumar @ 2014-12-08 20:24 UTC (permalink / raw)
  To: Martin Schwidefsky, Heiko Carstens, supporter:S390,
	Christian Borntraeger, Jens Freimann, open list:S390, open list
  Cc: paulmck

KVM uses srcu structures because of which CONFIG_KVM selects CONFIG_SRCU. In
asm-offsets.c, we are including kvm_host.h unconditionally even though
CONFIG_KVM is not enabled because of which we get errors like follows:

    In file included from arch/s390/kernel/asm-offsets.c:10:0:
>> include/linux/kvm_host.h:363:21: error: field 'srcu' has incomplete type
      struct srcu_struct srcu;
                         ^
>> include/linux/kvm_host.h:364:21: error: field 'irq_srcu' has incomplete type
      struct srcu_struct irq_srcu;
                         ^
    make[2]: *** [arch/s390/kernel/asm-offsets.s] Error 1
    make[2]: Target '__build' not remade because of errors.
    make[1]: *** [prepare0] Error 2
    make[1]: Target 'prepare' not remade because of errors.
    make: *** [sub-make] Error 2 

This patch fixes these by including kvm_host.h conditionally on CONFIG_KVM.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 arch/s390/kernel/asm-offsets.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
index ef279a1..055334d 100644
--- a/arch/s390/kernel/asm-offsets.c
+++ b/arch/s390/kernel/asm-offsets.c
@@ -7,12 +7,15 @@
 #define ASM_OFFSETS_C
 
 #include <linux/kbuild.h>
-#include <linux/kvm_host.h>
 #include <linux/sched.h>
 #include <asm/idle.h>
 #include <asm/vdso.h>
 #include <asm/pgtable.h>
 
+#ifdef CONFIG_KVM
+#include <linux/kvm_host.h>
+#endif
+
 /*
  * Make sure that the compiler is new enough. We want a compiler that
  * is known to work with the "Q" assembler constraint.
@@ -182,8 +185,10 @@ int main(void)
 	DEFINE(__LC_PGM_TDB, offsetof(struct _lowcore, pgm_tdb));
 	DEFINE(__THREAD_trap_tdb, offsetof(struct task_struct, thread.trap_tdb));
 	DEFINE(__GMAP_ASCE, offsetof(struct gmap, asce));
+#ifdef CONFIG_KVM
 	DEFINE(__SIE_PROG0C, offsetof(struct kvm_s390_sie_block, prog0c));
 	DEFINE(__SIE_PROG20, offsetof(struct kvm_s390_sie_block, prog20));
+#endif /* CONFIG_KVM */
 #endif /* CONFIG_32BIT */
 	return 0;
 }
-- 
1.9.1


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

* Re: [PATCH] s390: Include kvm_host.h header only if KVM is enabled
  2014-12-08 20:24 [PATCH] s390: Include kvm_host.h header only if KVM is enabled Pranith Kumar
@ 2014-12-08 23:59 ` Paul E. McKenney
  2014-12-09  2:29   ` Pranith Kumar
  0 siblings, 1 reply; 4+ messages in thread
From: Paul E. McKenney @ 2014-12-08 23:59 UTC (permalink / raw)
  To: Pranith Kumar
  Cc: Martin Schwidefsky, Heiko Carstens, supporter:S390,
	Christian Borntraeger, Jens Freimann, open list:S390, open list

On Mon, Dec 08, 2014 at 03:24:35PM -0500, Pranith Kumar wrote:
> KVM uses srcu structures because of which CONFIG_KVM selects CONFIG_SRCU. In
> asm-offsets.c, we are including kvm_host.h unconditionally even though
> CONFIG_KVM is not enabled because of which we get errors like follows:
> 
>     In file included from arch/s390/kernel/asm-offsets.c:10:0:
> >> include/linux/kvm_host.h:363:21: error: field 'srcu' has incomplete type
>       struct srcu_struct srcu;
>                          ^
> >> include/linux/kvm_host.h:364:21: error: field 'irq_srcu' has incomplete type
>       struct srcu_struct irq_srcu;
>                          ^
>     make[2]: *** [arch/s390/kernel/asm-offsets.s] Error 1
>     make[2]: Target '__build' not remade because of errors.
>     make[1]: *** [prepare0] Error 2
>     make[1]: Target 'prepare' not remade because of errors.
>     make: *** [sub-make] Error 2 
> 
> This patch fixes these by including kvm_host.h conditionally on CONFIG_KVM.
> 
> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>

To make the commits bisectable, we need to combine these two patches,
correct?

							Thanx, Paul

> ---
>  arch/s390/kernel/asm-offsets.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
> index ef279a1..055334d 100644
> --- a/arch/s390/kernel/asm-offsets.c
> +++ b/arch/s390/kernel/asm-offsets.c
> @@ -7,12 +7,15 @@
>  #define ASM_OFFSETS_C
> 
>  #include <linux/kbuild.h>
> -#include <linux/kvm_host.h>
>  #include <linux/sched.h>
>  #include <asm/idle.h>
>  #include <asm/vdso.h>
>  #include <asm/pgtable.h>
> 
> +#ifdef CONFIG_KVM
> +#include <linux/kvm_host.h>
> +#endif
> +
>  /*
>   * Make sure that the compiler is new enough. We want a compiler that
>   * is known to work with the "Q" assembler constraint.
> @@ -182,8 +185,10 @@ int main(void)
>  	DEFINE(__LC_PGM_TDB, offsetof(struct _lowcore, pgm_tdb));
>  	DEFINE(__THREAD_trap_tdb, offsetof(struct task_struct, thread.trap_tdb));
>  	DEFINE(__GMAP_ASCE, offsetof(struct gmap, asce));
> +#ifdef CONFIG_KVM
>  	DEFINE(__SIE_PROG0C, offsetof(struct kvm_s390_sie_block, prog0c));
>  	DEFINE(__SIE_PROG20, offsetof(struct kvm_s390_sie_block, prog20));
> +#endif /* CONFIG_KVM */
>  #endif /* CONFIG_32BIT */
>  	return 0;
>  }
> -- 
> 1.9.1
> 


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

* Re: [PATCH] s390: Include kvm_host.h header only if KVM is enabled
  2014-12-08 23:59 ` Paul E. McKenney
@ 2014-12-09  2:29   ` Pranith Kumar
  2014-12-09  6:15     ` Heiko Carstens
  0 siblings, 1 reply; 4+ messages in thread
From: Pranith Kumar @ 2014-12-09  2:29 UTC (permalink / raw)
  To: Paul McKenney
  Cc: Martin Schwidefsky, Heiko Carstens, supporter:S390,
	Christian Borntraeger, Jens Freimann, open list:S390, open list

On Mon, Dec 8, 2014 at 6:59 PM, Paul E. McKenney
<paulmck@linux.vnet.ibm.com> wrote:
> On Mon, Dec 08, 2014 at 03:24:35PM -0500, Pranith Kumar wrote:
>> KVM uses srcu structures because of which CONFIG_KVM selects CONFIG_SRCU. In
>> asm-offsets.c, we are including kvm_host.h unconditionally even though
>> CONFIG_KVM is not enabled because of which we get errors like follows:
>>
>>     In file included from arch/s390/kernel/asm-offsets.c:10:0:
>> >> include/linux/kvm_host.h:363:21: error: field 'srcu' has incomplete type
>>       struct srcu_struct srcu;
>>                          ^
>> >> include/linux/kvm_host.h:364:21: error: field 'irq_srcu' has incomplete type
>>       struct srcu_struct irq_srcu;
>>                          ^
>>     make[2]: *** [arch/s390/kernel/asm-offsets.s] Error 1
>>     make[2]: Target '__build' not remade because of errors.
>>     make[1]: *** [prepare0] Error 2
>>     make[1]: Target 'prepare' not remade because of errors.
>>     make: *** [sub-make] Error 2
>>
>> This patch fixes these by including kvm_host.h conditionally on CONFIG_KVM.
>>
>> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
>
> To make the commits bisectable, we need to combine these two patches,
> correct?
>

Yes, if the s390 maintainers raise no objections, I will combine this
with the other patch and send it.

Thanks!

>> ---
>>  arch/s390/kernel/asm-offsets.c | 7 ++++++-
>>  1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
>> index ef279a1..055334d 100644
>> --- a/arch/s390/kernel/asm-offsets.c
>> +++ b/arch/s390/kernel/asm-offsets.c
>> @@ -7,12 +7,15 @@
>>  #define ASM_OFFSETS_C
>>
>>  #include <linux/kbuild.h>
>> -#include <linux/kvm_host.h>
>>  #include <linux/sched.h>
>>  #include <asm/idle.h>
>>  #include <asm/vdso.h>
>>  #include <asm/pgtable.h>
>>
>> +#ifdef CONFIG_KVM
>> +#include <linux/kvm_host.h>
>> +#endif
>> +
>>  /*
>>   * Make sure that the compiler is new enough. We want a compiler that
>>   * is known to work with the "Q" assembler constraint.
>> @@ -182,8 +185,10 @@ int main(void)
>>       DEFINE(__LC_PGM_TDB, offsetof(struct _lowcore, pgm_tdb));
>>       DEFINE(__THREAD_trap_tdb, offsetof(struct task_struct, thread.trap_tdb));
>>       DEFINE(__GMAP_ASCE, offsetof(struct gmap, asce));
>> +#ifdef CONFIG_KVM
>>       DEFINE(__SIE_PROG0C, offsetof(struct kvm_s390_sie_block, prog0c));
>>       DEFINE(__SIE_PROG20, offsetof(struct kvm_s390_sie_block, prog20));
>> +#endif /* CONFIG_KVM */
>>  #endif /* CONFIG_32BIT */
>>       return 0;
>>  }
>> --
>> 1.9.1
>>
>



-- 
Pranith

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

* Re: [PATCH] s390: Include kvm_host.h header only if KVM is enabled
  2014-12-09  2:29   ` Pranith Kumar
@ 2014-12-09  6:15     ` Heiko Carstens
  0 siblings, 0 replies; 4+ messages in thread
From: Heiko Carstens @ 2014-12-09  6:15 UTC (permalink / raw)
  To: Pranith Kumar
  Cc: Paul McKenney, Martin Schwidefsky, supporter:S390,
	Christian Borntraeger, Jens Freimann, open list:S390, open list

On Mon, Dec 08, 2014 at 09:29:08PM -0500, Pranith Kumar wrote:
> On Mon, Dec 8, 2014 at 6:59 PM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
> > On Mon, Dec 08, 2014 at 03:24:35PM -0500, Pranith Kumar wrote:
> >> KVM uses srcu structures because of which CONFIG_KVM selects CONFIG_SRCU. In
> >> asm-offsets.c, we are including kvm_host.h unconditionally even though
> >> CONFIG_KVM is not enabled because of which we get errors like follows:
> >>
> >>     In file included from arch/s390/kernel/asm-offsets.c:10:0:
> >> >> include/linux/kvm_host.h:363:21: error: field 'srcu' has incomplete type
> >>       struct srcu_struct srcu;
> >>                          ^
> >> >> include/linux/kvm_host.h:364:21: error: field 'irq_srcu' has incomplete type
> >>       struct srcu_struct irq_srcu;
> >>                          ^
> >>     make[2]: *** [arch/s390/kernel/asm-offsets.s] Error 1
> >>     make[2]: Target '__build' not remade because of errors.
> >>     make[1]: *** [prepare0] Error 2
> >>     make[1]: Target 'prepare' not remade because of errors.
> >>     make: *** [sub-make] Error 2
> >>
> >> This patch fixes these by including kvm_host.h conditionally on CONFIG_KVM.
> >>
> >> Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
> >
> > To make the commits bisectable, we need to combine these two patches,
> > correct?
> >
> 
> Yes, if the s390 maintainers raise no objections, I will combine this
> with the other patch and send it.

That's fine with me.

> >>  arch/s390/kernel/asm-offsets.c | 7 ++++++-
> >>  1 file changed, 6 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/arch/s390/kernel/asm-offsets.c b/arch/s390/kernel/asm-offsets.c
> >> index ef279a1..055334d 100644
> >> --- a/arch/s390/kernel/asm-offsets.c
> >> +++ b/arch/s390/kernel/asm-offsets.c
> >> @@ -7,12 +7,15 @@
> >>  #define ASM_OFFSETS_C
> >>
> >>  #include <linux/kbuild.h>
> >> -#include <linux/kvm_host.h>
> >>  #include <linux/sched.h>
> >>  #include <asm/idle.h>
> >>  #include <asm/vdso.h>
> >>  #include <asm/pgtable.h>
> >>
> >> +#ifdef CONFIG_KVM
> >> +#include <linux/kvm_host.h>
> >> +#endif
> >> +

Even though I'm wondering why linux/kvm_host.h doesn't have such an #ifdef
included. Not that it would help in this case, but it would help to omit
the #ifdef around the #include statement here.

Looking a bit further.. so arch/s390/include/asm/kvm_host.h includes
include/linux/kvm_host.h and vice versa. Nice ;)


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

end of thread, other threads:[~2014-12-09  6:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-08 20:24 [PATCH] s390: Include kvm_host.h header only if KVM is enabled Pranith Kumar
2014-12-08 23:59 ` Paul E. McKenney
2014-12-09  2:29   ` Pranith Kumar
2014-12-09  6:15     ` Heiko Carstens

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