KVM: export <linux/kvm_para.h> and <asm/kvm_para.h> iif KVM is supported
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 18 Mar 2019 09:08:12 +0000 (18:08 +0900)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 Mar 2019 16:27:42 +0000 (17:27 +0100)
commit3d9683cf3bfb6d4e4605a153958dfca7e18b52f2
tree41da7cef48d4c0fa9c0d42854d1d74c6090c8875
parent4d66623cfba0949b2f0d669bd2ae732124c99ded
KVM: export <linux/kvm_para.h> and <asm/kvm_para.h> iif KVM is supported

I do not see any consistency about headers_install of <linux/kvm_para.h>
and <asm/kvm_para.h>.

According to my analysis of Linux 5.1-rc1, there are 3 groups:

 [1] Both <linux/kvm_para.h> and <asm/kvm_para.h> are exported

    alpha, arm, hexagon, mips, powerpc, s390, sparc, x86

 [2] <asm/kvm_para.h> is exported, but <linux/kvm_para.h> is not

    arc, arm64, c6x, h8300, ia64, m68k, microblaze, nios2, openrisc,
    parisc, sh, unicore32, xtensa

 [3] Neither <linux/kvm_para.h> nor <asm/kvm_para.h> is exported

    csky, nds32, riscv

This does not match to the actual KVM support. At least, [2] is
half-baked.

Nor do arch maintainers look like they care about this. For example,
commit 0add53713b1c ("microblaze: Add missing kvm_para.h to Kbuild")
exported <asm/kvm_para.h> to user-space in order to fix an in-kernel
build error.

We have two ways to make this consistent:

 [A] export both <linux/kvm_para.h> and <asm/kvm_para.h> for all
     architectures, irrespective of the KVM support

 [B] Match the header export of <linux/kvm_para.h> and <asm/kvm_para.h>
     to the KVM support

My first attempt was [A] because the code looks cleaner, but Paolo
suggested [B].

So, this commit goes with [B].

For most architectures, <asm/kvm_para.h> was moved to the kernel-space.
I changed include/uapi/linux/Kbuild so that it checks generated
asm/kvm_para.h as well as check-in ones.

After this commit, there will be two groups:

 [1] Both <linux/kvm_para.h> and <asm/kvm_para.h> are exported

    arm, arm64, mips, powerpc, s390, x86

 [2] Neither <linux/kvm_para.h> nor <asm/kvm_para.h> is exported

    alpha, arc, c6x, csky, h8300, hexagon, ia64, m68k, microblaze,
    nds32, nios2, openrisc, parisc, riscv, sh, sparc, unicore32, xtensa

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
33 files changed:
arch/alpha/include/asm/Kbuild
arch/alpha/include/uapi/asm/kvm_para.h [deleted file]
arch/arc/include/asm/Kbuild
arch/arc/include/uapi/asm/Kbuild
arch/arm/include/uapi/asm/Kbuild
arch/arm/include/uapi/asm/kvm_para.h [deleted file]
arch/c6x/include/asm/Kbuild
arch/c6x/include/uapi/asm/Kbuild
arch/h8300/include/asm/Kbuild
arch/h8300/include/uapi/asm/Kbuild
arch/hexagon/include/asm/Kbuild
arch/hexagon/include/uapi/asm/kvm_para.h [deleted file]
arch/ia64/include/asm/Kbuild
arch/ia64/include/uapi/asm/Kbuild
arch/m68k/include/asm/Kbuild
arch/m68k/include/uapi/asm/Kbuild
arch/microblaze/include/asm/Kbuild
arch/microblaze/include/uapi/asm/Kbuild
arch/nios2/include/asm/Kbuild
arch/nios2/include/uapi/asm/Kbuild
arch/openrisc/include/asm/Kbuild
arch/openrisc/include/uapi/asm/Kbuild
arch/parisc/include/asm/Kbuild
arch/parisc/include/uapi/asm/Kbuild
arch/sh/include/asm/Kbuild
arch/sh/include/uapi/asm/Kbuild
arch/sparc/include/asm/Kbuild
arch/sparc/include/uapi/asm/kvm_para.h [deleted file]
arch/unicore32/include/asm/Kbuild
arch/unicore32/include/uapi/asm/Kbuild
arch/xtensa/include/asm/Kbuild
arch/xtensa/include/uapi/asm/Kbuild
include/uapi/linux/Kbuild