Skip to contentSkip to conversation

Revert "KVM: Export asm-generic/kvm_para.h"

PATCH In review Will Deacon 3 participants 6 messages Jul 18, 2012 – Jul 19, 2012 Generic include/asm header files

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "KVM: Export asm-generic/kvm_para.h"

This reverts commit 56457f38f212344fb38b250cfa7e7311c065022f.

For architectures without asm/kvm_para.h, asm-generic/Kbuild unconditionally tries to export the non-existent header file, resulting in failure to build the user headers. Since the logic in asm-generic/Kbuild.asm will only export the file if it exists (which in turn causes linux/kvm_para.h to be exported), we can just remove the unconditional header export.

Cc Arnd Bergmann <[email protected]>
Cc Avi Kivity <[email protected]>
Cc Geert Uytterhoeven <[email protected]>

---

I'm not sure what specific problem the original commit was fixing, so we may need to solve this another way if there's something I've missed.

 include/asm-generic/Kbuild |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
include/asm-generic/Kbuild +0 -1
index 2c85a0f..53f91b1 100644
@@ -8,7 +8,6 @@ header-y += int-ll64.h
 header-y += ioctl.h
 header-y += ioctls.h
 header-y += ipcbuf.h
-header-y += kvm_para.h
 header-y += mman-common.h
 header-y += mman.h
 header-y += msgbuf.h
Signature · 1 line
1.7.4.1
maintainer
#1 lore raw
Quoted 8 lines · Will Deacon

This reverts commit 56457f38f212344fb38b250cfa7e7311c065022f.

For architectures without asm/kvm_para.h, asm-generic/Kbuild unconditionally tries to export the non-existent header file, resulting in failure to build the user headers. Since the logic in asm-generic/Kbuild.asm will only export the file if it exists (which in turn causes linux/kvm_para.h to be exported), we can just remove the unconditional header export.

This doesn't look right.

Quoted 11 lines

I'm not sure what specific problem the original commit was fixing, so we may need to solve this another way if there's something I've missed.

 include/asm-generic/Kbuild |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
include/asm-generic/Kbuild +0 -0
index 2c85a0f..53f91b1 100644

include/asm-generic/Kbuild header-y += int-ll64.h · line 13

Quoted 7 lines
include/asm-generic/Kbuild +0 -1
@@ -8,7 +8,6 @@ header-y += int-ll64.h
 header-y += ioctl.h
 header-y += ioctls.h
 header-y += ipcbuf.h
-header-y += kvm_para.h
 header-y += mman-common.h
 header-y += mman.h
 header-y += msgbuf.h

include/asm-generic/Kbuild lists the header files in the asm-generic directory, and the asm-generic/kvm_para.h always exists, it's not architecture specific.

arch/arm/include/asm/kvm_para.h also always exists, it was added in 3b5d56b93 "kvmclock: Add functions to check if the host has stopped the vm", although it should have added that to the generated header files listed in arch/arm/include/asm/Kbuild.

I'm still not sure what you are actually trying to fix here.

Arnd

#2 lore raw
Quoted 14 lines · Arnd Bergmann
Quoted 8 lines · Will Deacon

This reverts commit 56457f38f212344fb38b250cfa7e7311c065022f.

For architectures without asm/kvm_para.h, asm-generic/Kbuild unconditionally tries to export the non-existent header file, resulting in failure to build the user headers. Since the logic in asm-generic/Kbuild.asm will only export the file if it exists (which in turn causes linux/kvm_para.h to be exported), we can just remove the unconditional header export.

This doesn't look right.

Quoted 2 lines

I'm not sure what specific problem the original commit was fixing, so we may need to solve this another way if there's something I've missed.

See below.

Quoted 20 lines
Quoted 8 lines
 include/asm-generic/Kbuild |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
include/asm-generic/Kbuild +0 -0
index 2c85a0f..53f91b1 100644

include/asm-generic/Kbuild header-y += int-ll64.h · line 13

Quoted 7 lines
include/asm-generic/Kbuild +0 -1
@@ -8,7 +8,6 @@ header-y += int-ll64.h
 header-y += ioctl.h
 header-y += ioctls.h
 header-y += ipcbuf.h
