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 22*caadf876SPaolo Bonzini select KVM_COMMON 235cb0944cSPaolo Bonzini select HAVE_KVM_VCPU_ASYNC_IOCTL 244b3d173dSPaul Mackerras select KVM_VFIO 259576730dSSuresh Warrier select HAVE_KVM_IRQ_BYPASS 2674ef740dSHollis Blanchard 27c14dea04SAlexander Grafconfig KVM_BOOK3S_HANDLER 28c14dea04SAlexander Graf bool 29c14dea04SAlexander Graf 304f841390SAlexander Grafconfig KVM_BOOK3S_32_HANDLER 314f841390SAlexander Graf bool 324f841390SAlexander Graf select KVM_BOOK3S_HANDLER 33de56a948SPaul Mackerras select KVM_MMIO 344f841390SAlexander Graf 35c4f9c779SAlexander Grafconfig KVM_BOOK3S_64_HANDLER 36c4f9c779SAlexander Graf bool 37c14dea04SAlexander Graf select KVM_BOOK3S_HANDLER 38c4f9c779SAlexander Graf 397aa79938SAneesh Kumar K.Vconfig KVM_BOOK3S_PR_POSSIBLE 40de56a948SPaul Mackerras bool 41de56a948SPaul Mackerras select KVM_MMIO 42f128cf8cSSean Christopherson select KVM_GENERIC_MMU_NOTIFIER 43de56a948SPaul Mackerras 449975f5e3SAneesh Kumar K.Vconfig KVM_BOOK3S_HV_POSSIBLE 459975f5e3SAneesh Kumar K.V bool 469975f5e3SAneesh Kumar K.V 474f841390SAlexander Grafconfig KVM_BOOK3S_32 484f841390SAlexander Graf tristate "KVM support for PowerPC book3s_32 processors" 4907ff8b53SKees Cook depends on PPC_BOOK3S_32 && !SMP && !PTE_64BIT 50e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 514f841390SAlexander Graf select KVM 524f841390SAlexander Graf select KVM_BOOK3S_32_HANDLER 537aa79938SAneesh Kumar K.V select KVM_BOOK3S_PR_POSSIBLE 5427f69957SChristophe Leroy select PPC_FPU 55a7f7f624SMasahiro Yamada help 564f841390SAlexander Graf Support running unmodified book3s_32 guest kernels 574f841390SAlexander Graf in virtual machines on book3s_32 host processors. 584f841390SAlexander Graf 594f841390SAlexander Graf This module provides access to the hardware capabilities through 604f841390SAlexander Graf a character device node named /dev/kvm. 614f841390SAlexander Graf 624f841390SAlexander Graf If unsure, say N. 634f841390SAlexander Graf 64c4f9c779SAlexander Grafconfig KVM_BOOK3S_64 65c4f9c779SAlexander Graf tristate "KVM support for PowerPC book3s_64 processors" 6607ff8b53SKees Cook depends on PPC_BOOK3S_64 67c4f9c779SAlexander Graf select KVM_BOOK3S_64_HANDLER 68de56a948SPaul Mackerras select KVM 699975f5e3SAneesh Kumar K.V select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE 70c2857374SNicholas Piggin select PPC_64S_HASH_MMU 7157ea5f16SUlf Magnusson select SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_PSERIES || PPC_POWERNV) 72a7f7f624SMasahiro Yamada help 73c4f9c779SAlexander Graf Support running unmodified book3s_64 and book3s_32 guest kernels 74c4f9c779SAlexander Graf in virtual machines on book3s_64 host processors. 75c4f9c779SAlexander Graf 76c4f9c779SAlexander Graf This module provides access to the hardware capabilities through 77c4f9c779SAlexander Graf a character device node named /dev/kvm. 78c4f9c779SAlexander Graf 79c4f9c779SAlexander Graf If unsure, say N. 80c4f9c779SAlexander Graf 81de56a948SPaul Mackerrasconfig KVM_BOOK3S_64_HV 82129fd423SThomas Huth tristate "KVM for POWER7 and later using hypervisor mode in host" 83a7e73e71SShreyas B. Prabhu depends on KVM_BOOK3S_64 && PPC_POWERNV 849975f5e3SAneesh Kumar K.V select KVM_BOOK3S_HV_POSSIBLE 85f128cf8cSSean Christopherson select KVM_GENERIC_MMU_NOTIFIER 86fa61a4e3SAneesh Kumar K.V select KVM_BOOK3S_HV_PMU 87a7f7f624SMasahiro Yamada select CMA 88de56a948SPaul Mackerras help 89129fd423SThomas Huth Support running unmodified book3s_64 guest kernels in 909e368f29SPaul Mackerras virtual machines on POWER7 and newer processors that have 91de56a948SPaul Mackerras hypervisor mode available to the host. 92de56a948SPaul Mackerras 93de56a948SPaul Mackerras If you say Y here, KVM will use the hardware virtualization 94de56a948SPaul Mackerras facilities of POWER7 (and later) processors, meaning that 95de56a948SPaul Mackerras guest operating systems will run at full hardware speed 96de56a948SPaul Mackerras using supervisor and user modes. However, this also means 97129fd423SThomas Huth that KVM is not usable under PowerVM (pHyp), is only usable 98129fd423SThomas Huth on POWER7 or later processors, and cannot emulate a 99de56a948SPaul Mackerras different processor from the host processor. 100de56a948SPaul Mackerras 101de56a948SPaul Mackerras If unsure, say N. 102de56a948SPaul Mackerras 1032ba9f0d8SAneesh Kumar K.Vconfig KVM_BOOK3S_64_PR 1042ba9f0d8SAneesh Kumar K.V tristate "KVM support without using hypervisor mode in host" 105e59b3399SNicholas Piggin depends on KVM_BOOK3S_64 1067aa79938SAneesh Kumar K.V depends on !CONTEXT_TRACKING_USER 107a7f7f624SMasahiro Yamada select KVM_BOOK3S_PR_POSSIBLE 1089975f5e3SAneesh Kumar K.V help 1099975f5e3SAneesh Kumar K.V Support running guest kernels in virtual machines on processors 1109975f5e3SAneesh Kumar K.V without using hypervisor mode in the host, by running the 1119975f5e3SAneesh Kumar K.V guest in user mode (problem state) and emulating all 1129975f5e3SAneesh Kumar K.V privileged instructions and registers. 113b5149e22SNicholas Piggin 114b5149e22SNicholas Piggin This is only available for hash MMU mode and only supports 115b5149e22SNicholas Piggin guests that use hash MMU mode. 1169975f5e3SAneesh Kumar K.V 1179975f5e3SAneesh Kumar K.V This is not as fast as using hypervisor mode, but works on 1189975f5e3SAneesh Kumar K.V machines where hypervisor mode is not available or not usable, 1199975f5e3SAneesh Kumar K.V and can emulate processors that are different from the host 1209975f5e3SAneesh Kumar K.V processor, including emulating 32-bit processors on a 64-bit 121de56a948SPaul Mackerras host. 122b5149e22SNicholas Piggin 123b5149e22SNicholas Piggin Selecting this option will cause the SCV facility to be 124b5149e22SNicholas Piggin disabled when the kernel is booted on the pseries platform in 125b5149e22SNicholas Piggin hash MMU mode (regardless of PR VMs running). When any PR VMs 126b5149e22SNicholas Piggin are running, "AIL" mode is disabled which may slow interrupts 127b5149e22SNicholas Piggin and system calls on the host. 128b6c295dfSPaul Mackerras 1293f8ed993SFabiano Rosasconfig KVM_BOOK3S_HV_EXIT_TIMING 1303f8ed993SFabiano Rosas bool 131c3fa64c9SFabiano Rosas 132c3fa64c9SFabiano Rosasconfig KVM_BOOK3S_HV_P9_TIMING 133c3fa64c9SFabiano Rosas bool "Detailed timing for the P9 entry point" 134c3fa64c9SFabiano Rosas select KVM_BOOK3S_HV_EXIT_TIMING 135c3fa64c9SFabiano Rosas depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS 136b44bb1b7SFabiano Rosas help 137b44bb1b7SFabiano Rosas Calculate time taken for each vcpu during vcpu entry and 138b44bb1b7SFabiano Rosas exit, time spent inside the guest and time spent handling 139b44bb1b7SFabiano Rosas hypercalls and page faults. The total, minimum and maximum 140b44bb1b7SFabiano Rosas times in nanoseconds together with the number of executions 141c3fa64c9SFabiano Rosas are reported in debugfs in kvm/vm#/vcpu#/timings. 142c3fa64c9SFabiano Rosas 143c3fa64c9SFabiano Rosas If unsure, say N. 1443f8ed993SFabiano Rosas 1453f8ed993SFabiano Rosasconfig KVM_BOOK3S_HV_P8_TIMING 1463f8ed993SFabiano Rosas bool "Detailed timing for hypervisor real-mode code (for POWER8)" 147c3fa64c9SFabiano Rosas select KVM_BOOK3S_HV_EXIT_TIMING 148a7f7f624SMasahiro Yamada depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS && !KVM_BOOK3S_HV_P9_TIMING 149b6c295dfSPaul Mackerras help 150b6c295dfSPaul Mackerras Calculate time taken for each vcpu in the real-mode guest entry, 151b6c295dfSPaul Mackerras exit, and interrupt handling code, plus time spent in the guest 152b6c295dfSPaul Mackerras and in nap mode due to idle (cede) while other threads are still 153b6c295dfSPaul Mackerras in the guest. The total, minimum and maximum times in nanoseconds 154b6c295dfSPaul Mackerras together with the number of executions are reported in debugfs in 155b6c295dfSPaul Mackerras kvm/vm#/vcpu#/timings. The overhead is of the order of 30 - 40 156b6c295dfSPaul Mackerras ns per exit on POWER8. 157b6c295dfSPaul Mackerras 158b6c295dfSPaul Mackerras If unsure, say N. 159d3c8a2d3SNicholas Piggin 160d3c8a2d3SNicholas Pigginconfig KVM_BOOK3S_HV_NESTED_PMU_WORKAROUND 161d3c8a2d3SNicholas Piggin bool "Nested L0 host workaround for L1 KVM host PMU handling bug" if EXPERT 162d3c8a2d3SNicholas Piggin depends on KVM_BOOK3S_HV_POSSIBLE 163d3c8a2d3SNicholas Piggin default !EXPERT 164d3c8a2d3SNicholas Piggin help 165d3c8a2d3SNicholas Piggin Old nested HV capable Linux guests have a bug where they don't 166d3c8a2d3SNicholas Piggin reflect the PMU in-use status of their L2 guest to the L0 host 167d3c8a2d3SNicholas Piggin while the L2 PMU registers are live. This can result in loss 168d3c8a2d3SNicholas Piggin of L2 PMU register state, causing perf to not work correctly in 169d3c8a2d3SNicholas Piggin L2 guests. 170d3c8a2d3SNicholas Piggin 171d3c8a2d3SNicholas Piggin Selecting this option for the L0 host implements a workaround for 172d3c8a2d3SNicholas Piggin those buggy L1s which saves the L2 state, at the cost of performance 173d3c8a2d3SNicholas Piggin in all nested-capable guest entry/exit. 174d30f6e48SScott Wood 175d30f6e48SScott Woodconfig KVM_BOOK3S_HV_PMU 176d30f6e48SScott Wood tristate "Hypervisor Perf events for KVM Book3s-HV" 17773e75b41SHollis Blanchard depends on KVM_BOOK3S_64_HV 17873e75b41SHollis Blanchard help 179b2677b8dSAlexander Graf Enable Book3s-HV Hypervisor Perf events PMU named 'kvm-hv'. These 180a7f7f624SMasahiro Yamada Perf events give an overview of hypervisor performance overall 18173e75b41SHollis Blanchard instead of a specific guests. Currently the PMU reports 18273e75b41SHollis Blanchard L0-Hypervisor stats on a kvm-hv enabled PSeries LPAR like: 18373e75b41SHollis Blanchard * Total/Used Guest-Heap 18473e75b41SHollis Blanchard * Total/Used Guest Page-table Memory 18573e75b41SHollis Blanchard * Total amount of Guest Page-table Memory reclaimed 18673e75b41SHollis Blanchard 18773e75b41SHollis Blanchardconfig KVM_BOOKE_HV 188bf7ca4bdSAlexander Graf bool 189bf7ca4bdSAlexander Graf 190688de017SChristophe Leroyconfig KVM_EXIT_TIMING 191e59b3399SNicholas Piggin bool "Detailed exit timing" 192bc8080cbSHollis Blanchard depends on KVM_E500V2 || KVM_E500MC 193de56a948SPaul Mackerras help 194f128cf8cSSean Christopherson Calculate elapsed time for every exit/enter cycle. A per-vcpu 195a7f7f624SMasahiro Yamada report is available in debugfs kvm/vm#_vcpu#_timing. 196bc8080cbSHollis Blanchard The overhead is relatively small, however it is not recommended for 197bf7ca4bdSAlexander Graf production environments. 198bc8080cbSHollis Blanchard 199bc8080cbSHollis Blanchard If unsure, say N. 200bc8080cbSHollis Blanchard 201bc8080cbSHollis Blanchardconfig KVM_E500V2 202bc8080cbSHollis Blanchard bool "KVM support for PowerPC E500v2 processors" 203bc8080cbSHollis Blanchard depends on PPC_E500 && !PPC_E500MC 20473196cd3SScott Wood depends on !CONTEXT_TRACKING_USER 205d9ce6041SMihai Caraman select KVM 20607ff8b53SKees Cook select KVM_MMIO 207e59b3399SNicholas Piggin select KVM_GENERIC_MMU_NOTIFIER 20873196cd3SScott Wood help 20973196cd3SScott Wood Support running unmodified E500 guest kernels in virtual machines on 21073196cd3SScott Wood E500v2 host processors. 211f128cf8cSSean Christopherson 212a7f7f624SMasahiro Yamada This module provides access to the hardware capabilities through 213d9ce6041SMihai Caraman a character device node named /dev/kvm. 214d9ce6041SMihai Caraman 21573196cd3SScott Wood If unsure, say N. 21673196cd3SScott Wood 21773196cd3SScott Woodconfig KVM_E500MC 21873196cd3SScott Wood bool "KVM support for PowerPC E500MC/E5500/E6500 processors" 21973196cd3SScott Wood depends on PPC_E500MC 22073196cd3SScott Wood depends on !CONTEXT_TRACKING_USER 2215df554adSScott Wood select KVM 2225df554adSScott Wood select KVM_MMIO 223688de017SChristophe Leroy select KVM_BOOKE_HV 224de9ba2f3SAlexander Graf select KVM_GENERIC_MMU_NOTIFIER 225de9ba2f3SAlexander Graf help 226de9ba2f3SAlexander Graf Support running unmodified E500MC/E5500/E6500 guest kernels in 2275df554adSScott Wood virtual machines on E500MC/E5500/E6500 host processors. 2285df554adSScott Wood 2295df554adSScott Wood This module provides access to the hardware capabilities through 2305df554adSScott Wood a character device node named /dev/kvm. 2315df554adSScott Wood 2325df554adSScott Wood If unsure, say N. 233bc5ad3f3SBenjamin Herrenschmidt 234bc5ad3f3SBenjamin Herrenschmidtconfig KVM_MPIC 235bc5ad3f3SBenjamin Herrenschmidt bool "KVM in-kernel MPIC emulation" 23625a2150bSPaul Mackerras depends on KVM && PPC_E500 237476ce5efSAnton Blanchard select HAVE_KVM_IRQCHIP 238a7f7f624SMasahiro Yamada select HAVE_KVM_IRQ_ROUTING 239bc5ad3f3SBenjamin Herrenschmidt select HAVE_KVM_MSI 240bc5ad3f3SBenjamin Herrenschmidt help 241bc5ad3f3SBenjamin Herrenschmidt Enable support for emulating MPIC devices inside the 242bc5ad3f3SBenjamin Herrenschmidt host kernel, rather than relying on userspace to emulate. 2435af50993SBenjamin Herrenschmidt Currently, support is limited to certain versions of 2445af50993SBenjamin Herrenschmidt Freescale's MPIC implementation. 2455af50993SBenjamin Herrenschmidt 2465af50993SBenjamin Herrenschmidtconfig KVM_XICS 2475af50993SBenjamin Herrenschmidt bool "KVM in-kernel XICS emulation" 248bbf45ba5SHollis Blanchard depends on KVM_BOOK3S_64 && !KVM_MPIC 249 select HAVE_KVM_IRQCHIP 250 default y 251 help 252 Include support for the XICS (eXternal Interrupt Controller 253 Specification) interrupt controller architecture used on 254 IBM POWER (pSeries) servers. 255 256config KVM_XIVE 257 bool 258 default y 259 depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE 260 261endif # VIRTUALIZATION 262