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