GNU Linux-libre 4.14.266-gnu1
[releases.git] / arch / powerpc / kvm / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # Makefile for Kernel-based Virtual Machine module
4 #
5
6 subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
7
8 ccflags-y := -Ivirt/kvm -Iarch/powerpc/kvm
9 KVM := ../../../virt/kvm
10
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
14
15 CFLAGS_e500_mmu.o := -I.
16 CFLAGS_e500_mmu_host.o := -I.
17 CFLAGS_emulate.o  := -I.
18 CFLAGS_emulate_loadstore.o  := -I.
19
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
23
24 AFLAGS_booke_interrupts.o := -I$(objtree)/$(obj)
25
26 kvm-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
36 kvm-objs-$(CONFIG_KVM_E500V2) := $(kvm-e500-objs)
37
38 kvm-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
48 kvm-objs-$(CONFIG_KVM_E500MC) := $(kvm-e500mc-objs)
49
50 kvm-book3s_64-builtin-objs-$(CONFIG_SPAPR_TCE_IOMMU) := \
51         book3s_64_vio_hv.o
52
53 kvm-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
66 ifdef CONFIG_KVM_BOOK3S_PR_POSSIBLE
67 kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
68         book3s_rmhandlers.o
69 endif
70
71 kvm-hv-y += \
72         book3s_hv.o \
73         book3s_hv_interrupts.o \
74         book3s_64_mmu_hv.o \
75         book3s_64_mmu_radix.o
76
77 kvm-book3s_64-builtin-xics-objs-$(CONFIG_KVM_XICS) := \
78         book3s_hv_rm_xics.o book3s_hv_rm_xive.o
79
80 ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
81 kvm-book3s_64-builtin-objs-$(CONFIG_KVM_BOOK3S_64_HANDLER) += \
82         book3s_hv_hmi.o \
83         book3s_hv_rmhandlers.o \
84         book3s_hv_rm_mmu.o \
85         book3s_hv_ras.o \
86         book3s_hv_builtin.o \
87         $(kvm-book3s_64-builtin-xics-objs-y)
88 endif
89
90 kvm-book3s_64-objs-$(CONFIG_KVM_XICS) += \
91         book3s_xics.o
92
93 kvm-book3s_64-objs-$(CONFIG_KVM_XIVE) += book3s_xive.o
94 kvm-book3s_64-objs-$(CONFIG_SPAPR_TCE_IOMMU) += book3s_64_vio.o
95
96 kvm-book3s_64-module-objs := \
97         $(common-objs-y) \
98         book3s.o \
99         book3s_rtas.o \
100         $(kvm-book3s_64-objs-y)
101
102 kvm-objs-$(CONFIG_KVM_BOOK3S_64) := $(kvm-book3s_64-module-objs)
103
104 kvm-book3s_32-objs := \
105         $(common-objs-y) \
106         emulate.o \
107         fpu.o \
108         book3s_paired_singles.o \
109         book3s.o \
110         book3s_pr.o \
111         book3s_emulate.o \
112         book3s_interrupts.o \
113         book3s_mmu_hpte.o \
114         book3s_32_mmu_host.o \
115         book3s_32_mmu.o
116 kvm-objs-$(CONFIG_KVM_BOOK3S_32) := $(kvm-book3s_32-objs)
117
118 kvm-objs-$(CONFIG_KVM_MPIC) += mpic.o
119 kvm-objs-$(CONFIG_HAVE_KVM_IRQ_ROUTING) += $(KVM)/irqchip.o
120
121 kvm-objs := $(kvm-objs-m) $(kvm-objs-y)
122
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
127
128 obj-$(CONFIG_KVM_BOOK3S_64_PR) += kvm-pr.o
129 obj-$(CONFIG_KVM_BOOK3S_64_HV) += kvm-hv.o
130
131 obj-y += $(kvm-book3s_64-builtin-objs-y)