1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 2bbf45ba5SHollis Blanchard# 3bbf45ba5SHollis Blanchard# KVM configuration 4bbf45ba5SHollis Blanchard# 5bbf45ba5SHollis Blanchard 60ba12d10SAvi Kivitysource "virt/kvm/Kconfig" 75d9b8e30SAvi Kivity 8bbf45ba5SHollis Blanchardmenuconfig VIRTUALIZATION 9bbf45ba5SHollis Blanchard bool "Virtualization" 10a7f7f624SMasahiro Yamada help 11bbf45ba5SHollis Blanchard Say Y here to get to see options for using your Linux host to run 12bbf45ba5SHollis Blanchard other operating systems inside virtual machines (guests). 13bbf45ba5SHollis Blanchard This option alone does not add any kernel code. 14bbf45ba5SHollis Blanchard 15bbf45ba5SHollis Blanchard If you say N, all options in this submenu will be skipped and 16bbf45ba5SHollis Blanchard disabled. 17bbf45ba5SHollis Blanchard 18bbf45ba5SHollis Blanchardif VIRTUALIZATION 19bbf45ba5SHollis Blanchard 20bbf45ba5SHollis Blanchardconfig KVM 2174ef740dSHollis Blanchard bool 22caadf876SPaolo Bonzini select KVM_COMMON 234b3d173dSPaul Mackerras select KVM_VFIO 249576730dSSuresh Warrier select HAVE_KVM_IRQ_BYPASS 2574ef740dSHollis Blanchard 26c14dea04SAlexander Grafconfig KVM_BOOK3S_HANDLER 27c14dea04SAlexander Graf bool 28c14dea04SAlexander Graf 294f841390SAlexander Grafconfig KVM_BOOK3S_32_HANDLER 304f841390SAlexander Graf bool 314f841390SAlexander Graf select KVM_BOOK3S_HANDLER 32de56a948SPaul Mackerras select KVM_MMIO 334f841390SAlexander Graf 34c4f9c779SAlexander Grafconfig KVM_BOOK3S_64_HANDLER 35c4f9c779SAlexander Graf bool 36c14dea04SAlexander Graf select KVM_BOOK3S_HANDLER 37c4f9c779SAlexander Graf 387aa79938SAneesh Kumar K.Vconfig KVM_BOOK3S_PR_POSSIBLE 39de56a948SPaul Mackerras bool 40de56a948SPaul Mackerras select KVM_MMIO 41f128cf8cSSean Christopherson select KVM_GENERIC_MMU_NOTIFIER 42de56a948SPaul Mackerras 439975f5e3SAneesh Kumar K.Vconfig KVM_BOOK3S_HV_POSSIBLE 449975f5e3SAneesh Kumar K.V bool 459975f5e3SAneesh Kumar K.V 464f841390SAlexander Grafconfig KVM_BOOK3S_32 474f841390SAlexander Graf tristate "KVM support for PowerPC book3s_32 processors" 4807ff8b53SKees Cook depends on PPC_BOOK3S_32 && !SMP && !PTE_64BIT 49e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 504f841390SAlexander Graf select KVM 514f841390SAlexander Graf select KVM_BOOK3S_32_HANDLER 527aa79938SAneesh Kumar K.V select KVM_BOOK3S_PR_POSSIBLE 5327f69957SChristophe Leroy select PPC_FPU 54a7f7f624SMasahiro Yamada help 554f841390SAlexander Graf Support running unmodified book3s_32 guest kernels 564f841390SAlexander Graf in virtual machines on book3s_32 host processors. 574f841390SAlexander Graf 584f841390SAlexander Graf This module provides access to the hardware capabilities through 594f841390SAlexander Graf a character device node named /dev/kvm. 604f841390SAlexander Graf 614f841390SAlexander Graf If unsure, say N. 624f841390SAlexander Graf 63c4f9c779SAlexander Grafconfig KVM_BOOK3S_64 64c4f9c779SAlexander Graf tristate "KVM support for PowerPC book3s_64 processors" 6507ff8b53SKees Cook depends on PPC_BOOK3S_64 66c4f9c779SAlexander Graf select KVM_BOOK3S_64_HANDLER 67de56a948SPaul Mackerras select KVM 689975f5e3SAneesh Kumar K.V select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE 69c2857374SNicholas Piggin select PPC_64S_HASH_MMU 7057ea5f16SUlf Magnusson select SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_PSERIES || PPC_POWERNV) 71a7f7f624SMasahiro Yamada help 72c4f9c779SAlexander Graf Support running unmodified book3s_64 and book3s_32 guest kernels 73c4f9c779SAlexander Graf in virtual machines on book3s_64 host processors. 74c4f9c779SAlexander Graf 75c4f9c779SAlexander Graf This module provides access to the hardware capabilities through 76c4f9c779SAlexander Graf a character device node named /dev/kvm. 77c4f9c779SAlexander Graf 78c4f9c779SAlexander Graf If unsure, say N. 79c4f9c779SAlexander Graf 80de56a948SPaul Mackerrasconfig KVM_BOOK3S_64_HV 81129fd423SThomas Huth tristate "KVM for POWER7 and later using hypervisor mode in host" 82a7e73e71SShreyas B. Prabhu depends on KVM_BOOK3S_64 && PPC_POWERNV 839975f5e3SAneesh Kumar K.V select KVM_BOOK3S_HV_POSSIBLE 84f128cf8cSSean Christopherson select KVM_GENERIC_MMU_NOTIFIER 85*ff45bf50SVaibhav Jain select KVM_BOOK3S_HV_PMU 86fa61a4e3SAneesh Kumar K.V select CMA 87a7f7f624SMasahiro Yamada help 88de56a948SPaul Mackerras Support running unmodified book3s_64 guest kernels in 89129fd423SThomas Huth virtual machines on POWER7 and newer processors that have 909e368f29SPaul Mackerras hypervisor mode available to the host. 91de56a948SPaul Mackerras 92de56a948SPaul Mackerras If you say Y here, KVM will use the hardware virtualization 93de56a948SPaul Mackerras facilities of POWER7 (and later) processors, meaning that 94de56a948SPaul Mackerras guest operating systems will run at full hardware speed 95de56a948SPaul Mackerras using supervisor and user modes. However, this also means 96de56a948SPaul Mackerras that KVM is not usable under PowerVM (pHyp), is only usable 97129fd423SThomas Huth on POWER7 or later processors, and cannot emulate a 98129fd423SThomas Huth different processor from the host processor. 99de56a948SPaul Mackerras 100de56a948SPaul Mackerras If unsure, say N. 101de56a948SPaul Mackerras 102de56a948SPaul Mackerrasconfig KVM_BOOK3S_64_PR 1032ba9f0d8SAneesh Kumar K.V tristate "KVM support without using hypervisor mode in host" 1042ba9f0d8SAneesh Kumar K.V depends on KVM_BOOK3S_64 105e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 1067aa79938SAneesh Kumar K.V select KVM_BOOK3S_PR_POSSIBLE 107a7f7f624SMasahiro Yamada help 1089975f5e3SAneesh Kumar K.V Support running guest kernels in virtual machines on processors 1099975f5e3SAneesh Kumar K.V without using hypervisor mode in the host, by running the 1109975f5e3SAneesh Kumar K.V guest in user mode (problem state) and emulating all 1119975f5e3SAneesh Kumar K.V privileged instructions and registers. 1129975f5e3SAneesh Kumar K.V 113b5149e22SNicholas Piggin This is only available for hash MMU mode and only supports 114b5149e22SNicholas Piggin guests that use hash MMU mode. 115b5149e22SNicholas Piggin 1169975f5e3SAneesh Kumar K.V This is not as fast as using hypervisor mode, but works on 1179975f5e3SAneesh Kumar K.V machines where hypervisor mode is not available or not usable, 1189975f5e3SAneesh Kumar K.V and can emulate processors that are different from the host 1199975f5e3SAneesh Kumar K.V processor, including emulating 32-bit processors on a 64-bit 1209975f5e3SAneesh Kumar K.V host. 121de56a948SPaul Mackerras 122b5149e22SNicholas Piggin Selecting this option will cause the SCV facility to be 123b5149e22SNicholas Piggin disabled when the kernel is booted on the pseries platform in 124b5149e22SNicholas Piggin hash MMU mode (regardless of PR VMs running). When any PR VMs 125b5149e22SNicholas Piggin are running, "AIL" mode is disabled which may slow interrupts 126b5149e22SNicholas Piggin and system calls on the host. 127b5149e22SNicholas Piggin 128b6c295dfSPaul Mackerrasconfig KVM_BOOK3S_HV_EXIT_TIMING 1293f8ed993SFabiano Rosas bool 1303f8ed993SFabiano Rosas 131c3fa64c9SFabiano Rosasconfig KVM_BOOK3S_HV_P9_TIMING 132c3fa64c9SFabiano Rosas bool "Detailed timing for the P9 entry point" 133c3fa64c9SFabiano Rosas select KVM_BOOK3S_HV_EXIT_TIMING 134c3fa64c9SFabiano Rosas depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS 135c3fa64c9SFabiano Rosas help 136b44bb1b7SFabiano Rosas Calculate time taken for each vcpu during vcpu entry and 137b44bb1b7SFabiano Rosas exit, time spent inside the guest and time spent handling 138b44bb1b7SFabiano Rosas hypercalls and page faults. The total, minimum and maximum 139b44bb1b7SFabiano Rosas times in nanoseconds together with the number of executions 140b44bb1b7SFabiano Rosas are reported in debugfs in kvm/vm#/vcpu#/timings. 141c3fa64c9SFabiano Rosas 142c3fa64c9SFabiano Rosas If unsure, say N. 143c3fa64c9SFabiano Rosas 1443f8ed993SFabiano Rosasconfig KVM_BOOK3S_HV_P8_TIMING 1453f8ed993SFabiano Rosas bool "Detailed timing for hypervisor real-mode code (for POWER8)" 1463f8ed993SFabiano Rosas select KVM_BOOK3S_HV_EXIT_TIMING 147c3fa64c9SFabiano Rosas depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS && !KVM_BOOK3S_HV_P9_TIMING 148a7f7f624SMasahiro Yamada help 149b6c295dfSPaul Mackerras Calculate time taken for each vcpu in the real-mode guest entry, 150b6c295dfSPaul Mackerras exit, and interrupt handling code, plus time spent in the guest 151b6c295dfSPaul Mackerras and in nap mode due to idle (cede) while other threads are still 152b6c295dfSPaul Mackerras in the guest. The total, minimum and maximum times in nanoseconds 153b6c295dfSPaul Mackerras together with the number of executions are reported in debugfs in 154b6c295dfSPaul Mackerras kvm/vm#/vcpu#/timings. The overhead is of the order of 30 - 40 155b6c295dfSPaul Mackerras ns per exit on POWER8. 156b6c295dfSPaul Mackerras 157b6c295dfSPaul Mackerras If unsure, say N. 158b6c295dfSPaul Mackerras 159d3c8a2d3SNicholas Pigginconfig KVM_BOOK3S_HV_NESTED_PMU_WORKAROUND 160d3c8a2d3SNicholas Piggin bool "Nested L0 host workaround for L1 KVM host PMU handling bug" if EXPERT 161d3c8a2d3SNicholas Piggin depends on KVM_BOOK3S_HV_POSSIBLE 162d3c8a2d3SNicholas Piggin default !EXPERT 163d3c8a2d3SNicholas Piggin help 164d3c8a2d3SNicholas Piggin Old nested HV capable Linux guests have a bug where they don't 165d3c8a2d3SNicholas Piggin reflect the PMU in-use status of their L2 guest to the L0 host 166d3c8a2d3SNicholas Piggin while the L2 PMU registers are live. This can result in loss 167d3c8a2d3SNicholas Piggin of L2 PMU register state, causing perf to not work correctly in 168d3c8a2d3SNicholas Piggin L2 guests. 169d3c8a2d3SNicholas Piggin 170d3c8a2d3SNicholas Piggin Selecting this option for the L0 host implements a workaround for 171d3c8a2d3SNicholas Piggin those buggy L1s which saves the L2 state, at the cost of performance 172d3c8a2d3SNicholas Piggin in all nested-capable guest entry/exit. 173d3c8a2d3SNicholas Piggin 174*ff45bf50SVaibhav Jainconfig KVM_BOOK3S_HV_PMU 175*ff45bf50SVaibhav Jain tristate "Hypervisor Perf events for KVM Book3s-HV" 176*ff45bf50SVaibhav Jain depends on KVM_BOOK3S_64_HV 177*ff45bf50SVaibhav Jain help 178*ff45bf50SVaibhav Jain Enable Book3s-HV Hypervisor Perf events PMU named 'kvm-hv'. These 179*ff45bf50SVaibhav Jain Perf events give an overview of hypervisor performance overall 180*ff45bf50SVaibhav Jain instead of a specific guests. Currently the PMU reports 181*ff45bf50SVaibhav Jain L0-Hypervisor stats on a kvm-hv enabled PSeries LPAR like: 182*ff45bf50SVaibhav Jain * Total/Used Guest-Heap 183*ff45bf50SVaibhav Jain * Total/Used Guest Page-table Memory 184*ff45bf50SVaibhav Jain * Total amount of Guest Page-table Memory reclaimed 185*ff45bf50SVaibhav Jain 186d30f6e48SScott Woodconfig KVM_BOOKE_HV 187d30f6e48SScott Wood bool 188d30f6e48SScott Wood 18973e75b41SHollis Blanchardconfig KVM_EXIT_TIMING 19073e75b41SHollis Blanchard bool "Detailed exit timing" 191b2677b8dSAlexander Graf depends on KVM_E500V2 || KVM_E500MC 192a7f7f624SMasahiro Yamada help 19373e75b41SHollis Blanchard Calculate elapsed time for every exit/enter cycle. A per-vcpu 19473e75b41SHollis Blanchard report is available in debugfs kvm/vm#_vcpu#_timing. 19573e75b41SHollis Blanchard The overhead is relatively small, however it is not recommended for 19673e75b41SHollis Blanchard production environments. 19773e75b41SHollis Blanchard 19873e75b41SHollis Blanchard If unsure, say N. 19973e75b41SHollis Blanchard 200bf7ca4bdSAlexander Grafconfig KVM_E500V2 201bf7ca4bdSAlexander Graf bool "KVM support for PowerPC E500v2 processors" 202688de017SChristophe Leroy depends on PPC_E500 && !PPC_E500MC 203e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 204bc8080cbSHollis Blanchard select KVM 205de56a948SPaul Mackerras select KVM_MMIO 206f128cf8cSSean Christopherson select KVM_GENERIC_MMU_NOTIFIER 207a7f7f624SMasahiro Yamada help 208bc8080cbSHollis Blanchard Support running unmodified E500 guest kernels in virtual machines on 209bf7ca4bdSAlexander Graf E500v2 host processors. 210bc8080cbSHollis Blanchard 211bc8080cbSHollis Blanchard This module provides access to the hardware capabilities through 212bc8080cbSHollis Blanchard a character device node named /dev/kvm. 213bc8080cbSHollis Blanchard 214bc8080cbSHollis Blanchard If unsure, say N. 215bc8080cbSHollis Blanchard 21673196cd3SScott Woodconfig KVM_E500MC 217d9ce6041SMihai Caraman bool "KVM support for PowerPC E500MC/E5500/E6500 processors" 21807ff8b53SKees Cook depends on PPC_E500MC 219e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 22073196cd3SScott Wood select KVM 22173196cd3SScott Wood select KVM_MMIO 22273196cd3SScott Wood select KVM_BOOKE_HV 223f128cf8cSSean Christopherson select KVM_GENERIC_MMU_NOTIFIER 224a7f7f624SMasahiro Yamada help 225d9ce6041SMihai Caraman Support running unmodified E500MC/E5500/E6500 guest kernels in 226d9ce6041SMihai Caraman virtual machines on E500MC/E5500/E6500 host processors. 22773196cd3SScott Wood 22873196cd3SScott Wood This module provides access to the hardware capabilities through 22973196cd3SScott Wood a character device node named /dev/kvm. 23073196cd3SScott Wood 23173196cd3SScott Wood If unsure, say N. 23273196cd3SScott Wood 2335df554adSScott Woodconfig KVM_MPIC 2345df554adSScott Wood bool "KVM in-kernel MPIC emulation" 235688de017SChristophe Leroy depends on KVM && PPC_E500 236de9ba2f3SAlexander Graf select HAVE_KVM_IRQCHIP 237de9ba2f3SAlexander Graf select HAVE_KVM_IRQ_ROUTING 238de9ba2f3SAlexander Graf select HAVE_KVM_MSI 2395df554adSScott Wood help 2405df554adSScott Wood Enable support for emulating MPIC devices inside the 2415df554adSScott Wood host kernel, rather than relying on userspace to emulate. 2425df554adSScott Wood Currently, support is limited to certain versions of 2435df554adSScott Wood Freescale's MPIC implementation. 2445df554adSScott Wood 245bc5ad3f3SBenjamin Herrenschmidtconfig KVM_XICS 246bc5ad3f3SBenjamin Herrenschmidt bool "KVM in-kernel XICS emulation" 247bc5ad3f3SBenjamin Herrenschmidt depends on KVM_BOOK3S_64 && !KVM_MPIC 24825a2150bSPaul Mackerras select HAVE_KVM_IRQCHIP 249476ce5efSAnton Blanchard default y 250a7f7f624SMasahiro Yamada help 251bc5ad3f3SBenjamin Herrenschmidt Include support for the XICS (eXternal Interrupt Controller 252bc5ad3f3SBenjamin Herrenschmidt Specification) interrupt controller architecture used on 253bc5ad3f3SBenjamin Herrenschmidt IBM POWER (pSeries) servers. 254bc5ad3f3SBenjamin Herrenschmidt 2555af50993SBenjamin Herrenschmidtconfig KVM_XIVE 2565af50993SBenjamin Herrenschmidt bool 2575af50993SBenjamin Herrenschmidt default y 2585af50993SBenjamin Herrenschmidt depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE 2595af50993SBenjamin Herrenschmidt 260bbf45ba5SHollis Blanchardendif # VIRTUALIZATION 261