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
42config KVM_BOOK3S_PR_POSSIBLE
43	bool
44	select KVM_MMIO
45	select MMU_NOTIFIER
46
47config KVM_BOOK3S_HV_POSSIBLE
48	bool
49
50config KVM_BOOK3S_32
51	tristate "KVM support for PowerPC book3s_32 processors"
52	depends on PPC_BOOK3S_32 && !SMP && !PTE_64BIT
53	select KVM
54	select KVM_BOOK3S_32_HANDLER
55	select KVM_BOOK3S_PR_POSSIBLE
56	select PPC_FPU
57	help
58	  Support running unmodified book3s_32 guest kernels
59	  in virtual machines on book3s_32 host processors.
60
61	  This module provides access to the hardware capabilities through
62	  a character device node named /dev/kvm.
63
64	  If unsure, say N.
65
66config KVM_BOOK3S_64
67	tristate "KVM support for PowerPC book3s_64 processors"
68	depends on PPC_BOOK3S_64
69	select KVM_BOOK3S_64_HANDLER
70	select KVM
71	select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE
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 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	select KVM_BOOK3S_PR_POSSIBLE
107	help
108	  Support running guest kernels in virtual machines on processors
109	  without using hypervisor mode in the host, by running the
110	  guest in user mode (problem state) and emulating all
111	  privileged instructions and registers.
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
119config KVM_BOOK3S_HV_EXIT_TIMING
120	bool "Detailed timing for hypervisor real-mode code"
121	depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS
122	help
123	  Calculate time taken for each vcpu in the real-mode guest entry,
124	  exit, and interrupt handling code, plus time spent in the guest
125	  and in nap mode due to idle (cede) while other threads are still
126	  in the guest.  The total, minimum and maximum times in nanoseconds
127	  together with the number of executions are reported in debugfs in
128	  kvm/vm#/vcpu#/timings.  The overhead is of the order of 30 - 40
129	  ns per exit on POWER8.
130
131	  If unsure, say N.
132
133config KVM_BOOKE_HV
134	bool
135
136config KVM_EXIT_TIMING
137	bool "Detailed exit timing"
138	depends on KVM_E500V2 || KVM_E500MC
139	help
140	  Calculate elapsed time for every exit/enter cycle. A per-vcpu
141	  report is available in debugfs kvm/vm#_vcpu#_timing.
142	  The overhead is relatively small, however it is not recommended for
143	  production environments.
144
145	  If unsure, say N.
146
147config KVM_E500V2
148	bool "KVM support for PowerPC E500v2 processors"
149	depends on E500 && !PPC_E500MC
150	select KVM
151	select KVM_MMIO
152	select MMU_NOTIFIER
153	help
154	  Support running unmodified E500 guest kernels in virtual machines on
155	  E500v2 host processors.
156
157	  This module provides access to the hardware capabilities through
158	  a character device node named /dev/kvm.
159
160	  If unsure, say N.
161
162config KVM_E500MC
163	bool "KVM support for PowerPC E500MC/E5500/E6500 processors"
164	depends on PPC_E500MC
165	select KVM
166	select KVM_MMIO
167	select KVM_BOOKE_HV
168	select MMU_NOTIFIER
169	help
170	  Support running unmodified E500MC/E5500/E6500 guest kernels in
171	  virtual machines on E500MC/E5500/E6500 host processors.
172
173	  This module provides access to the hardware capabilities through
174	  a character device node named /dev/kvm.
175
176	  If unsure, say N.
177
178config KVM_MPIC
179	bool "KVM in-kernel MPIC emulation"
180	depends on KVM && E500
181	select HAVE_KVM_IRQCHIP
182	select HAVE_KVM_IRQFD
183	select HAVE_KVM_IRQ_ROUTING
184	select HAVE_KVM_MSI
185	help
186	  Enable support for emulating MPIC devices inside the
187	  host kernel, rather than relying on userspace to emulate.
188	  Currently, support is limited to certain versions of
189	  Freescale's MPIC implementation.
190
191config KVM_XICS
192	bool "KVM in-kernel XICS emulation"
193	depends on KVM_BOOK3S_64 && !KVM_MPIC
194	select HAVE_KVM_IRQCHIP
195	select HAVE_KVM_IRQFD
196	default y
197	help
198	  Include support for the XICS (eXternal Interrupt Controller
199	  Specification) interrupt controller architecture used on
200	  IBM POWER (pSeries) servers.
201
202config KVM_XIVE
203	bool
204	default y
205	depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE
206
207endif # VIRTUALIZATION
208