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