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