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 22bbf45ba5SHollis Blanchard select PREEMPT_NOTIFIERS 230e673fb6SAlexander Graf select HAVE_KVM_EVENTFD 245cb0944cSPaolo Bonzini select HAVE_KVM_VCPU_ASYNC_IOCTL 254b3d173dSPaul Mackerras select KVM_VFIO 269576730dSSuresh Warrier select IRQ_BYPASS_MANAGER 279576730dSSuresh Warrier select HAVE_KVM_IRQ_BYPASS 28ed922739SMaciej S. Szmigiero select INTERVAL_TREE 2974ef740dSHollis Blanchard 30c14dea04SAlexander Grafconfig KVM_BOOK3S_HANDLER 31c14dea04SAlexander Graf bool 32c14dea04SAlexander Graf 334f841390SAlexander Grafconfig KVM_BOOK3S_32_HANDLER 344f841390SAlexander Graf bool 354f841390SAlexander Graf select KVM_BOOK3S_HANDLER 36de56a948SPaul Mackerras select KVM_MMIO 374f841390SAlexander Graf 38c4f9c779SAlexander Grafconfig KVM_BOOK3S_64_HANDLER 39c4f9c779SAlexander Graf bool 40c14dea04SAlexander Graf select KVM_BOOK3S_HANDLER 41c4f9c779SAlexander Graf 427aa79938SAneesh Kumar K.Vconfig KVM_BOOK3S_PR_POSSIBLE 43de56a948SPaul Mackerras bool 44de56a948SPaul Mackerras select KVM_MMIO 459b0cb3c8SAlexander Graf select MMU_NOTIFIER 46de56a948SPaul Mackerras 479975f5e3SAneesh Kumar K.Vconfig KVM_BOOK3S_HV_POSSIBLE 489975f5e3SAneesh Kumar K.V bool 499975f5e3SAneesh Kumar K.V 504f841390SAlexander Grafconfig KVM_BOOK3S_32 514f841390SAlexander Graf tristate "KVM support for PowerPC book3s_32 processors" 5207ff8b53SKees Cook depends on PPC_BOOK3S_32 && !SMP && !PTE_64BIT 53*e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 544f841390SAlexander Graf select KVM 554f841390SAlexander Graf select KVM_BOOK3S_32_HANDLER 567aa79938SAneesh Kumar K.V select KVM_BOOK3S_PR_POSSIBLE 5727f69957SChristophe Leroy select PPC_FPU 58a7f7f624SMasahiro Yamada help 594f841390SAlexander Graf Support running unmodified book3s_32 guest kernels 604f841390SAlexander Graf in virtual machines on book3s_32 host processors. 614f841390SAlexander Graf 624f841390SAlexander Graf This module provides access to the hardware capabilities through 634f841390SAlexander Graf a character device node named /dev/kvm. 644f841390SAlexander Graf 654f841390SAlexander Graf If unsure, say N. 664f841390SAlexander Graf 67c4f9c779SAlexander Grafconfig KVM_BOOK3S_64 68c4f9c779SAlexander Graf tristate "KVM support for PowerPC book3s_64 processors" 6907ff8b53SKees Cook depends on PPC_BOOK3S_64 70c4f9c779SAlexander Graf select KVM_BOOK3S_64_HANDLER 71de56a948SPaul Mackerras select KVM 729975f5e3SAneesh Kumar K.V select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE 73c2857374SNicholas Piggin select PPC_64S_HASH_MMU 7457ea5f16SUlf Magnusson select SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_PSERIES || PPC_POWERNV) 75a7f7f624SMasahiro Yamada help 76c4f9c779SAlexander Graf Support running unmodified book3s_64 and book3s_32 guest kernels 77c4f9c779SAlexander Graf in virtual machines on book3s_64 host processors. 78c4f9c779SAlexander Graf 79c4f9c779SAlexander Graf This module provides access to the hardware capabilities through 80c4f9c779SAlexander Graf a character device node named /dev/kvm. 81c4f9c779SAlexander Graf 82c4f9c779SAlexander Graf If unsure, say N. 83c4f9c779SAlexander Graf 84de56a948SPaul Mackerrasconfig KVM_BOOK3S_64_HV 85129fd423SThomas Huth tristate "KVM for POWER7 and later using hypervisor mode in host" 86a7e73e71SShreyas B. Prabhu depends on KVM_BOOK3S_64 && PPC_POWERNV 879975f5e3SAneesh Kumar K.V select KVM_BOOK3S_HV_POSSIBLE 88342d3db7SPaul Mackerras select MMU_NOTIFIER 89fa61a4e3SAneesh Kumar K.V select CMA 90a7f7f624SMasahiro Yamada help 91de56a948SPaul Mackerras Support running unmodified book3s_64 guest kernels in 92129fd423SThomas Huth virtual machines on POWER7 and newer processors that have 939e368f29SPaul Mackerras hypervisor mode available to the host. 94de56a948SPaul Mackerras 95de56a948SPaul Mackerras If you say Y here, KVM will use the hardware virtualization 96de56a948SPaul Mackerras facilities of POWER7 (and later) processors, meaning that 97de56a948SPaul Mackerras guest operating systems will run at full hardware speed 98de56a948SPaul Mackerras using supervisor and user modes. However, this also means 99de56a948SPaul Mackerras that KVM is not usable under PowerVM (pHyp), is only usable 100129fd423SThomas Huth on POWER7 or later processors, and cannot emulate a 101129fd423SThomas Huth different processor from the host processor. 102de56a948SPaul Mackerras 103de56a948SPaul Mackerras If unsure, say N. 104de56a948SPaul Mackerras 105de56a948SPaul Mackerrasconfig KVM_BOOK3S_64_PR 1062ba9f0d8SAneesh Kumar K.V tristate "KVM support without using hypervisor mode in host" 1072ba9f0d8SAneesh Kumar K.V depends on KVM_BOOK3S_64 108*e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 1097aa79938SAneesh Kumar K.V select KVM_BOOK3S_PR_POSSIBLE 110a7f7f624SMasahiro Yamada help 1119975f5e3SAneesh Kumar K.V Support running guest kernels in virtual machines on processors 1129975f5e3SAneesh Kumar K.V without using hypervisor mode in the host, by running the 1139975f5e3SAneesh Kumar K.V guest in user mode (problem state) and emulating all 1149975f5e3SAneesh Kumar K.V privileged instructions and registers. 1159975f5e3SAneesh Kumar K.V 116b5149e22SNicholas Piggin This is only available for hash MMU mode and only supports 117b5149e22SNicholas Piggin guests that use hash MMU mode. 118b5149e22SNicholas Piggin 1199975f5e3SAneesh Kumar K.V This is not as fast as using hypervisor mode, but works on 1209975f5e3SAneesh Kumar K.V machines where hypervisor mode is not available or not usable, 1219975f5e3SAneesh Kumar K.V and can emulate processors that are different from the host 1229975f5e3SAneesh Kumar K.V processor, including emulating 32-bit processors on a 64-bit 1239975f5e3SAneesh Kumar K.V host. 124de56a948SPaul Mackerras 125b5149e22SNicholas Piggin Selecting this option will cause the SCV facility to be 126b5149e22SNicholas Piggin disabled when the kernel is booted on the pseries platform in 127b5149e22SNicholas Piggin hash MMU mode (regardless of PR VMs running). When any PR VMs 128b5149e22SNicholas Piggin are running, "AIL" mode is disabled which may slow interrupts 129b5149e22SNicholas Piggin and system calls on the host. 130b5149e22SNicholas Piggin 131b6c295dfSPaul Mackerrasconfig KVM_BOOK3S_HV_EXIT_TIMING 1323f8ed993SFabiano Rosas bool 1333f8ed993SFabiano Rosas 134c3fa64c9SFabiano Rosasconfig KVM_BOOK3S_HV_P9_TIMING 135c3fa64c9SFabiano Rosas bool "Detailed timing for the P9 entry point" 136c3fa64c9SFabiano Rosas select KVM_BOOK3S_HV_EXIT_TIMING 137c3fa64c9SFabiano Rosas depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS 138c3fa64c9SFabiano Rosas help 139b44bb1b7SFabiano Rosas Calculate time taken for each vcpu during vcpu entry and 140b44bb1b7SFabiano Rosas exit, time spent inside the guest and time spent handling 141b44bb1b7SFabiano Rosas hypercalls and page faults. The total, minimum and maximum 142b44bb1b7SFabiano Rosas times in nanoseconds together with the number of executions 143b44bb1b7SFabiano Rosas are reported in debugfs in kvm/vm#/vcpu#/timings. 144c3fa64c9SFabiano Rosas 145c3fa64c9SFabiano Rosas If unsure, say N. 146c3fa64c9SFabiano Rosas 1473f8ed993SFabiano Rosasconfig KVM_BOOK3S_HV_P8_TIMING 1483f8ed993SFabiano Rosas bool "Detailed timing for hypervisor real-mode code (for POWER8)" 1493f8ed993SFabiano Rosas select KVM_BOOK3S_HV_EXIT_TIMING 150c3fa64c9SFabiano Rosas depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS && !KVM_BOOK3S_HV_P9_TIMING 151a7f7f624SMasahiro Yamada help 152b6c295dfSPaul Mackerras Calculate time taken for each vcpu in the real-mode guest entry, 153b6c295dfSPaul Mackerras exit, and interrupt handling code, plus time spent in the guest 154b6c295dfSPaul Mackerras and in nap mode due to idle (cede) while other threads are still 155b6c295dfSPaul Mackerras in the guest. The total, minimum and maximum times in nanoseconds 156b6c295dfSPaul Mackerras together with the number of executions are reported in debugfs in 157b6c295dfSPaul Mackerras kvm/vm#/vcpu#/timings. The overhead is of the order of 30 - 40 158b6c295dfSPaul Mackerras ns per exit on POWER8. 159b6c295dfSPaul Mackerras 160b6c295dfSPaul Mackerras If unsure, say N. 161b6c295dfSPaul Mackerras 162d3c8a2d3SNicholas Pigginconfig KVM_BOOK3S_HV_NESTED_PMU_WORKAROUND 163d3c8a2d3SNicholas Piggin bool "Nested L0 host workaround for L1 KVM host PMU handling bug" if EXPERT 164d3c8a2d3SNicholas Piggin depends on KVM_BOOK3S_HV_POSSIBLE 165d3c8a2d3SNicholas Piggin default !EXPERT 166d3c8a2d3SNicholas Piggin help 167d3c8a2d3SNicholas Piggin Old nested HV capable Linux guests have a bug where they don't 168d3c8a2d3SNicholas Piggin reflect the PMU in-use status of their L2 guest to the L0 host 169d3c8a2d3SNicholas Piggin while the L2 PMU registers are live. This can result in loss 170d3c8a2d3SNicholas Piggin of L2 PMU register state, causing perf to not work correctly in 171d3c8a2d3SNicholas Piggin L2 guests. 172d3c8a2d3SNicholas Piggin 173d3c8a2d3SNicholas Piggin Selecting this option for the L0 host implements a workaround for 174d3c8a2d3SNicholas Piggin those buggy L1s which saves the L2 state, at the cost of performance 175d3c8a2d3SNicholas Piggin in all nested-capable guest entry/exit. 176d3c8a2d3SNicholas Piggin 177d30f6e48SScott Woodconfig KVM_BOOKE_HV 178d30f6e48SScott Wood bool 179d30f6e48SScott Wood 18073e75b41SHollis Blanchardconfig KVM_EXIT_TIMING 18173e75b41SHollis Blanchard bool "Detailed exit timing" 182b2677b8dSAlexander Graf depends on KVM_E500V2 || KVM_E500MC 183a7f7f624SMasahiro Yamada help 18473e75b41SHollis Blanchard Calculate elapsed time for every exit/enter cycle. A per-vcpu 18573e75b41SHollis Blanchard report is available in debugfs kvm/vm#_vcpu#_timing. 18673e75b41SHollis Blanchard The overhead is relatively small, however it is not recommended for 18773e75b41SHollis Blanchard production environments. 18873e75b41SHollis Blanchard 18973e75b41SHollis Blanchard If unsure, say N. 19073e75b41SHollis Blanchard 191bf7ca4bdSAlexander Grafconfig KVM_E500V2 192bf7ca4bdSAlexander Graf bool "KVM support for PowerPC E500v2 processors" 193688de017SChristophe Leroy depends on PPC_E500 && !PPC_E500MC 194*e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 195bc8080cbSHollis Blanchard select KVM 196de56a948SPaul Mackerras select KVM_MMIO 197862d31f7SAlexander Graf select MMU_NOTIFIER 198a7f7f624SMasahiro Yamada help 199bc8080cbSHollis Blanchard Support running unmodified E500 guest kernels in virtual machines on 200bf7ca4bdSAlexander Graf E500v2 host processors. 201bc8080cbSHollis Blanchard 202bc8080cbSHollis Blanchard This module provides access to the hardware capabilities through 203bc8080cbSHollis Blanchard a character device node named /dev/kvm. 204bc8080cbSHollis Blanchard 205bc8080cbSHollis Blanchard If unsure, say N. 206bc8080cbSHollis Blanchard 20773196cd3SScott Woodconfig KVM_E500MC 208d9ce6041SMihai Caraman bool "KVM support for PowerPC E500MC/E5500/E6500 processors" 20907ff8b53SKees Cook depends on PPC_E500MC 210*e59b3399SNicholas Piggin depends on !CONTEXT_TRACKING_USER 21173196cd3SScott Wood select KVM 21273196cd3SScott Wood select KVM_MMIO 21373196cd3SScott Wood select KVM_BOOKE_HV 214862d31f7SAlexander Graf select MMU_NOTIFIER 215a7f7f624SMasahiro Yamada help 216d9ce6041SMihai Caraman Support running unmodified E500MC/E5500/E6500 guest kernels in 217d9ce6041SMihai Caraman virtual machines on E500MC/E5500/E6500 host processors. 21873196cd3SScott Wood 21973196cd3SScott Wood This module provides access to the hardware capabilities through 22073196cd3SScott Wood a character device node named /dev/kvm. 22173196cd3SScott Wood 22273196cd3SScott Wood If unsure, say N. 22373196cd3SScott Wood 2245df554adSScott Woodconfig KVM_MPIC 2255df554adSScott Wood bool "KVM in-kernel MPIC emulation" 226688de017SChristophe Leroy depends on KVM && PPC_E500 227de9ba2f3SAlexander Graf select HAVE_KVM_IRQCHIP 228297e2105SPaul Mackerras select HAVE_KVM_IRQFD 229de9ba2f3SAlexander Graf select HAVE_KVM_IRQ_ROUTING 230de9ba2f3SAlexander Graf select HAVE_KVM_MSI 2315df554adSScott Wood help 2325df554adSScott Wood Enable support for emulating MPIC devices inside the 2335df554adSScott Wood host kernel, rather than relying on userspace to emulate. 2345df554adSScott Wood Currently, support is limited to certain versions of 2355df554adSScott Wood Freescale's MPIC implementation. 2365df554adSScott Wood 237bc5ad3f3SBenjamin Herrenschmidtconfig KVM_XICS 238bc5ad3f3SBenjamin Herrenschmidt bool "KVM in-kernel XICS emulation" 239bc5ad3f3SBenjamin Herrenschmidt depends on KVM_BOOK3S_64 && !KVM_MPIC 24025a2150bSPaul Mackerras select HAVE_KVM_IRQCHIP 24125a2150bSPaul Mackerras select HAVE_KVM_IRQFD 242476ce5efSAnton Blanchard default y 243a7f7f624SMasahiro Yamada help 244bc5ad3f3SBenjamin Herrenschmidt Include support for the XICS (eXternal Interrupt Controller 245bc5ad3f3SBenjamin Herrenschmidt Specification) interrupt controller architecture used on 246bc5ad3f3SBenjamin Herrenschmidt IBM POWER (pSeries) servers. 247bc5ad3f3SBenjamin Herrenschmidt 2485af50993SBenjamin Herrenschmidtconfig KVM_XIVE 2495af50993SBenjamin Herrenschmidt bool 2505af50993SBenjamin Herrenschmidt default y 2515af50993SBenjamin Herrenschmidt depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE 2525af50993SBenjamin Herrenschmidt 253bbf45ba5SHollis Blanchardendif # VIRTUALIZATION 254