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 select KVM_WERROR if WERROR 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_WERROR 63 bool "Compile KVM with -Werror" 64 # Disallow KVM's -Werror if KASAN is enabled, e.g. to guard against 65 # randomized configs from selecting KVM_WERROR=y, which doesn't play 66 # nice with KASAN. KASAN builds generates warnings for the default 67 # FRAME_WARN, i.e. KVM_WERROR=y with KASAN=y requires special tuning. 68 # Building KVM with -Werror and KASAN is still doable via enabling 69 # the kernel-wide WERROR=y. 70 depends on KVM && ((EXPERT && !KASAN) || WERROR) 71 help 72 Add -Werror to the build flags for KVM. 73 74 If in doubt, say "N". 75 76config KVM_SW_PROTECTED_VM 77 bool "Enable support for KVM software-protected VMs" 78 depends on EXPERT 79 depends on KVM && X86_64 80 select KVM_GENERIC_PRIVATE_MEM 81 help 82 Enable support for KVM software-protected VMs. Currently, software- 83 protected VMs are purely a development and testing vehicle for 84 KVM_CREATE_GUEST_MEMFD. Attempting to run a "real" VM workload as a 85 software-protected VM will fail miserably. 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 KVM_INTEL_PROVE_VE 100 bool "Check that guests do not receive #VE exceptions" 101 depends on KVM_INTEL && EXPERT 102 help 103 Checks that KVM's page table management code will not incorrectly 104 let guests receive a virtualization exception. Virtualization 105 exceptions will be trapped by the hypervisor rather than injected 106 in the guest. 107 108 Note: some CPUs appear to generate spurious EPT Violations #VEs 109 that trigger KVM's WARN, in particular with eptad=0 and/or nested 110 virtualization. 111 112 If unsure, say N. 113 114config X86_SGX_KVM 115 bool "Software Guard eXtensions (SGX) Virtualization" 116 depends on X86_SGX && KVM_INTEL 117 help 118 119 Enables KVM guests to create SGX enclaves. 120 121 This includes support to expose "raw" unreclaimable enclave memory to 122 guests via a device node, e.g. /dev/sgx_vepc. 123 124 If unsure, say N. 125 126config KVM_AMD 127 tristate "KVM for AMD processors support" 128 depends on KVM && (CPU_SUP_AMD || CPU_SUP_HYGON) 129 help 130 Provides support for KVM on AMD processors equipped with the AMD-V 131 (SVM) extensions. 132 133 To compile this as a module, choose M here: the module 134 will be called kvm-amd. 135 136config KVM_AMD_SEV 137 bool "AMD Secure Encrypted Virtualization (SEV) support" 138 default y 139 depends on KVM_AMD && X86_64 140 depends on CRYPTO_DEV_SP_PSP && !(KVM_AMD=y && CRYPTO_DEV_CCP_DD=m) 141 select ARCH_HAS_CC_PLATFORM 142 help 143 Provides support for launching Encrypted VMs (SEV) and Encrypted VMs 144 with Encrypted State (SEV-ES) on AMD processors. 145 146config KVM_SMM 147 bool "System Management Mode emulation" 148 default y 149 depends on KVM 150 help 151 Provides support for KVM to emulate System Management Mode (SMM) 152 in virtual machines. This can be used by the virtual machine 153 firmware to implement UEFI secure boot. 154 155 If unsure, say Y. 156 157config KVM_HYPERV 158 bool "Support for Microsoft Hyper-V emulation" 159 depends on KVM 160 default y 161 help 162 Provides KVM support for emulating Microsoft Hyper-V. This allows KVM 163 to expose a subset of the paravirtualized interfaces defined in the 164 Hyper-V Hypervisor Top-Level Functional Specification (TLFS): 165 https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/reference/tlfs 166 These interfaces are required for the correct and performant functioning 167 of Windows and Hyper-V guests on KVM. 168 169 If unsure, say "Y". 170 171config KVM_XEN 172 bool "Support for Xen hypercall interface" 173 depends on KVM 174 help 175 Provides KVM support for the hosting Xen HVM guests and 176 passing Xen hypercalls to userspace. 177 178 If in doubt, say "N". 179 180config KVM_PROVE_MMU 181 bool "Prove KVM MMU correctness" 182 depends on DEBUG_KERNEL 183 depends on KVM 184 depends on EXPERT 185 help 186 Enables runtime assertions in KVM's MMU that are too costly to enable 187 in anything remotely resembling a production environment, e.g. this 188 gates code that verifies a to-be-freed page table doesn't have any 189 present SPTEs. 190 191 If in doubt, say "N". 192 193config KVM_EXTERNAL_WRITE_TRACKING 194 bool 195 196config KVM_MAX_NR_VCPUS 197 int "Maximum number of vCPUs per KVM guest" 198 depends on KVM 199 range 1024 4096 200 default 4096 if MAXSMP 201 default 1024 202 help 203 Set the maximum number of vCPUs per KVM guest. Larger values will increase 204 the memory footprint of each KVM guest, regardless of how many vCPUs are 205 created for a given VM. 206 207endif # VIRTUALIZATION 208