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