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