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