xref: /openbmc/linux/arch/powerpc/kvm/Kconfig (revision 249592bf)
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
30config KVM_BOOK3S_HANDLER
31	bool
32
33config KVM_BOOK3S_32_HANDLER
34	bool
35	select KVM_BOOK3S_HANDLER
36	select KVM_MMIO
37
38config KVM_BOOK3S_64_HANDLER
39	bool
40	select KVM_BOOK3S_HANDLER
41	select PPC_DAWR_FORCE_ENABLE
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 SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_PSERIES || PPC_POWERNV)
74	help
75	  Support running unmodified book3s_64 and book3s_32 guest kernels
76	  in virtual machines on book3s_64 host processors.
77
78	  This module provides access to the hardware capabilities through
79	  a character device node named /dev/kvm.
80
81	  If unsure, say N.
82
83config KVM_BOOK3S_64_HV
84	tristate "KVM for POWER7 and later using hypervisor mode in host"
85	depends on KVM_BOOK3S_64 && PPC_POWERNV
86	select KVM_BOOK3S_HV_POSSIBLE
87	select MMU_NOTIFIER
88	select CMA
89	help
90	  Support running unmodified book3s_64 guest kernels in
91	  virtual machines on POWER7 and newer processors that have
92	  hypervisor mode available to the host.
93
94	  If you say Y here, KVM will use the hardware virtualization
95	  facilities of POWER7 (and later) processors, meaning that
96	  guest operating systems will run at full hardware speed
97	  using supervisor and user modes.  However, this also means
98	  that KVM is not usable under PowerVM (pHyp), is only usable
99	  on POWER7 or later processors, and cannot emulate a
100	  different processor from the host processor.
101
102	  If unsure, say N.
103
104config KVM_BOOK3S_64_PR
105	tristate "KVM support without using hypervisor mode in host"
106	depends on KVM_BOOK3S_64
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 not as fast as using hypervisor mode, but works on
115	  machines where hypervisor mode is not available or not usable,
116	  and can emulate processors that are different from the host
117	  processor, including emulating 32-bit processors on a 64-bit
118	  host.
119
120config KVM_BOOK3S_HV_EXIT_TIMING
121	bool "Detailed timing for hypervisor real-mode code"
122	depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS
123	help
124	  Calculate time taken for each vcpu in the real-mode guest entry,
125	  exit, and interrupt handling code, plus time spent in the guest
126	  and in nap mode due to idle (cede) while other threads are still
127	  in the guest.  The total, minimum and maximum times in nanoseconds
128	  together with the number of executions are reported in debugfs in
129	  kvm/vm#/vcpu#/timings.  The overhead is of the order of 30 - 40
130	  ns per exit on POWER8.
131
132	  If unsure, say N.
133
134config KVM_BOOKE_HV
135	bool
136
137config KVM_EXIT_TIMING
138	bool "Detailed exit timing"
139	depends on KVM_E500V2 || KVM_E500MC
140	help
141	  Calculate elapsed time for every exit/enter cycle. A per-vcpu
142	  report is available in debugfs kvm/vm#_vcpu#_timing.
143	  The overhead is relatively small, however it is not recommended for
144	  production environments.
145
146	  If unsure, say N.
147
148config KVM_E500V2
149	bool "KVM support for PowerPC E500v2 processors"
150	depends on E500 && !PPC_E500MC
151	select KVM
152	select KVM_MMIO
153	select MMU_NOTIFIER
154	help
155	  Support running unmodified E500 guest kernels in virtual machines on
156	  E500v2 host processors.
157
158	  This module provides access to the hardware capabilities through
159	  a character device node named /dev/kvm.
160
161	  If unsure, say N.
162
163config KVM_E500MC
164	bool "KVM support for PowerPC E500MC/E5500/E6500 processors"
165	depends on PPC_E500MC
166	select KVM
167	select KVM_MMIO
168	select KVM_BOOKE_HV
169	select MMU_NOTIFIER
170	help
171	  Support running unmodified E500MC/E5500/E6500 guest kernels in
172	  virtual machines on E500MC/E5500/E6500 host processors.
173
174	  This module provides access to the hardware capabilities through
175	  a character device node named /dev/kvm.
176
177	  If unsure, say N.
178
179config KVM_MPIC
180	bool "KVM in-kernel MPIC emulation"
181	depends on KVM && E500
182	select HAVE_KVM_IRQCHIP
183	select HAVE_KVM_IRQFD
184	select HAVE_KVM_IRQ_ROUTING
185	select HAVE_KVM_MSI
186	help
187	  Enable support for emulating MPIC devices inside the
188	  host kernel, rather than relying on userspace to emulate.
189	  Currently, support is limited to certain versions of
190	  Freescale's MPIC implementation.
191
192config KVM_XICS
193	bool "KVM in-kernel XICS emulation"
194	depends on KVM_BOOK3S_64 && !KVM_MPIC
195	select HAVE_KVM_IRQCHIP
196	select HAVE_KVM_IRQFD
197	default y
198	help
199	  Include support for the XICS (eXternal Interrupt Controller
200	  Specification) interrupt controller architecture used on
201	  IBM POWER (pSeries) servers.
202
203config KVM_XIVE
204	bool
205	default y
206	depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE
207
208endif # VIRTUALIZATION
209