-header-y += kvm_para.h
 header-y += mman-common.h
 header-y += mman.h
 header-y += msgbuf.h

include/asm-generic/Kbuild lists the header files in the asm-generic directory, and the asm-generic/kvm_para.h always exists, it's not architecture specific.

Quoted 6 lines

arch/arm/include/asm/kvm_para.h also always exists, it was added in 3b5d56b93 "kvmclock: Add functions to check if the host has stopped the vm", although it should have added that to the generated header files listed in arch/arm/include/asm/Kbuild.

I'm still not sure what you are actually trying to fix here.

m68k/allmodconfig http://kisskb.ellerman.id.au/kisskb/buildresult/6695245/

make[4]: *** No rule to make target /scratch/kisskb/build/linux-next_m68k-allmodconfig_m68k/usr/include/linux/kvm_para.h', needed by /scratch/kisskb/build/linux-next_m68k-allmodconfig_m68k/usr/include/linux/.check'. make[3]: *** [linux] Error 2
make[2]: *** [headers_check] Error 2

Before 56457f38f212344fb38b250cfa7e7311c065022f, "make headers_check" was broken on all architectures that do not support kvm (i.e. all but ia64/powerpc/s390/x86).

After 56457f38f212344fb38b250cfa7e7311c065022f, it became broken on all architectures that do not support kvm and converted from

    #include <asm-generic/kvm_para.h>

in their arch/$arch/include/asm/kvm_para.h to

    generic-y += kvm_para.h

in their arch/$arch/include/asm/Kbuild OR just don't have a arch/$arch/include/asm/kvm_para.h.

So far the former case is limited to sh (mainline) and m68k (next), but I expect more architectures to start using the "generic-y += ..." idiom.

The latter is limited to cris and m32r.

Hence just reverting 56457f38f212344fb38b250cfa7e7311c065022f is not the right fix, as it will cause more breakage.

See also https://lkml.org/lkml/2012/6/13/226

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#3 lore raw

Hi Geert,

Quoted 6 lines · Geert Uytterhoeven
Quoted 4 lines · Will Deacon
Quoted 3 lines

I'm not sure what specific problem the original commit was fixing, so we may need to solve this another way if there's something I've missed.

See below.

[...]

Quoted 5 lines

make[4]: *** No rule to make target /scratch/kisskb/build/linux-next_m68k-allmodconfig_m68k/usr/include/linux/kvm_para.h', needed by /scratch/kisskb/build/linux-next_m68k-allmodconfig_m68k/usr/include/linux/.check'. make[3]: *** [linux] Error 2
make[2]: *** [headers_check] Error 2

[...]

Quoted 7 lines

So far the former case is limited to sh (mainline) and m68k (next), but I expect more architectures to start using the "generic-y += ..." idiom.

The latter is limited to cris and m32r.

Hence just reverting 56457f38f212344fb38b250cfa7e7311c065022f is not the right fix, as it will cause more breakage.

Thanks for the explanation. Given that we have the asm-generic version of kvm_para.h, I don't see why we can't just export linux/kvm_para.h unconditionally and fix the few remaining architectures by adding generic-y lines to their Kbuild files.

Something like below (I also removed what look like dead references to asm-$(SRCARCH) in the srctree)...

Will

---8<---

arch/cris/include/asm/Kbuild +2 -0
index 04d02a5..2fde49c 100644
@@ -7,3 +7,5 @@ header-y += ethernet.h
 header-y += etraxgpio.h
 header-y += rs485.h
 header-y += sync_serial.h
+
+generic-y += kvm_para.h
arch/m32r/include/asm/Kbuild +2 -0
index c68e168..78c505e 100644
@@ -1 +1,3 @@
 include include/asm-generic/Kbuild.asm
+
+generic-y += kvm_para.h
include/asm-generic/Kbuild.asm +3 -9
index c5d2e5d..f180c99 100644
@@ -1,15 +1,8 @@
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
-		  $(srctree)/include/asm-$(SRCARCH)/kvm.h),)
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h),)
 header-y  += kvm.h
 endif
 
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
-		  $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
-header-y  += kvm_para.h
-endif
-
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
-		  $(srctree)/include/asm-$(SRCARCH)/a.out.h),)
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h),)
 header-y += a.out.h
 endif
 
