1# SPDX-License-Identifier: GPL-2.0 2# 3# KVM configuration 4# 5 6source "virt/kvm/Kconfig" 7 8menuconfig VIRTUALIZATION 9 bool "Virtualization" 10 help 11 Say Y here to get to see options for using your Linux host to run 12 other operating systems inside virtual machines (guests). 13 This option alone does not add any kernel code. 14 15 If you say N, all options in this submenu will be skipped and 16 disabled. 17 18if VIRTUALIZATION 19 20config KVM 21 bool 22 select KVM_COMMON 23 select KVM_VFIO 24 select HAVE_KVM_IRQ_BYPASS 25 select VIRT_XFER_TO_GUEST_WORK 26 27config KVM_BOOK3S_HANDLER 28 bool 29 30config KVM_BOOK3S_32_HANDLER 31 bool 32 select KVM_BOOK3S_HANDLER 33 select KVM_MMIO 34 35config KVM_BOOK3S_64_HANDLER 36 bool 37 select KVM_BOOK3S_HANDLER 38 39config KVM_BOOK3S_PR_POSSIBLE 40 bool 41 select KVM_MMIO 42 43config KVM_BOOK3S_HV_POSSIBLE 44 bool 45 46config KVM_BOOK3S_32 47 tristate "KVM support for PowerPC book3s_32 processors" 48 depends on PPC_BOOK3S_32 && !SMP && !PTE_64BIT 49 depends on !CONTEXT_TRACKING_USER 50 select KVM 51 select KVM_BOOK3S_32_HANDLER 52 select KVM_BOOK3S_PR_POSSIBLE 53 select PPC_FPU 54 help 55 Support running unmodified book3s_32 guest kernels 56 in virtual machines on book3s_32 host processors. 57 58 This module provides access to the hardware capabilities through 59 a character device node named /dev/kvm. 60 61 If unsure, say N. 62 63config KVM_BOOK3S_64 64 tristate "KVM support for PowerPC book3s_64 processors" 65 depends on PPC_BOOK3S_64 66 select KVM_BOOK3S_64_HANDLER 67 select KVM 68 select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE 69 select PPC_64S_HASH_MMU 70 select SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_PSERIES || PPC_POWERNV) 71 help 72 Support running unmodified book3s_64 and book3s_32 guest kernels 73 in virtual machines on book3s_64 host processors. 74 75 This module provides access to the hardware capabilities through 76 a character device node named /dev/kvm. 77 78 If unsure, say N. 79 80config KVM_BOOK3S_64_HV 81 tristate "KVM for POWER7 and later using hypervisor mode in host" 82 depends on KVM_BOOK3S_64 && PPC_POWERNV 83 select KVM_BOOK3S_HV_POSSIBLE 84 select KVM_BOOK3S_HV_PMU 85 select CMA 86 help 87 Support running unmodified book3s_64 guest kernels in 88 virtual machines on POWER7 and newer processors that have 89 hypervisor mode available to the host. 90 91 If you say Y here, KVM will use the hardware virtualization 92 facilities of POWER7 (and later) processors, meaning that 93 guest operating systems will run at full hardware speed 94 using supervisor and user modes. However, this also means 95 that KVM is not usable under PowerVM (pHyp), is only usable 96 on POWER7 or later processors, and cannot emulate a 97 different processor from the host processor. 98 99 If unsure, say N. 100 101config KVM_BOOK3S_64_PR 102 tristate "KVM support without using hypervisor mode in host" 103 depends on KVM_BOOK3S_64 104 depends on !CONTEXT_TRACKING_USER 105 select KVM_BOOK3S_PR_POSSIBLE 106 help 107 Support running guest kernels in virtual machines on processors 108 without using hypervisor mode in the host, by running the 109 guest in user mode (problem state) and emulating all 110 privileged instructions and registers. 111 112 This is only available for hash MMU mode and only supports 113 guests that use hash MMU mode. 114 115 This is not as fast as using hypervisor mode, but works on 116 machines where hypervisor mode is not available or not usable, 117 and can emulate processors that are different from the host 118 processor, including emulating 32-bit processors on a 64-bit 119 host. 120 121 Selecting this option will cause the SCV facility to be 122 disabled when the kernel is booted on the pseries platform in 123 hash MMU mode (regardless of PR VMs running). When any PR VMs 124 are running, "AIL" mode is disabled which may slow interrupts 125 and system calls on the host. 126 127config KVM_BOOK3S_HV_EXIT_TIMING 128 bool 129 130config KVM_BOOK3S_HV_P9_TIMING 131 bool "Detailed timing for the P9 entry point" 132 select KVM_BOOK3S_HV_EXIT_TIMING 133 depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS 134 help 135 Calculate time taken for each vcpu during vcpu entry and 136 exit, time spent inside the guest and time spent handling 137 hypercalls and page faults. The total, minimum and maximum 138 times in nanoseconds together with the number of executions 139 are reported in debugfs in kvm/vm#/vcpu#/timings. 140 141 If unsure, say N. 142 143config KVM_BOOK3S_HV_P8_TIMING 144 bool "Detailed timing for hypervisor real-mode code (for POWER8)" 145 select KVM_BOOK3S_HV_EXIT_TIMING 146 depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS && !KVM_BOOK3S_HV_P9_TIMING 147 help 148 Calculate time taken for each vcpu in the real-mode guest entry, 149 exit, and interrupt handling code, plus time spent in the guest 150 and in nap mode due to idle (cede) while other threads are still 151 in the guest. The total, minimum and maximum times in nanoseconds 152 together with the number of executions are reported in debugfs in 153 kvm/vm#/vcpu#/timings. The overhead is of the order of 30 - 40 154 ns per exit on POWER8. 155 156 If unsure, say N. 157 158config KVM_BOOK3S_HV_NESTED_PMU_WORKAROUND 159 bool "Nested L0 host workaround for L1 KVM host PMU handling bug" if EXPERT 160 depends on KVM_BOOK3S_HV_POSSIBLE 161 default !EXPERT 162 help 163 Old nested HV capable Linux guests have a bug where they don't 164 reflect the PMU in-use status of their L2 guest to the L0 host 165 while the L2 PMU registers are live. This can result in loss 166 of L2 PMU register state, causing perf to not work correctly in 167 L2 guests. 168 169 Selecting this option for the L0 host implements a workaround for 170 those buggy L1s which saves the L2 state, at the cost of performance 171 in all nested-capable guest entry/exit. 172 173config KVM_BOOK3S_HV_PMU 174 tristate "Hypervisor Perf events for KVM Book3s-HV" 175 depends on KVM_BOOK3S_64_HV 176 help 177 Enable Book3s-HV Hypervisor Perf events PMU named 'kvm-hv'. These 178 Perf events give an overview of hypervisor performance overall 179 instead of a specific guests. Currently the PMU reports 180 L0-Hypervisor stats on a kvm-hv enabled PSeries LPAR like: 181 * Total/Used Guest-Heap 182 * Total/Used Guest Page-table Memory 183 * Total amount of Guest Page-table Memory reclaimed 184 185config KVM_BOOKE_HV 186 bool 187 188config KVM_EXIT_TIMING 189 bool "Detailed exit timing" 190 depends on KVM_E500V2 || KVM_E500MC 191 help 192 Calculate elapsed time for every exit/enter cycle. A per-vcpu 193 report is available in debugfs kvm/vm#_vcpu#_timing. 194 The overhead is relatively small, however it is not recommended for 195 production environments. 196 197 If unsure, say N. 198 199config KVM_E500V2 200 bool "KVM support for PowerPC E500v2 processors" 201 depends on PPC_E500 && !PPC_E500MC 202 depends on !CONTEXT_TRACKING_USER 203 select KVM 204 select KVM_MMIO 205 help 206 Support running unmodified E500 guest kernels in virtual machines on 207 E500v2 host processors. 208 209 This module provides access to the hardware capabilities through 210 a character device node named /dev/kvm. 211 212 If unsure, say N. 213 214config KVM_E500MC 215 bool "KVM support for PowerPC E500MC/E5500/E6500 processors" 216 depends on PPC_E500MC 217 depends on !CONTEXT_TRACKING_USER 218 select KVM 219 select KVM_MMIO 220 select KVM_BOOKE_HV 221 help 222 Support running unmodified E500MC/E5500/E6500 guest kernels in 223 virtual machines on E500MC/E5500/E6500 host processors. 224 225 This module provides access to the hardware capabilities through 226 a character device node named /dev/kvm. 227 228 If unsure, say N. 229 230config KVM_MPIC 231 bool "KVM in-kernel MPIC emulation" 232 depends on KVM && PPC_E500 233 select HAVE_KVM_IRQCHIP 234 select HAVE_KVM_IRQ_ROUTING 235 select HAVE_KVM_MSI 236 help 237 Enable support for emulating MPIC devices inside the 238 host kernel, rather than relying on userspace to emulate. 239 Currently, support is limited to certain versions of 240 Freescale's MPIC implementation. 241 242config KVM_XICS 243 bool "KVM in-kernel XICS emulation" 244 depends on KVM_BOOK3S_64 && !KVM_MPIC 245 select HAVE_KVM_IRQCHIP 246 default y 247 help 248 Include support for the XICS (eXternal Interrupt Controller 249 Specification) interrupt controller architecture used on 250 IBM POWER (pSeries) servers. 251 252config KVM_XIVE 253 bool 254 default y 255 depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE 256 257endif # VIRTUALIZATION 258