kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block
@ 2012-05-18 17:59 Paul Gortmaker
  2012-05-18 18:42 ` Sam Ravnborg
  2012-05-21 14:49 ` Avi Kivity
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Gortmaker @ 2012-05-18 17:59 UTC (permalink / raw)
  To: kvm; +Cc: Avi Kivity, Arnd Bergmann, linux-kernel, Paul Gortmaker

There are two functions in this asm-generic file.  Looking at
other arch which do not use the generic version, these two fcns
are within an #ifdef __KERNEL__ block, so make the generic one
consistent with those.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

diff --git a/include/asm-generic/kvm_para.h b/include/asm-generic/kvm_para.h
index 9a7bbad..5cba37f 100644
--- a/include/asm-generic/kvm_para.h
+++ b/include/asm-generic/kvm_para.h
@@ -1,6 +1,7 @@
 #ifndef _ASM_GENERIC_KVM_PARA_H
 #define _ASM_GENERIC_KVM_PARA_H
 
+#ifdef __KERNEL__
 
 /*
  * This function is used by architectures that support kvm to avoid issuing
@@ -16,4 +17,6 @@ static inline unsigned int kvm_arch_para_features(void)
 	return 0;
 }
 
+#endif	/* _KERNEL__ */
+
 #endif
-- 
1.7.9.1

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

* Re: [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block
  2012-05-18 17:59 [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block Paul Gortmaker
@ 2012-05-18 18:42 ` Sam Ravnborg
  2012-05-18 22:24   ` Paul Gortmaker
  2012-05-21 14:49 ` Avi Kivity
  1 sibling, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2012-05-18 18:42 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: kvm, Avi Kivity, Arnd Bergmann, linux-kernel

On Fri, May 18, 2012 at 01:59:39PM -0400, Paul Gortmaker wrote:
> There are two functions in this asm-generic file.  Looking at
> other arch which do not use the generic version, these two fcns
> are within an #ifdef __KERNEL__ block, so make the generic one
> consistent with those.
> 
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> 
> diff --git a/include/asm-generic/kvm_para.h b/include/asm-generic/kvm_para.h
> index 9a7bbad..5cba37f 100644
> --- a/include/asm-generic/kvm_para.h
> +++ b/include/asm-generic/kvm_para.h
> @@ -1,6 +1,7 @@
>  #ifndef _ASM_GENERIC_KVM_PARA_H
>  #define _ASM_GENERIC_KVM_PARA_H
>  
> +#ifdef __KERNEL__
>  
>  /*
>   * This function is used by architectures that support kvm to avoid issuing
> @@ -16,4 +17,6 @@ static inline unsigned int kvm_arch_para_features(void)
>  	return 0;
>  }
>  
> +#endif	/* _KERNEL__ */
> +
>  #endif

I do not have this file in my tree...
But in general we should try to separate out exporeted stuff in their own headers,
so no new files should ever use __KERNEL__.

Either everything or nothing is exported.

	Sam

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

* Re: [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block
  2012-05-18 18:42 ` Sam Ravnborg
@ 2012-05-18 22:24   ` Paul Gortmaker
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Gortmaker @ 2012-05-18 22:24 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: kvm, Avi Kivity, Eric B Munson, Arnd Bergmann, linux-kernel,
	Marcelo Tosatti

[Re: [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block] On 18/05/2012 (Fri 20:42) Sam Ravnborg wrote:

> On Fri, May 18, 2012 at 01:59:39PM -0400, Paul Gortmaker wrote:
> > There are two functions in this asm-generic file.  Looking at
> > other arch which do not use the generic version, these two fcns
> > are within an #ifdef __KERNEL__ block, so make the generic one
> > consistent with those.
> > 
> > Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> > 
> > diff --git a/include/asm-generic/kvm_para.h b/include/asm-generic/kvm_para.h
> > index 9a7bbad..5cba37f 100644
> > --- a/include/asm-generic/kvm_para.h
> > +++ b/include/asm-generic/kvm_para.h
> > @@ -1,6 +1,7 @@
> >  #ifndef _ASM_GENERIC_KVM_PARA_H
> >  #define _ASM_GENERIC_KVM_PARA_H
> >  
> > +#ifdef __KERNEL__
> >  
> >  /*
> >   * This function is used by architectures that support kvm to avoid issuing
> > @@ -16,4 +17,6 @@ static inline unsigned int kvm_arch_para_features(void)
> >  	return 0;
> >  }
> >  
> > +#endif	/* _KERNEL__ */
> > +
> >  #endif
> 
> I do not have this file in my tree...

It appears in linux-next with this commit:

commit 3b5d56b9317fa7b5407dff1aa7b115bf6cdbd494
Author: Eric B Munson <emunson@mgebm.net>
Date:   Sat Mar 10 14:37:26 2012 -0500

    kvmclock: Add functions to check if the host has stopped the vm

Additional stub is added to it in this commit (also linux-next):

commit 1f15d10984c854e077da5aa1a23f901496b49773
Author: Marcelo Tosatti <mtosatti@redhat.com>
Date:   Fri Apr 20 18:21:46 2012 -0300

    KVM: add kvm_arch_para_features stub to asm-generic/kvm_para.h

> But in general we should try to separate out exporeted stuff in their own headers,
> so no new files should ever use __KERNEL__.
> 
> Either everything or nothing is exported.

I cant argue with that.  So, just for context, the issue I was looking
at was this failure in linux-next:

CHECK   include/asm (32 files)
/scratch/kisskb/build/linux-next_parisc-defconfig_parisc/usr/include/asm/kvm_para.h:1:
included file 'asm-generic/kvm_para.h' is not exported
make[3]: ***
[/scratch/kisskb/build/linux-next_parisc-defconfig_parisc/usr/include/asm/.check]
Error 123
make[3]: Target `__headerscheck' not remade because of errors.
make[2]: *** [headers_check] Error 2
make[1]: *** [vmlinux] Error 2

http://kisskb.ellerman.id.au/kisskb/buildresult/6337975/

The above is pa-risc, but it also appears on any arch using the generic
header, instead of an arch specific one, like sparc:

http://kisskb.ellerman.id.au/kisskb/buildresult/6291409/

My patch doesn't fix this issue, but I thought it made sense at the
time, just based on the comparison to the other arch specific versions
of the same file.  I'm fine with junking it and leaving you guys to
decide what is best to export and where [for headers_check].

Thanks,
Paul.

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

* Re: [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block
  2012-05-18 17:59 [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block Paul Gortmaker
  2012-05-18 18:42 ` Sam Ravnborg
@ 2012-05-21 14:49 ` Avi Kivity
  1 sibling, 0 replies; 4+ messages in thread
From: Avi Kivity @ 2012-05-21 14:49 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: kvm, Arnd Bergmann, linux-kernel

On 05/18/2012 08:59 PM, Paul Gortmaker wrote:
> There are two functions in this asm-generic file.  Looking at
> other arch which do not use the generic version, these two fcns
> are within an #ifdef __KERNEL__ block, so make the generic one
> consistent with those.

Thanks, applied for 3.5.

-- 
error compiling committee.c: too many arguments to function

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

end of thread, other threads:[~2012-05-21 14:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-18 17:59 [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block Paul Gortmaker
2012-05-18 18:42 ` Sam Ravnborg
2012-05-18 22:24   ` Paul Gortmaker
2012-05-21 14:49 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).