1menu "Xen driver support"
2	depends on XEN
3
4config XEN_BALLOON
5	bool "Xen memory balloon driver"
6	default y
7	help
8	  The balloon driver allows the Xen domain to request more memory from
9	  the system to expand the domain's memory allocation, or alternatively
10	  return unneeded memory to the system.
11
12config XEN_SELFBALLOONING
13	bool "Dynamically self-balloon kernel memory to target"
14	depends on XEN && XEN_BALLOON && CLEANCACHE && SWAP && XEN_TMEM
15	default n
16	help
17	  Self-ballooning dynamically balloons available kernel memory driven
18	  by the current usage of anonymous memory ("committed AS") and
19	  controlled by various sysfs-settable parameters.  Configuring
20	  FRONTSWAP is highly recommended; if it is not configured, self-
21	  ballooning is disabled by default. If FRONTSWAP is configured,
22	  frontswap-selfshrinking is enabled by default but can be disabled
23	  with the 'tmem.selfshrink=0' kernel boot parameter; and self-ballooning
24	  is enabled by default but can be disabled with the 'tmem.selfballooning=0'
25	  kernel boot parameter.  Note that systems without a sufficiently
26	  large swap device should not enable self-ballooning.
27
28config XEN_BALLOON_MEMORY_HOTPLUG
29	bool "Memory hotplug support for Xen balloon driver"
30	default n
31	depends on XEN_BALLOON && MEMORY_HOTPLUG
32	help
33	  Memory hotplug support for Xen balloon driver allows expanding memory
34	  available for the system above limit declared at system startup.
35	  It is very useful on critical systems which require long
36	  run without rebooting.
37
38	  Memory could be hotplugged in following steps:
39
40	    1) target domain: ensure that memory auto online policy is in
41	       effect by checking /sys/devices/system/memory/auto_online_blocks
42	       file (should be 'online').
43
44	    2) control domain: xl mem-max <target-domain> <maxmem>
45	       where <maxmem> is >= requested memory size,
46
47	    3) control domain: xl mem-set <target-domain> <memory>
48	       where <memory> is requested memory size; alternatively memory
49	       could be added by writing proper value to
50	       /sys/devices/system/xen_memory/xen_memory0/target or
51	       /sys/devices/system/xen_memory/xen_memory0/target_kb on the
52	       target domain.
53
54	  Alternatively, if memory auto onlining was not requested at step 1
55	  the newly added memory can be manually onlined in the target domain
56	  by doing the following:
57
58		for i in /sys/devices/system/memory/memory*/state; do \
59		  [ "`cat "$i"`" = offline ] && echo online > "$i"; done
60
61	  or by adding the following line to udev rules:
62
63	  SUBSYSTEM=="memory", ACTION=="add", RUN+="/bin/sh -c '[ -f /sys$devpath/state ] && echo online > /sys$devpath/state'"
64
65config XEN_BALLOON_MEMORY_HOTPLUG_LIMIT
66	int "Hotplugged memory limit (in GiB) for a PV guest"
67	default 512 if X86_64
68	default 4 if X86_32
69	range 0 64 if X86_32
70	depends on XEN_HAVE_PVMMU
71	depends on XEN_BALLOON_MEMORY_HOTPLUG
72	help
73	  Maxmium amount of memory (in GiB) that a PV guest can be
74	  expanded to when using memory hotplug.
75
76	  A PV guest can have more memory than this limit if is
77	  started with a larger maximum.
78
79	  This value is used to allocate enough space in internal
80	  tables needed for physical memory administration.
81
82config XEN_SCRUB_PAGES_DEFAULT
83	bool "Scrub pages before returning them to system by default"
84	depends on XEN_BALLOON
85	default y
86	help
87	  Scrub pages before returning them to the system for reuse by
88	  other domains.  This makes sure that any confidential data
89	  is not accidentally visible to other domains.  Is it more
90	  secure, but slightly less efficient. This can be controlled with
91	  xen_scrub_pages=0 parameter and
92	  /sys/devices/system/xen_memory/xen_memory0/scrub_pages.
93	  This option only sets the default value.
94
95	  If in doubt, say yes.
96
97config XEN_DEV_EVTCHN
98	tristate "Xen /dev/xen/evtchn device"
99	default y
100	help
101	  The evtchn driver allows a userspace process to trigger event
102	  channels and to receive notification of an event channel
103	  firing.
104	  If in doubt, say yes.
105
106config XEN_BACKEND
107	bool "Backend driver support"
108	depends on XEN_DOM0
109	default y
110	help
111	  Support for backend device drivers that provide I/O services
112	  to other virtual machines.
113
114config XENFS
115	tristate "Xen filesystem"
116	select XEN_PRIVCMD
117	default y
118	help
119	  The xen filesystem provides a way for domains to share
120	  information with each other and with the hypervisor.
121	  For example, by reading and writing the "xenbus" file, guests
122	  may pass arbitrary information to the initial domain.
123	  If in doubt, say yes.
124
125config XEN_COMPAT_XENFS
126       bool "Create compatibility mount point /proc/xen"
127       depends on XENFS
128       default y
129       help
130         The old xenstore userspace tools expect to find "xenbus"
131         under /proc/xen, but "xenbus" is now found at the root of the
132         xenfs filesystem.  Selecting this causes the kernel to create
133         the compatibility mount point /proc/xen if it is running on
134         a xen platform.
135         If in doubt, say yes.
136
137config XEN_SYS_HYPERVISOR
138       bool "Create xen entries under /sys/hypervisor"
139       depends on SYSFS
140       select SYS_HYPERVISOR
141       default y
142       help
143         Create entries under /sys/hypervisor describing the Xen
144	 hypervisor environment.  When running native or in another
145	 virtual environment, /sys/hypervisor will still be present,
146	 but will have no xen contents.
147
148config XEN_XENBUS_FRONTEND
149	tristate
150
151config XEN_GNTDEV
152	tristate "userspace grant access device driver"
153	depends on XEN
154	default m
155	select MMU_NOTIFIER
156	help
157	  Allows userspace processes to use grants.
158
159config XEN_GNTDEV_DMABUF
160	bool "Add support for dma-buf grant access device driver extension"
161	depends on XEN_GNTDEV && XEN_GRANT_DMA_ALLOC
162	select DMA_SHARED_BUFFER
163	help
164	  Allows userspace processes and kernel modules to use Xen backed
165	  dma-buf implementation. With this extension grant references to
166	  the pages of an imported dma-buf can be exported for other domain
167	  use and grant references coming from a foreign domain can be
168	  converted into a local dma-buf for local export.
169
170config XEN_GRANT_DEV_ALLOC
171	tristate "User-space grant reference allocator driver"
172	depends on XEN
173	default m
174	help
175	  Allows userspace processes to create pages with access granted
176	  to other domains. This can be used to implement frontend drivers
177	  or as part of an inter-domain shared memory channel.
178
179config XEN_GRANT_DMA_ALLOC
180	bool "Allow allocating DMA capable buffers with grant reference module"
181	depends on XEN && HAS_DMA
182	help
183	  Extends grant table module API to allow allocating DMA capable
184	  buffers and mapping foreign grant references on top of it.
185	  The resulting buffer is similar to one allocated by the balloon
186	  driver in that proper memory reservation is made by
187	  ({increase|decrease}_reservation and VA mappings are updated if
188	  needed).
189	  This is useful for sharing foreign buffers with HW drivers which
190	  cannot work with scattered buffers provided by the balloon driver,
191	  but require DMAable memory instead.
192
193config SWIOTLB_XEN
194	def_bool y
195	select SWIOTLB
196
197config XEN_TMEM
198	tristate
199	depends on !ARM && !ARM64
200	default m if (CLEANCACHE || FRONTSWAP)
201	help
202	  Shim to interface in-kernel Transcendent Memory hooks
203	  (e.g. cleancache and frontswap) to Xen tmem hypercalls.
204
205config XEN_PCIDEV_BACKEND
206	tristate "Xen PCI-device backend driver"
207	depends on PCI && X86 && XEN
208	depends on XEN_BACKEND
209	default m
210	help
211	  The PCI device backend driver allows the kernel to export arbitrary
212	  PCI devices to other guests. If you select this to be a module, you
213	  will need to make sure no other driver has bound to the device(s)
214	  you want to make visible to other guests.
215
216	  The parameter "passthrough" allows you specify how you want the PCI
217	  devices to appear in the guest. You can choose the default (0) where
218	  PCI topology starts at 00.00.0, or (1) for passthrough if you want
219	  the PCI devices topology appear the same as in the host.
220
221	  The "hide" parameter (only applicable if backend driver is compiled
222	  into the kernel) allows you to bind the PCI devices to this module
223	  from the default device drivers. The argument is the list of PCI BDFs:
224	  xen-pciback.hide=(03:00.0)(04:00.0)
225
226	  If in doubt, say m.
227
228config XEN_PVCALLS_FRONTEND
229	tristate "XEN PV Calls frontend driver"
230	depends on INET && XEN
231	default n
232	select XEN_XENBUS_FRONTEND
233	help
234	  Experimental frontend for the Xen PV Calls protocol
235	  (https://xenbits.xen.org/docs/unstable/misc/pvcalls.html). It
236	  sends a small set of POSIX calls to the backend, which
237	  implements them.
238
239config XEN_PVCALLS_BACKEND
240	bool "XEN PV Calls backend driver"
241	depends on INET && XEN && XEN_BACKEND
242	default n
243	help
244	  Experimental backend for the Xen PV Calls protocol
245	  (https://xenbits.xen.org/docs/unstable/misc/pvcalls.html). It
246	  allows PV Calls frontends to send POSIX calls to the backend,
247	  which implements them.
248
249	  If in doubt, say n.
250
251config XEN_SCSI_BACKEND
252	tristate "XEN SCSI backend driver"
253	depends on XEN && XEN_BACKEND && TARGET_CORE
254	help
255	  The SCSI backend driver allows the kernel to export its SCSI Devices
256	  to other guests via a high-performance shared-memory interface.
257	  Only needed for systems running as XEN driver domains (e.g. Dom0) and
258	  if guests need generic access to SCSI devices.
259
260config XEN_PRIVCMD
261	tristate
262	depends on XEN
263	default m
264
265config XEN_STUB
266	bool "Xen stub drivers"
267	depends on XEN && X86_64 && BROKEN
268	default n
269	help
270	  Allow kernel to install stub drivers, to reserve space for Xen drivers,
271	  i.e. memory hotplug and cpu hotplug, and to block native drivers loaded,
272	  so that real Xen drivers can be modular.
273
274	  To enable Xen features like cpu and memory hotplug, select Y here.
275
276config XEN_ACPI_HOTPLUG_MEMORY
277	tristate "Xen ACPI memory hotplug"
278	depends on XEN_DOM0 && XEN_STUB && ACPI
279	default n
280	help
281	  This is Xen ACPI memory hotplug.
282
283	  Currently Xen only support ACPI memory hot-add. If you want
284	  to hot-add memory at runtime (the hot-added memory cannot be
285	  removed until machine stop), select Y/M here, otherwise select N.
286
287config XEN_ACPI_HOTPLUG_CPU
288	tristate "Xen ACPI cpu hotplug"
289	depends on XEN_DOM0 && XEN_STUB && ACPI
290	select ACPI_CONTAINER
291	default n
292	help
293	  Xen ACPI cpu enumerating and hotplugging
294
295	  For hotplugging, currently Xen only support ACPI cpu hotadd.
296	  If you want to hotadd cpu at runtime (the hotadded cpu cannot
297	  be removed until machine stop), select Y/M here.
298
299config XEN_ACPI_PROCESSOR
300	tristate "Xen ACPI processor"
301	depends on XEN && XEN_DOM0 && X86 && ACPI_PROCESSOR && CPU_FREQ
302	default m
303	help
304          This ACPI processor uploads Power Management information to the Xen
305	  hypervisor.
306
307	  To do that the driver parses the Power Management data and uploads
308	  said information to the Xen hypervisor. Then the Xen hypervisor can
309	  select the proper Cx and Pxx states. It also registers itself as the
310	  SMM so that other drivers (such as ACPI cpufreq scaling driver) will
311	  not load.
312
313          To compile this driver as a module, choose M here: the module will be
314	  called xen_acpi_processor  If you do not know what to choose, select
315	  M here. If the CPUFREQ drivers are built in, select Y here.
316
317config XEN_MCE_LOG
318	bool "Xen platform mcelog"
319	depends on XEN_DOM0 && X86_64 && X86_MCE
320	default n
321	help
322	  Allow kernel fetching MCE error from Xen platform and
323	  converting it into Linux mcelog format for mcelog tools
324
325config XEN_HAVE_PVMMU
326       bool
327
328config XEN_EFI
329	def_bool y
330	depends on (ARM || ARM64 || X86_64) && EFI
331
332config XEN_AUTO_XLATE
333	def_bool y
334	depends on ARM || ARM64 || XEN_PVHVM
335	help
336	  Support for auto-translated physmap guests.
337
338config XEN_ACPI
339	def_bool y
340	depends on X86 && ACPI
341
342config XEN_SYMS
343       bool "Xen symbols"
344       depends on X86 && XEN_DOM0 && XENFS
345       default y if KALLSYMS
346       help
347          Exports hypervisor symbols (along with their types and addresses) via
348          /proc/xen/xensyms file, similar to /proc/kallsyms
349
350config XEN_HAVE_VPMU
351       bool
352
353endmenu
354