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