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