Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

kvm: provide kvm.h for all architecture: fixes headers_install

Currently include/linux/kvm.h is not considered by make headers_install,
because Kbuild cannot handle " unifdef-$(CONFIG_FOO) += foo.h. This problem
was introduced by

commit fb56dbb31c4738a3918db81fd24da732ce3b4ae6
Author: Avi Kivity <avi@qumranet.com>
Date: Sun Dec 2 10:50:06 2007 +0200

KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM

Currently, make headers_check barfs due to <asm/kvm.h>, which <linux/kvm.h>
includes, not existing. Rather than add a zillion <asm/kvm.h>s, export kvm.
only if the arch actually supports it.

Signed-off-by: Avi Kivity <avi@qumranet.com>

which makes this an 2.6.25 regression.

One way of solving the issue is to enhance Kbuild, but Avi and David conviced
me, that changing headers_install is not the way to go. This patch changes
the definition for linux/kvm.h to unifdef-y.

If  unifdef-y is used for linux/kvm.h "make headers_check" will fail on all
architectures without asm/kvm.h. Therefore, this patch also provides
asm/kvm.h on all architectures.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Avi Kivity <avi@qumranet.com>
Cc: Sam Ravnborg <sam@ravnborg.org
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Christian Borntraeger and committed by
Linus Torvalds
dd135ebb 8eb224cd

+135 -1
+6
include/asm-alpha/kvm.h
··· 1 + #ifndef __LINUX_KVM_ALPHA_H 2 + #define __LINUX_KVM_ALPHA_H 3 + 4 + /* alpha does not support KVM */ 5 + 6 + #endif
+6
include/asm-arm/kvm.h
··· 1 + #ifndef __LINUX_KVM_ARM_H 2 + #define __LINUX_KVM_ARM_H 3 + 4 + /* arm does not support KVM */ 5 + 6 + #endif
+6
include/asm-avr32/kvm.h
··· 1 + #ifndef __LINUX_KVM_AVR32_H 2 + #define __LINUX_KVM_AVR32_H 3 + 4 + /* avr32 does not support KVM */ 5 + 6 + #endif
+6
include/asm-blackfin/kvm.h
··· 1 + #ifndef __LINUX_KVM_BLACKFIN_H 2 + #define __LINUX_KVM_BLACKFIN_H 3 + 4 + /* blackfin does not support KVM */ 5 + 6 + #endif
+6
include/asm-cris/kvm.h
··· 1 + #ifndef __LINUX_KVM_CRIS_H 2 + #define __LINUX_KVM_CRIS_H 3 + 4 + /* cris does not support KVM */ 5 + 6 + #endif
+6
include/asm-frv/kvm.h
··· 1 + #ifndef __LINUX_KVM_FRV_H 2 + #define __LINUX_KVM_FRV_H 3 + 4 + /* frv does not support KVM */ 5 + 6 + #endif
+2
include/asm-generic/Kbuild.asm
··· 1 + header-y += kvm.h 2 + 1 3 ifeq ($(wildcard include/asm-$(SRCARCH)/a.out.h),include/asm-$(SRCARCH)/a.out.h) 2 4 unifdef-y += a.out.h 3 5 endif
+6
include/asm-h8300/kvm.h
··· 1 + #ifndef __LINUX_KVM_H8300_H 2 + #define __LINUX_KVM_H8300_H 3 + 4 + /* h8300 does not support KVM */ 5 + 6 + #endif
+6
include/asm-ia64/kvm.h
··· 1 + #ifndef __LINUX_KVM_IA64_H 2 + #define __LINUX_KVM_IA64_H 3 + 4 + /* ia64 does not support KVM */ 5 + 6 + #endif
+6
include/asm-m32r/kvm.h
··· 1 + #ifndef __LINUX_KVM_M32R_H 2 + #define __LINUX_KVM_M32R_H 3 + 4 + /* m32r does not support KVM */ 5 + 6 + #endif
+6
include/asm-m68k/kvm.h
··· 1 + #ifndef __LINUX_KVM_M68K_H 2 + #define __LINUX_KVM_M68K_H 3 + 4 + /* m68k does not support KVM */ 5 + 6 + #endif
+6
include/asm-m68knommu/kvm.h
··· 1 + #ifndef __LINUX_KVM_M68KNOMMU_H 2 + #define __LINUX_KVM_M68KNOMMU_H 3 + 4 + /* m68knommu does not support KVM */ 5 + 6 + #endif
+6
include/asm-mips/kvm.h
··· 1 + #ifndef __LINUX_KVM_MIPS_H 2 + #define __LINUX_KVM_MIPS_H 3 + 4 + /* mips does not support KVM */ 5 + 6 + #endif
+6
include/asm-mn10300/kvm.h
··· 1 + #ifndef __LINUX_KVM_MN10300_H 2 + #define __LINUX_KVM_MN10300_H 3 + 4 + /* mn10300 does not support KVM */ 5 + 6 + #endif
+6
include/asm-parisc/kvm.h
··· 1 + #ifndef __LINUX_KVM_PARISC_H 2 + #define __LINUX_KVM_PARISC_H 3 + 4 + /* parisc does not support KVM */ 5 + 6 + #endif
+6
include/asm-powerpc/kvm.h
··· 1 + #ifndef __LINUX_KVM_POWERPC_H 2 + #define __LINUX_KVM_POWERPC_H 3 + 4 + /* powerpc does not support KVM */ 5 + 6 + #endif
+6
include/asm-s390/kvm.h
··· 1 + #ifndef __LINUX_KVM_S390_H 2 + #define __LINUX_KVM_S390_H 3 + 4 + /* s390 does not support KVM */ 5 + 6 + #endif
+6
include/asm-sh/kvm.h
··· 1 + #ifndef __LINUX_KVM_SH_H 2 + #define __LINUX_KVM_SH_H 3 + 4 + /* sh does not support KVM */ 5 + 6 + #endif
+6
include/asm-sparc/kvm.h
··· 1 + #ifndef __LINUX_KVM_SPARC_H 2 + #define __LINUX_KVM_SPARC_H 3 + 4 + /* sparc does not support KVM */ 5 + 6 + #endif
+6
include/asm-sparc64/kvm.h
··· 1 + #ifndef __LINUX_KVM_SPARC64_H 2 + #define __LINUX_KVM_SPARC64_H 3 + 4 + /* sparc64 does not support KVM */ 5 + 6 + #endif
+6
include/asm-um/kvm.h
··· 1 + #ifndef __LINUX_KVM_UM_H 2 + #define __LINUX_KVM_UM_H 3 + 4 + /* um does not support KVM */ 5 + 6 + #endif
+6
include/asm-v850/kvm.h
··· 1 + #ifndef __LINUX_KVM_V850_H 2 + #define __LINUX_KVM_V850_H 3 + 4 + /* v850 does not support KVM */ 5 + 6 + #endif
+6
include/asm-xtensa/kvm.h
··· 1 + #ifndef __LINUX_KVM_XTENSA_H 2 + #define __LINUX_KVM_XTENSA_H 3 + 4 + /* xtensa does not support KVM */ 5 + 6 + #endif
+1 -1
include/linux/Kbuild
··· 253 253 unifdef-y += kernelcapi.h 254 254 unifdef-y += kernel.h 255 255 unifdef-y += keyboard.h 256 - unifdef-$(CONFIG_HAVE_KVM) += kvm.h 256 + unifdef-y += kvm.h 257 257 unifdef-y += llc.h 258 258 unifdef-y += loop.h 259 259 unifdef-y += lp.h