@@ -21,6 +14,7 @@ header-y += fcntl.h
 header-y += ioctl.h
 header-y += ioctls.h
 header-y += ipcbuf.h
+header-y += kvm_para.h
 header-y += mman.h
 header-y += msgbuf.h
 header-y += param.h
include/linux/Kbuild +1 -7
index 8760be3..048abc6 100644
@@ -23,20 +23,13 @@ header-y += wimax/
 objhdr-y += version.h
 
 ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
-		  $(srctree)/include/asm-$(SRCARCH)/a.out.h \
 		  $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),)
 header-y += a.out.h
 endif
 ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
-		  $(srctree)/include/asm-$(SRCARCH)/kvm.h \
 		  $(INSTALL_HDR_PATH)/include/asm-*/kvm.h),)
 header-y += kvm.h
 endif
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
-		  $(srctree)/include/asm-$(SRCARCH)/kvm_para.h \
-		  $(INSTALL_HDR_PATH)/include/asm-*/kvm_para.h),)
-header-y += kvm_para.h
-endif
 
 header-y += acct.h
 header-y += adb.h
@@ -229,6 +222,7 @@ header-y += kernel-page-flags.h
 header-y += kexec.h
 header-y += keyboard.h
 header-y += keyctl.h
+header-y += kvm_para.h
 header-y += l2tp.h
 header-y += limits.h
 header-y += llc.h
#4 lore raw

Hi Will,

Quoted 26 lines · Will Deacon
Quoted 6 lines · Geert Uytterhoeven
Quoted 4 lines · Will Deacon
Quoted 3 lines

I'm not sure what specific problem the original commit was fixing, so we may need to solve this another way if there's something I've missed.

See below.

[...]

Quoted 5 lines

make[4]: *** No rule to make target /scratch/kisskb/build/linux-next_m68k-allmodconfig_m68k/usr/include/linux/kvm_para.h', needed by /scratch/kisskb/build/linux-next_m68k-allmodconfig_m68k/usr/include/linux/.check'. make[3]: *** [linux] Error 2
make[2]: *** [headers_check] Error 2

[...]

Quoted 7 lines

So far the former case is limited to sh (mainline) and m68k (next), but I expect more architectures to start using the "generic-y += ..." idiom.

The latter is limited to cris and m32r.

Hence just reverting 56457f38f212344fb38b250cfa7e7311c065022f is not the right fix, as it will cause more breakage.

Quoted 7 lines

Thanks for the explanation. Given that we have the asm-generic version of kvm_para.h, I don't see why we can't just export linux/kvm_para.h unconditionally and fix the few remaining architectures by adding generic-y lines to their Kbuild files.

Something like below (I also removed what look like dead references to asm-$(SRCARCH) in the srctree)...

I applied your patch on next-20120719 and ran "make ARCH=xxx headers_check" for all architectures (this doesn't require any cross-compilers to be installed).

It fixes the issue for m32r, m68k, and sh. Cris still fails for another reason. It did not introduce any regressions for other architectures, so

Quoted 76 lines

---8<---

arch/cris/include/asm/Kbuild +2 -0
index 04d02a5..2fde49c 100644
@@ -7,3 +7,5 @@ header-y += ethernet.h
 header-y += etraxgpio.h
 header-y += rs485.h
 header-y += sync_serial.h
+
+generic-y += kvm_para.h
arch/m32r/include/asm/Kbuild +2 -0
index c68e168..78c505e 100644
@@ -1 +1,3 @@
 include include/asm-generic/Kbuild.asm
+
+generic-y += kvm_para.h
include/asm-generic/Kbuild.asm +3 -9
index c5d2e5d..f180c99 100644
@@ -1,15 +1,8 @@
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
-                 $(srctree)/include/asm-$(SRCARCH)/kvm.h),)
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h),)
 header-y  += kvm.h
 endif
 
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
-                 $(srctree)/include/asm-$(SRCARCH)/kvm_para.h),)
-header-y  += kvm_para.h
-endif
-
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
-                 $(srctree)/include/asm-$(SRCARCH)/a.out.h),)
+ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h),)
 header-y += a.out.h
 endif
 
