xref: /openbmc/linux/arch/powerpc/kvm/Makefile (revision 31af04cd)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for Kernel-based Virtual Machine module
4#
5
6ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm
7KVM := ../../../virt/kvm
8
9common-objs-y = $(KVM)/kvm_main.o $(KVM)/eventfd.o
10common-objs-$(CONFIG_KVM_VFIO) += $(KVM)/vfio.o
11common-objs-$(CONFIG_KVM_MMIO) += $(KVM)/coalesced_mmio.o
12
13CFLAGS_e500_mmu.o := -I.
14CFLAGS_e500_mmu_host.o := -I.
15CFLAGS_emulate.o  := -I.
16CFLAGS_emulate_loadstore.o  := -I.
17
18common-objs-y += powerpc.o emulate_loadstore.o
19obj-$(CONFIG_KVM_EXIT_TIMING) += timing.o
20obj-$(CONFIG_KVM_BOOK3S_HANDLER) += book3s_exports.o
21
22AFLAGS_booke_interrupts.o := -I$(objtree)/$(obj)
23
24kvm-e500-objs := \
25	$(common-objs-y) \
26	emulate.o \
27	booke.o \
28	booke_emulate.o \
29	booke_interrupts.o \
30	e500.o \
31	e500_mmu.o \
32	e500_mmu_host.o \
33	e500_emulate.o
34kvm-objs-$(CONFIG_KVM_E500V2) := $(kvm-e500-objs)
35
36kvm-e500mc-objs := \
37	$(common-objs-y) \
38	emulate.o \
39	booke.o \
40	booke_emulate.o \
41	bookehv_interrupts.o \
42	e500mc.o \
43	e500_mmu.o \
44	e500_mmu_host.o \
45	e500_emulate.o
46kvm-objs-$(CONFIG_KVM_E500MC) := $(kvm-e500mc-objs)
47
48kvm-book3s_64-builtin-objs-$(CONFIG_SPAPR_TCE_IOMMU) := \
49	book3s_64_vio_hv.o
50
51kvm-pr-y := \
52	fpu.o \
53	emulate.o \
54	book3s_paired_singles.o \
55	book3s_pr.o \
56	book3s_pr_papr.o \
57	book3s_emulate.o \
58	book3s_interrupts.o \
59	book3s_mmu_hpte.o \
60	book3s_64_mmu_host.o \
61	book3s_64_mmu.o \
62	book3s_32_mmu.o
63
64kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
65	tm.o
66
67ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
68kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
69	book3s_rmhandlers.o
70endif
71
72kvm-hv-y += \
73	book3s_hv.o \
74	book3s_hv_interrupts.o \
75	book3s_64_mmu_hv.o \
76	book3s_64_mmu_radix.o \
77	book3s_hv_nested.o
78
79kvm-hv-$(CONFIG_PPC_TRANSACTIONAL_MEM) += \
80	book3s_hv_tm.o
81
82kvm-book3s_64-builtin-xics-objs-$(CONFIG_KVM_XICS) := \
83	book3s_hv_rm_xics.o book3s_hv_rm_xive.o
84
85kvm-book3s_64-builtin-tm-objs-$(CONFIG_PPC_TRANSACTIONAL_MEM) += \
86	book3s_hv_tm_builtin.o
87
88ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
89kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
90	book3s_hv_hmi.o \
91	book3s_hv_rmhandlers.o \
92	book3s_hv_rm_mmu.o \
93	book3s_hv_ras.o \
94	book3s_hv_builtin.o \
95	$(kvm-book3s_64-builtin-tm-objs-y) \
96	$(kvm-book3s_64-builtin-xics-objs-y)
97endif
98
99kvm-book3s_64-objs-$(CONFIG_KVM_XICS) += \
100	book3s_xics.o
101
102kvm-book3s_64-objs-$(CONFIG_KVM_XIVE) += book3s_xive.o
103kvm-book3s_64-objs-$(CONFIG_SPAPR_TCE_IOMMU) += book3s_64_vio.o
104
105kvm-book3s_64-module-objs := \
106	$(common-objs-y) \
107	book3s.o \
108	book3s_rtas.o \
109	$(kvm-book3s_64-objs-y)
110
111kvm-objs-$(CONFIG_KVM_BOOK3S_64) := $(kvm-book3s_64-module-objs)
112
113kvm-book3s_32-objs := \
114	$(common-objs-y) \
115	emulate.o \
116	fpu.o \
117	book3s_paired_singles.o \
118	book3s.o \
119	book3s_pr.o \
120	book3s_emulate.o \
121	book3s_interrupts.o \
122	book3s_mmu_hpte.o \
123	book3s_32_mmu_host.o \
124	book3s_32_mmu.o
125kvm-objs-$(CONFIG_KVM_BOOK3S_32) := $(kvm-book3s_32-objs)
126
127kvm-objs-$(CONFIG_KVM_MPIC) += mpic.o
128kvm-objs-$(CONFIG_HAVE_KVM_IRQ_ROUTING) += $(KVM)/irqchip.o
129
130kvm-objs := $(kvm-objs-m) $(kvm-objs-y)
131
132obj-$(CONFIG_KVM_E500V2) += kvm.o
133obj-$(CONFIG_KVM_E500MC) += kvm.o
134obj-$(CONFIG_KVM_BOOK3S_64) += kvm.o
135obj-$(CONFIG_KVM_BOOK3S_32) += kvm.o
136
137obj-$(CONFIG_KVM_BOOK3S_64_PR) += kvm-pr.o
138obj-$(CONFIG_KVM_BOOK3S_64_HV) += kvm-hv.o
139
140obj-y += $(kvm-book3s_64-builtin-objs-y)
141