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