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