1 # SPDX-License-Identifier: GPL-2.0
3 # Makefile for Kernel-based Virtual Machine module
6 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
8 ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm
9 KVM := ../../../virt/kvm
11 common-objs-y = $(KVM)/kvm_main.o $(KVM)/eventfd.o
12 common-objs-$(CONFIG_KVM_VFIO) += $(KVM)/vfio.o
13 common-objs-$(CONFIG_KVM_MMIO) += $(KVM)/coalesced_mmio.o
15 CFLAGS_e500_mmu.o := -I.
16 CFLAGS_e500_mmu_host.o := -I.
17 CFLAGS_emulate.o := -I.
18 CFLAGS_emulate_loadstore.o := -I.
20 common-objs-y += powerpc.o emulate_loadstore.o
21 obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
22 obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o
24 AFLAGS_booke_interrupts.o := -I$(objtree)/$(obj)
36 kvm-objs-$(CONFIG_KVM_E500V2) := $(kvm-e500-objs)
43 bookehv_interrupts.o \
48 kvm-objs-$(CONFIG_KVM_E500MC) := $(kvm-e500mc-objs)
50 kvm-book3s_64-builtin-objs-$(CONFIG_SPAPR_TCE_IOMMU) := \
56 book3s_paired_singles.o \
62 book3s_64_mmu_host.o \
66 ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
67 kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
73 book3s_hv_interrupts.o \
77 kvm-book3s_64-builtin-xics-objs-$(CONFIG_KVM_XICS) := \
78 book3s_hv_rm_xics.o book3s_hv_rm_xive.o
80 ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
81 kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
83 book3s_hv_rmhandlers.o \
87 $(kvm-book3s_64-builtin-xics-objs-y)
90 kvm-book3s_64-objs-$(CONFIG_KVM_XICS) += \
93 kvm-book3s_64-objs-$(CONFIG_KVM_XIVE) += book3s_xive.o
94 kvm-book3s_64-objs-$(CONFIG_SPAPR_TCE_IOMMU) += book3s_64_vio.o
96 kvm-book3s_64-module-objs := \
100 $(kvm-book3s_64-objs-y)
102 kvm-objs-$(CONFIG_KVM_BOOK3S_64) := $(kvm-book3s_64-module-objs)
104 kvm-book3s_32-objs := \
108 book3s_paired_singles.o \
112 book3s_interrupts.o \
114 book3s_32_mmu_host.o \
116 kvm-objs-$(CONFIG_KVM_BOOK3S_32) := $(kvm-book3s_32-objs)
118 kvm-objs-$(CONFIG_KVM_MPIC) += mpic.o
119 kvm-objs-$(CONFIG_HAVE_KVM_IRQ_ROUTING) += $(KVM)/irqchip.o
121 kvm-objs := $(kvm-objs-m) $(kvm-objs-y)
123 obj-$(CONFIG_KVM_E500V2) += kvm.o
124 obj-$(CONFIG_KVM_E500MC) += kvm.o
125 obj-$(CONFIG_KVM_BOOK3S_64) += kvm.o
126 obj-$(CONFIG_KVM_BOOK3S_32) += kvm.o
128 obj-$(CONFIG_KVM_BOOK3S_64_PR) += kvm-pr.o
129 obj-$(CONFIG_KVM_BOOK3S_64_HV) += kvm-hv.o
131 obj-y += $(kvm-book3s_64-builtin-objs-y)