xref: /linux/arch/powerpc/kvm/Kconfig (revision 3349ada3cffdbe4579872a004360daa31938f683)
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
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
86*ff45bf50SVaibhav Jain	select KVM_BOOK3S_HV_PMU
87fa61a4e3SAneesh Kumar K.V	select CMA
88a7f7f624SMasahiro Yamada	help
89de56a948SPaul Mackerras	  Support running unmodified book3s_64 guest kernels in
90129fd423SThomas Huth	  virtual machines on POWER7 and newer processors that have
919e368f29SPaul 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
97de56a948SPaul Mackerras	  that KVM is not usable under PowerVM (pHyp), is only usable
98129fd423SThomas Huth	  on POWER7 or later processors, and cannot emulate a
99129fd423SThomas Huth	  different processor from the host processor.
100de56a948SPaul Mackerras
101de56a948SPaul Mackerras	  If unsure, say N.
102de56a948SPaul Mackerras
103de56a948SPaul Mackerrasconfig KVM_BOOK3S_64_PR
1042ba9f0d8SAneesh Kumar K.V	tristate "KVM support without using hypervisor mode in host"
1052ba9f0d8SAneesh Kumar K.V	depends on KVM_BOOK3S_64
106e59b3399SNicholas Piggin	depends on !CONTEXT_TRACKING_USER
1077aa79938SAneesh Kumar K.V	select KVM_BOOK3S_PR_POSSIBLE
108a7f7f624SMasahiro Yamada	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.
1139975f5e3SAneesh Kumar K.V
114b5149e22SNicholas Piggin	  This is only available for hash MMU mode and only supports
115b5149e22SNicholas Piggin	  guests that use hash MMU mode.
116b5149e22SNicholas Piggin
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
1219975f5e3SAneesh Kumar K.V	  host.
122de56a948SPaul Mackerras
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.
128b5149e22SNicholas Piggin
129b6c295dfSPaul Mackerrasconfig KVM_BOOK3S_HV_EXIT_TIMING
1303f8ed993SFabiano Rosas	bool
1313f8ed993SFabiano 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
136c3fa64c9SFabiano 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
141b44bb1b7SFabiano Rosas	  are reported in debugfs in kvm/vm#/vcpu#/timings.
142c3fa64c9SFabiano Rosas
143c3fa64c9SFabiano Rosas	  If unsure, say N.
144c3fa64c9SFabiano Rosas
1453f8ed993SFabiano Rosasconfig KVM_BOOK3S_HV_P8_TIMING
1463f8ed993SFabiano Rosas	bool "Detailed timing for hypervisor real-mode code (for POWER8)"
1473f8ed993SFabiano Rosas	select KVM_BOOK3S_HV_EXIT_TIMING
148c3fa64c9SFabiano Rosas	depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS && !KVM_BOOK3S_HV_P9_TIMING
149a7f7f624SMasahiro Yamada	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.
159b6c295dfSPaul Mackerras
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.
174d3c8a2d3SNicholas Piggin
175*ff45bf50SVaibhav Jainconfig KVM_BOOK3S_HV_PMU
176*ff45bf50SVaibhav Jain	tristate "Hypervisor Perf events for KVM Book3s-HV"
177*ff45bf50SVaibhav Jain	depends on KVM_BOOK3S_64_HV
178*ff45bf50SVaibhav Jain	help
179*ff45bf50SVaibhav Jain	  Enable Book3s-HV Hypervisor Perf events PMU named 'kvm-hv'. These
180*ff45bf50SVaibhav Jain	  Perf events give an overview of hypervisor performance overall
181*ff45bf50SVaibhav Jain	  instead of a specific guests. Currently the PMU reports
182*ff45bf50SVaibhav Jain	  L0-Hypervisor stats on a kvm-hv enabled PSeries LPAR like:
183*ff45bf50SVaibhav Jain	  * Total/Used Guest-Heap
184*ff45bf50SVaibhav Jain	  * Total/Used Guest Page-table Memory
185*ff45bf50SVaibhav Jain	  * Total amount of Guest Page-table Memory reclaimed
186*ff45bf50SVaibhav Jain
187d30f6e48SScott Woodconfig KVM_BOOKE_HV
188d30f6e48SScott Wood	bool
189d30f6e48SScott Wood
19073e75b41SHollis Blanchardconfig KVM_EXIT_TIMING
19173e75b41SHollis Blanchard	bool "Detailed exit timing"
192b2677b8dSAlexander Graf	depends on KVM_E500V2 || KVM_E500MC
193a7f7f624SMasahiro Yamada	help
19473e75b41SHollis Blanchard	  Calculate elapsed time for every exit/enter cycle. A per-vcpu
19573e75b41SHollis Blanchard	  report is available in debugfs kvm/vm#_vcpu#_timing.
19673e75b41SHollis Blanchard	  The overhead is relatively small, however it is not recommended for
19773e75b41SHollis Blanchard	  production environments.
19873e75b41SHollis Blanchard
19973e75b41SHollis Blanchard	  If unsure, say N.
20073e75b41SHollis Blanchard
201bf7ca4bdSAlexander Grafconfig KVM_E500V2
202bf7ca4bdSAlexander Graf	bool "KVM support for PowerPC E500v2 processors"
203688de017SChristophe Leroy	depends on PPC_E500 && !PPC_E500MC
204e59b3399SNicholas Piggin	depends on !CONTEXT_TRACKING_USER
205bc8080cbSHollis Blanchard	select KVM
206de56a948SPaul Mackerras	select KVM_MMIO
207f128cf8cSSean Christopherson	select KVM_GENERIC_MMU_NOTIFIER
208a7f7f624SMasahiro Yamada	help
209bc8080cbSHollis Blanchard	  Support running unmodified E500 guest kernels in virtual machines on
210bf7ca4bdSAlexander Graf	  E500v2 host processors.
211bc8080cbSHollis Blanchard
212bc8080cbSHollis Blanchard	  This module provides access to the hardware capabilities through
213bc8080cbSHollis Blanchard	  a character device node named /dev/kvm.
214bc8080cbSHollis Blanchard
215bc8080cbSHollis Blanchard	  If unsure, say N.
216bc8080cbSHollis Blanchard
21773196cd3SScott Woodconfig KVM_E500MC
218d9ce6041SMihai Caraman	bool "KVM support for PowerPC E500MC/E5500/E6500 processors"
21907ff8b53SKees Cook	depends on PPC_E500MC
220e59b3399SNicholas Piggin	depends on !CONTEXT_TRACKING_USER
22173196cd3SScott Wood	select KVM
22273196cd3SScott Wood	select KVM_MMIO
22373196cd3SScott Wood	select KVM_BOOKE_HV
224f128cf8cSSean Christopherson	select KVM_GENERIC_MMU_NOTIFIER
225a7f7f624SMasahiro Yamada	help
226d9ce6041SMihai Caraman	  Support running unmodified E500MC/E5500/E6500 guest kernels in
227d9ce6041SMihai Caraman	  virtual machines on E500MC/E5500/E6500 host processors.
22873196cd3SScott Wood
22973196cd3SScott Wood	  This module provides access to the hardware capabilities through
23073196cd3SScott Wood	  a character device node named /dev/kvm.
23173196cd3SScott Wood
23273196cd3SScott Wood	  If unsure, say N.
23373196cd3SScott Wood
2345df554adSScott Woodconfig KVM_MPIC
2355df554adSScott Wood	bool "KVM in-kernel MPIC emulation"
236688de017SChristophe Leroy	depends on KVM && PPC_E500
237de9ba2f3SAlexander Graf	select HAVE_KVM_IRQCHIP
238de9ba2f3SAlexander Graf	select HAVE_KVM_IRQ_ROUTING
239de9ba2f3SAlexander Graf	select HAVE_KVM_MSI
2405df554adSScott Wood	help
2415df554adSScott Wood	  Enable support for emulating MPIC devices inside the
2425df554adSScott Wood	  host kernel, rather than relying on userspace to emulate.
2435df554adSScott Wood	  Currently, support is limited to certain versions of
2445df554adSScott Wood	  Freescale's MPIC implementation.
2455df554adSScott Wood
246bc5ad3f3SBenjamin Herrenschmidtconfig KVM_XICS
247bc5ad3f3SBenjamin Herrenschmidt	bool "KVM in-kernel XICS emulation"
248bc5ad3f3SBenjamin Herrenschmidt	depends on KVM_BOOK3S_64 && !KVM_MPIC
24925a2150bSPaul Mackerras	select HAVE_KVM_IRQCHIP
250476ce5efSAnton Blanchard	default y
251a7f7f624SMasahiro Yamada	help
252bc5ad3f3SBenjamin Herrenschmidt	  Include support for the XICS (eXternal Interrupt Controller
253bc5ad3f3SBenjamin Herrenschmidt	  Specification) interrupt controller architecture used on
254bc5ad3f3SBenjamin Herrenschmidt	  IBM POWER (pSeries) servers.
255bc5ad3f3SBenjamin Herrenschmidt
2565af50993SBenjamin Herrenschmidtconfig KVM_XIVE
2575af50993SBenjamin Herrenschmidt	bool
2585af50993SBenjamin Herrenschmidt	default y
2595af50993SBenjamin Herrenschmidt	depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE
2605af50993SBenjamin Herrenschmidt
261bbf45ba5SHollis Blanchardendif # VIRTUALIZATION
262