Skip to contentSkip to conversation

kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block

PATCH Applied Paul Gortmaker 3 participants 4 messages May 18, 2012 – May 21, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block

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.

include/asm-generic/kvm_para.h +3 -0
index 9a7bbad..5cba37f 100644
@@ -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
Signature · 1 line
1.7.9.1
#1 lore raw
Quoted 20 lines · 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.

include/asm-generic/kvm_para.h +1 -0
index 9a7bbad..5cba37f 100644
@@ -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

include/asm-generic/kvm_para.h static inline unsigned int kvm_arch_para_features(void) · line 22

Quoted 6 lines
include/asm-generic/kvm_para.h +2 -0
@@ -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

#2 lore raw
Quoted 24 lines · [Re: [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block]…
Quoted 23 lines · 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.

include/asm-generic/kvm_para.h +1 -0
index 9a7bbad..5cba37f 100644
@@ -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;
 }
 
Quoted 5 lines

include/asm-generic/kvm_para.h static inline unsigned int kvm_arch_para_features(void) · line 22

Quoted 3 lines
include/asm-generic/kvm_para.h +2 -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 <[email protected]>
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 <[email protected]>
Date:   Fri Apr 20 18:21:46 2012 -0300

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

Quoted 4 lines

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.

Applied
#3 lore raw
In reply to Paul Gortmaker
Quoted 4 lines · 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.

Thanks, applied for 3.5.

Signature · 1 line
error compiling committee.c: too many arguments to function