xref: /linux/arch/x86/kvm/Kconfig (revision ab93e0dd72c37d378dd936f031ffb83ff2bd87ce)
1# SPDX-License-Identifier: GPL-2.0
2#
3# KVM configuration
4#
5
6source "virt/kvm/Kconfig"
7
8menuconfig VIRTUALIZATION
9	bool "Virtualization"
10	default y
11	help
12	  Say Y here to get to see options for using your Linux host to run other
13	  operating systems inside virtual machines (guests).
14	  This option alone does not add any kernel code.
15
16	  If you say N, all options in this submenu will be skipped and disabled.
17
18if VIRTUALIZATION
19
20config KVM_X86
21	def_tristate KVM if (KVM_INTEL != n || KVM_AMD != n)
22	select KVM_COMMON
23	select KVM_GENERIC_MMU_NOTIFIER
24	select KVM_ELIDE_TLB_FLUSH_IF_YOUNG
25	select KVM_MMU_LOCKLESS_AGING
26	select HAVE_KVM_IRQCHIP
27	select HAVE_KVM_PFNCACHE
28	select HAVE_KVM_DIRTY_RING_TSO
29	select HAVE_KVM_DIRTY_RING_ACQ_REL
30	select HAVE_KVM_IRQ_BYPASS
31	select HAVE_KVM_IRQ_ROUTING
32	select HAVE_KVM_READONLY_MEM
33	select VHOST_TASK
34	select KVM_ASYNC_PF
35	select USER_RETURN_NOTIFIER
36	select KVM_MMIO
37	select SCHED_INFO
38	select PERF_EVENTS
39	select GUEST_PERF_EVENTS
40	select HAVE_KVM_MSI
41	select HAVE_KVM_CPU_RELAX_INTERCEPT
42	select HAVE_KVM_NO_POLL
43	select KVM_XFER_TO_GUEST_WORK
44	select KVM_GENERIC_DIRTYLOG_READ_PROTECT
45	select KVM_VFIO
46	select HAVE_KVM_PM_NOTIFIER if PM
47	select KVM_GENERIC_HARDWARE_ENABLING
48	select KVM_GENERIC_PRE_FAULT_MEMORY
49	select KVM_GENERIC_PRIVATE_MEM if KVM_SW_PROTECTED_VM
50	select KVM_WERROR if WERROR
51
52config KVM
53	tristate "Kernel-based Virtual Machine (KVM) support"
54	depends on X86_LOCAL_APIC
55	help
56	  Support hosting fully virtualized guest machines using hardware
57	  virtualization extensions.  You will need a fairly recent
58	  processor equipped with virtualization extensions. You will also
59	  need to select one or more of the processor modules below.
60
61	  This module provides access to the hardware capabilities through
62	  a character device node named /dev/kvm.
63
64	  To compile this as a module, choose M here: the module
65	  will be called kvm.
66
67	  If unsure, say N.
68
69config KVM_WERROR
70	bool "Compile KVM with -Werror"
71	# Disallow KVM's -Werror if KASAN is enabled, e.g. to guard against
72	# randomized configs from selecting KVM_WERROR=y, which doesn't play
73	# nice with KASAN.  KASAN builds generates warnings for the default
74	# FRAME_WARN, i.e. KVM_WERROR=y with KASAN=y requires special tuning.
75	# Building KVM with -Werror and KASAN is still doable via enabling
76	# the kernel-wide WERROR=y.
77	depends on KVM && ((EXPERT && !KASAN) || WERROR)
78	help
79	  Add -Werror to the build flags for KVM.
80
81	  If in doubt, say "N".
82
83config KVM_SW_PROTECTED_VM
84	bool "Enable support for KVM software-protected VMs"
85	depends on EXPERT
86	depends on KVM && X86_64
87	help
88	  Enable support for KVM software-protected VMs.  Currently, software-
89	  protected VMs are purely a development and testing vehicle for
90	  KVM_CREATE_GUEST_MEMFD.  Attempting to run a "real" VM workload as a
91	  software-protected VM will fail miserably.
92
93	  If unsure, say "N".
94
95config KVM_INTEL
96	tristate "KVM for Intel (and compatible) processors support"
97	depends on KVM && IA32_FEAT_CTL
98	select KVM_GENERIC_PRIVATE_MEM if INTEL_TDX_HOST
99	select KVM_GENERIC_MEMORY_ATTRIBUTES if INTEL_TDX_HOST
100	help
101	  Provides support for KVM on processors equipped with Intel's VT
102	  extensions, a.k.a. Virtual Machine Extensions (VMX).
103
104	  To compile this as a module, choose M here: the module
105	  will be called kvm-intel.
106
107config KVM_INTEL_PROVE_VE
108        bool "Check that guests do not receive #VE exceptions"
109        depends on KVM_INTEL && EXPERT
110        help
111          Checks that KVM's page table management code will not incorrectly
112          let guests receive a virtualization exception.  Virtualization
113          exceptions will be trapped by the hypervisor rather than injected
114          in the guest.
115
116          Note: some CPUs appear to generate spurious EPT Violations #VEs
117          that trigger KVM's WARN, in particular with eptad=0 and/or nested
118          virtualization.
119
120          If unsure, say N.
121
122config X86_SGX_KVM
123	bool "Software Guard eXtensions (SGX) Virtualization"
124	depends on X86_SGX && KVM_INTEL
125	help
126
127	  Enables KVM guests to create SGX enclaves.
128
129	  This includes support to expose "raw" unreclaimable enclave memory to
130	  guests via a device node, e.g. /dev/sgx_vepc.
131
132	  If unsure, say N.
133
134config KVM_INTEL_TDX
135	bool "Intel Trust Domain Extensions (TDX) support"
136	default y
137	depends on INTEL_TDX_HOST
138	help
139	  Provides support for launching Intel Trust Domain Extensions (TDX)
140	  confidential VMs on Intel processors.
141
142	  If unsure, say N.
143
144config KVM_AMD
145	tristate "KVM for AMD processors support"
146	depends on KVM && (CPU_SUP_AMD || CPU_SUP_HYGON)
147	help
148	  Provides support for KVM on AMD processors equipped with the AMD-V
149	  (SVM) extensions.
150
151	  To compile this as a module, choose M here: the module
152	  will be called kvm-amd.
153
154config KVM_AMD_SEV
155	bool "AMD Secure Encrypted Virtualization (SEV) support"
156	default y
157	depends on KVM_AMD && X86_64
158	depends on CRYPTO_DEV_SP_PSP && !(KVM_AMD=y && CRYPTO_DEV_CCP_DD=m)
159	select ARCH_HAS_CC_PLATFORM
160	select KVM_GENERIC_PRIVATE_MEM
161	select HAVE_KVM_ARCH_GMEM_PREPARE
162	select HAVE_KVM_ARCH_GMEM_INVALIDATE
163	help
164	  Provides support for launching encrypted VMs which use Secure
165	  Encrypted Virtualization (SEV), Secure Encrypted Virtualization with
166	  Encrypted State (SEV-ES), and Secure Encrypted Virtualization with
167	  Secure Nested Paging (SEV-SNP) technologies on AMD processors.
168
169config KVM_IOAPIC
170	bool "I/O APIC, PIC, and PIT emulation"
171	default y
172	depends on KVM
173	help
174	  Provides support for KVM to emulate an I/O APIC, PIC, and PIT, i.e.
175	  for full in-kernel APIC emulation.
176
177	  If unsure, say Y.
178
179config KVM_SMM
180	bool "System Management Mode emulation"
181	default y
182	depends on KVM
183	help
184	  Provides support for KVM to emulate System Management Mode (SMM)
185	  in virtual machines.  This can be used by the virtual machine
186	  firmware to implement UEFI secure boot.
187
188	  If unsure, say Y.
189
190config KVM_HYPERV
191	bool "Support for Microsoft Hyper-V emulation"
192	depends on KVM
193	default y
194	help
195	  Provides KVM support for emulating Microsoft Hyper-V.  This allows KVM
196	  to expose a subset of the paravirtualized interfaces defined in the
197	  Hyper-V Hypervisor Top-Level Functional Specification (TLFS):
198	  https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs
199	  These interfaces are required for the correct and performant functioning
200	  of Windows and Hyper-V guests on KVM.
201
202	  If unsure, say "Y".
203
204config KVM_XEN
205	bool "Support for Xen hypercall interface"
206	depends on KVM
207	help
208	  Provides KVM support for the hosting Xen HVM guests and
209	  passing Xen hypercalls to userspace.
210
211	  If in doubt, say "N".
212
213config KVM_PROVE_MMU
214	bool "Prove KVM MMU correctness"
215	depends on DEBUG_KERNEL
216	depends on KVM
217	depends on EXPERT
218	help
219	  Enables runtime assertions in KVM's MMU that are too costly to enable
220	  in anything remotely resembling a production environment, e.g. this
221	  gates code that verifies a to-be-freed page table doesn't have any
222	  present SPTEs.
223
224	  If in doubt, say "N".
225
226config KVM_EXTERNAL_WRITE_TRACKING
227	bool
228
229config KVM_MAX_NR_VCPUS
230	int "Maximum number of vCPUs per KVM guest"
231	depends on KVM
232	range 1024 4096
233	default 4096 if MAXSMP
234	default 1024
235	help
236	  Set the maximum number of vCPUs per KVM guest. Larger values will increase
237	  the memory footprint of each KVM guest, regardless of how many vCPUs are
238	  created for a given VM.
239
240endif # VIRTUALIZATION
241