xref: /linux/arch/x86/kvm/Makefile (revision 955abe0a1b41de5ba61fe4cd614ebc123084d499)
1# SPDX-License-Identifier: GPL-2.0
2
3ccflags-y += -I $(srctree)/arch/x86/kvm
4ccflags-$(CONFIG_KVM_WERROR) += -Werror
5
6include $(srctree)/virt/kvm/Makefile.kvm
7
8kvm-y			+= x86.o emulate.o i8259.o irq.o lapic.o \
9			   i8254.o ioapic.o irq_comm.o cpuid.o pmu.o mtrr.o \
10			   debugfs.o mmu/mmu.o mmu/page_track.o \
11			   mmu/spte.o
12
13kvm-$(CONFIG_X86_64) += mmu/tdp_iter.o mmu/tdp_mmu.o
14kvm-$(CONFIG_KVM_HYPERV) += hyperv.o
15kvm-$(CONFIG_KVM_XEN)	+= xen.o
16kvm-$(CONFIG_KVM_SMM)	+= smm.o
17
18kvm-intel-y		+= vmx/vmx.o vmx/vmenter.o vmx/pmu_intel.o vmx/vmcs12.o \
19			   vmx/nested.o vmx/posted_intr.o vmx/main.o
20
21kvm-intel-$(CONFIG_X86_SGX_KVM)	+= vmx/sgx.o
22kvm-intel-$(CONFIG_KVM_HYPERV)	+= vmx/hyperv.o vmx/hyperv_evmcs.o
23
24kvm-amd-y		+= svm/svm.o svm/vmenter.o svm/pmu.o svm/nested.o svm/avic.o
25
26kvm-amd-$(CONFIG_KVM_AMD_SEV)	+= svm/sev.o
27kvm-amd-$(CONFIG_KVM_HYPERV)	+= svm/hyperv.o
28
29ifdef CONFIG_HYPERV
30kvm-y			+= kvm_onhyperv.o
31kvm-intel-y		+= vmx/vmx_onhyperv.o vmx/hyperv_evmcs.o
32kvm-amd-y		+= svm/svm_onhyperv.o
33endif
34
35obj-$(CONFIG_KVM)	+= kvm.o
36obj-$(CONFIG_KVM_INTEL)	+= kvm-intel.o
37obj-$(CONFIG_KVM_AMD)	+= kvm-amd.o
38
39AFLAGS_svm/vmenter.o    := -iquote $(obj)
40$(obj)/svm/vmenter.o: $(obj)/kvm-asm-offsets.h
41
42AFLAGS_vmx/vmenter.o    := -iquote $(obj)
43$(obj)/vmx/vmenter.o: $(obj)/kvm-asm-offsets.h
44
45$(obj)/kvm-asm-offsets.h: $(obj)/kvm-asm-offsets.s FORCE
46	$(call filechk,offsets,__KVM_ASM_OFFSETS_H__)
47
48targets += kvm-asm-offsets.s
49clean-files += kvm-asm-offsets.h
50