]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
KVM: PPC: Always select KVM_VFIO, plus Makefile cleanup
authorPaul Mackerras <paulus@ozlabs.org>
Thu, 27 Oct 2016 14:24:04 +0000 (08:24 -0600)
committerLuis Henriques <luis.henriques@canonical.com>
Tue, 8 Nov 2016 16:46:57 +0000 (16:46 +0000)
BugLink: http://bugs.launchpad.net/bugs/1630554
As discussed recently on the kvm mailing list, David Gibson's
intention in commit 178a78750212 ("vfio: Enable VFIO device for
powerpc", 2016-02-01) was to have the KVM VFIO device built in
on all powerpc platforms.  This patch adds the "select KVM_VFIO"
statement that makes this happen.

Currently, arch/powerpc/kvm/Makefile doesn't include vfio.o for
the 64-bit kvm module, because the list of objects doesn't use
the $(common-objs-y) list.  The reason it doesn't is because we
don't necessarily want coalesced_mmio.o or emulate.o (for example
if HV KVM is the only target), and common-objs-y includes both.

Since this is confusing, this patch adjusts the definitions so that
we now use $(common-objs-y) in the list for the 64-bit kvm.ko
module, emulate.o is removed from common-objs-y and added in the
places that need it, and the inclusion of coalesced_mmio.o now
depends on CONFIG_KVM_MMIO.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
(back ported from commit 4b3d173d0440d37534906b6d93c02dfb577c68ce)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
 Conflicts:
arch/powerpc/kvm/Makefile
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
arch/powerpc/kvm/Kconfig
arch/powerpc/kvm/Makefile

index c2024ac9d4e859963c1c15408824b98baa3e92c3..c0a2478a8a2c1fa10d7de9459c6c656cabfa90f2 100644 (file)
@@ -22,6 +22,7 @@ config KVM
        select ANON_INODES
        select HAVE_KVM_EVENTFD
        select SRCU
+       select KVM_VFIO
 
 config KVM_BOOK3S_HANDLER
        bool
index 0570eef83fba59f2e1613c0db8571bd92e2da992..c65d89642b01a1f7f0774a5284796ff4c9c8e138 100644 (file)
@@ -7,15 +7,16 @@ subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
 ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm
 KVM := ../../../virt/kvm
 
-common-objs-y = $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
-               $(KVM)/eventfd.o
+common-objs-y = $(KVM)/kvm_main.o $(KVM)/eventfd.o
+common-objs-$(CONFIG_KVM_VFIO) += $(KVM)/vfio.o
+common-objs-$(CONFIG_KVM_MMIO) += $(KVM)/coalesced_mmio.o
 
 CFLAGS_e500_mmu.o := -I.
 CFLAGS_e500_mmu_host.o := -I.
 CFLAGS_emulate.o  := -I.
 CFLAGS_emulate_loadstore.o  := -I.
 
-common-objs-y += powerpc.o emulate.o emulate_loadstore.o
+common-objs-y += powerpc.o emulate_loadstore.o
 obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
 obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o
 
@@ -23,6 +24,7 @@ AFLAGS_booke_interrupts.o := -I$(obj)
 
 kvm-e500-objs := \
        $(common-objs-y) \
+       emulate.o \
        booke.o \
        booke_emulate.o \
        booke_interrupts.o \
@@ -34,6 +36,7 @@ kvm-objs-$(CONFIG_KVM_E500V2) := $(kvm-e500-objs)
 
 kvm-e500mc-objs := \
        $(common-objs-y) \
+       emulate.o \
        booke.o \
        booke_emulate.o \
        bookehv_interrupts.o \
@@ -60,9 +63,6 @@ kvm-pr-y := \
        book3s_32_mmu.o
 
 ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
-kvm-book3s_64-module-objs := \
-       $(KVM)/coalesced_mmio.o
-
 kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
        book3s_rmhandlers.o
 endif
@@ -87,11 +87,8 @@ endif
 kvm-book3s_64-objs-$(CONFIG_KVM_XICS) += \
        book3s_xics.o
 
-kvm-book3s_64-module-objs += \
-       $(KVM)/kvm_main.o \
-       $(KVM)/eventfd.o \
-       powerpc.o \
-       emulate_loadstore.o \
+kvm-book3s_64-module-objs := \
+       $(common-objs-y) \
        book3s.o \
        book3s_64_vio.o \
        book3s_rtas.o \
@@ -101,6 +98,7 @@ kvm-objs-$(CONFIG_KVM_BOOK3S_64) := $(kvm-book3s_64-module-objs)
 
 kvm-book3s_32-objs := \
        $(common-objs-y) \
+       emulate.o \
        fpu.o \
        book3s_paired_singles.o \
        book3s.o \