@@ -21,6 +14,7 @@ header-y += fcntl.h
 header-y += ioctl.h
 header-y += ioctls.h
 header-y += ipcbuf.h
+header-y += kvm_para.h
 header-y += mman.h
 header-y += msgbuf.h
 header-y += param.h
include/linux/Kbuild +0 -7
index 8760be3..048abc6 100644
@@ -23,20 +23,13 @@ header-y += wimax/
 objhdr-y += version.h
 
 ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \
-                 $(srctree)/include/asm-$(SRCARCH)/a.out.h \
                  $(INSTALL_HDR_PATH)/include/asm-*/a.out.h),)
 header-y += a.out.h
 endif
 ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \
-                 $(srctree)/include/asm-$(SRCARCH)/kvm.h \
                  $(INSTALL_HDR_PATH)/include/asm-*/kvm.h),)
 header-y += kvm.h
 endif
-ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm_para.h \
-                 $(srctree)/include/asm-$(SRCARCH)/kvm_para.h \
-                 $(INSTALL_HDR_PATH)/include/asm-*/kvm_para.h),)
-header-y += kvm_para.h
-endif
 
 header-y += acct.h
 header-y += adb.h

include/linux/Kbuild header-y += kernel-page-flags.h · line 228

Quoted 7 lines
include/linux/Kbuild +1 -0
@@ -229,6 +222,7 @@ header-y += kernel-page-flags.h
 header-y += kexec.h
 header-y += keyboard.h
 header-y += keyctl.h
+header-y += kvm_para.h
 header-y += l2tp.h
 header-y += limits.h
 header-y += llc.h

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#5 lore raw
In reply to Arnd Bergmann

Hi Arnd,

Quoted 11 lines · Arnd Bergmann
Quoted 8 lines · Will Deacon

This reverts commit 56457f38f212344fb38b250cfa7e7311c065022f.

For architectures without asm/kvm_para.h, asm-generic/Kbuild unconditionally tries to export the non-existent header file, resulting in failure to build the user headers. Since the logic in asm-generic/Kbuild.asm will only export the file if it exists (which in turn causes linux/kvm_para.h to be exported), we can just remove the unconditional header export.

This doesn't look right.

Ok, something's still amiss with my headers though (see below).

Quoted 6 lines
Quoted 6 lines

I'm not sure what specific problem the original commit was fixing, so we may need to solve this another way if there's something I've missed.

 include/asm-generic/Kbuild |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
Quoted 16 lines

include/asm-generic/Kbuild header-y += int-ll64.h · line 13

Quoted 12 lines
include/asm-generic/Kbuild +0 -1
index 2c85a0f..53f91b1 100644
@@ -8,7 +8,6 @@ header-y += int-ll64.h
 header-y += ioctl.h
 header-y += ioctls.h
 header-y += ipcbuf.h
-header-y += kvm_para.h
 header-y += mman-common.h
 header-y += mman.h
 header-y += msgbuf.h

include/asm-generic/Kbuild lists the header files in the asm-generic directory, and the asm-generic/kvm_para.h always exists, it's not architecture specific.

Right. Why do we have a conditional export of kvm_para.h in include/linux/Kbuild if the asm-generic version always exists? Is it permitted for an architecture to neither have it's own copy or use the generic version?

Quoted 4 lines

arch/arm/include/asm/kvm_para.h also always exists, it was added in 3b5d56b93 "kvmclock: Add functions to check if the host has stopped the vm", although it should have added that to the generated header files listed in arch/arm/include/asm/Kbuild.

Why does that have to be added to the list of generated files? include/asm-generic/Kbuild.asm exports the header if it exists.

Quoted 1 line

I'm still not sure what you are actually trying to fix here.

Sorry, should've mentioned: this is for AArch64 as opposed to ARM. Trying to build the headers_check target results in:

linux/usr/include/linux/kvm_para.h:26: included file 'asm-aarch64/kvm_para.h' is not exported

because the presence of asm-generic/kvm_para.h causes linux/kvm_para.h to be exported. Ideally, we wouldn't need the header (if that's possible) but if we have to have it, a generic-y += kvm_para.h would be better than having a file just containing the line: #include <asm-generic/kvm_para.h>

Thanks,

Will