18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci#
38c2ecf20Sopenharmony_ci# KVM configuration
48c2ecf20Sopenharmony_ci#
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_cisource "virt/kvm/Kconfig"
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_cimenuconfig VIRTUALIZATION
98c2ecf20Sopenharmony_ci	bool "Virtualization"
108c2ecf20Sopenharmony_ci	help
118c2ecf20Sopenharmony_ci	  Say Y here to get to see options for using your Linux host to run
128c2ecf20Sopenharmony_ci	  other operating systems inside virtual machines (guests).
138c2ecf20Sopenharmony_ci	  This option alone does not add any kernel code.
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci	  If you say N, all options in this submenu will be skipped and
168c2ecf20Sopenharmony_ci	  disabled.
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciif VIRTUALIZATION
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ciconfig KVM
218c2ecf20Sopenharmony_ci	bool
228c2ecf20Sopenharmony_ci	select PREEMPT_NOTIFIERS
238c2ecf20Sopenharmony_ci	select HAVE_KVM_EVENTFD
248c2ecf20Sopenharmony_ci	select HAVE_KVM_VCPU_ASYNC_IOCTL
258c2ecf20Sopenharmony_ci	select SRCU
268c2ecf20Sopenharmony_ci	select KVM_VFIO
278c2ecf20Sopenharmony_ci	select IRQ_BYPASS_MANAGER
288c2ecf20Sopenharmony_ci	select HAVE_KVM_IRQ_BYPASS
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_HANDLER
318c2ecf20Sopenharmony_ci	bool
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_32_HANDLER
348c2ecf20Sopenharmony_ci	bool
358c2ecf20Sopenharmony_ci	select KVM_BOOK3S_HANDLER
368c2ecf20Sopenharmony_ci	select KVM_MMIO
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_64_HANDLER
398c2ecf20Sopenharmony_ci	bool
408c2ecf20Sopenharmony_ci	select KVM_BOOK3S_HANDLER
418c2ecf20Sopenharmony_ci	select PPC_DAWR_FORCE_ENABLE
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_PR_POSSIBLE
448c2ecf20Sopenharmony_ci	bool
458c2ecf20Sopenharmony_ci	select KVM_MMIO
468c2ecf20Sopenharmony_ci	select MMU_NOTIFIER
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_HV_POSSIBLE
498c2ecf20Sopenharmony_ci	bool
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_32
528c2ecf20Sopenharmony_ci	tristate "KVM support for PowerPC book3s_32 processors"
538c2ecf20Sopenharmony_ci	depends on PPC_BOOK3S_32 && !SMP && !PTE_64BIT
548c2ecf20Sopenharmony_ci	select KVM
558c2ecf20Sopenharmony_ci	select KVM_BOOK3S_32_HANDLER
568c2ecf20Sopenharmony_ci	select KVM_BOOK3S_PR_POSSIBLE
578c2ecf20Sopenharmony_ci	help
588c2ecf20Sopenharmony_ci	  Support running unmodified book3s_32 guest kernels
598c2ecf20Sopenharmony_ci	  in virtual machines on book3s_32 host processors.
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci	  This module provides access to the hardware capabilities through
628c2ecf20Sopenharmony_ci	  a character device node named /dev/kvm.
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci	  If unsure, say N.
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_64
678c2ecf20Sopenharmony_ci	tristate "KVM support for PowerPC book3s_64 processors"
688c2ecf20Sopenharmony_ci	depends on PPC_BOOK3S_64
698c2ecf20Sopenharmony_ci	select KVM_BOOK3S_64_HANDLER
708c2ecf20Sopenharmony_ci	select KVM
718c2ecf20Sopenharmony_ci	select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE
728c2ecf20Sopenharmony_ci	select SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_PSERIES || PPC_POWERNV)
738c2ecf20Sopenharmony_ci	help
748c2ecf20Sopenharmony_ci	  Support running unmodified book3s_64 and book3s_32 guest kernels
758c2ecf20Sopenharmony_ci	  in virtual machines on book3s_64 host processors.
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci	  This module provides access to the hardware capabilities through
788c2ecf20Sopenharmony_ci	  a character device node named /dev/kvm.
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci	  If unsure, say N.
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_64_HV
838c2ecf20Sopenharmony_ci	tristate "KVM for POWER7 and later using hypervisor mode in host"
848c2ecf20Sopenharmony_ci	depends on KVM_BOOK3S_64 && PPC_POWERNV
858c2ecf20Sopenharmony_ci	select KVM_BOOK3S_HV_POSSIBLE
868c2ecf20Sopenharmony_ci	select MMU_NOTIFIER
878c2ecf20Sopenharmony_ci	select CMA
888c2ecf20Sopenharmony_ci	help
898c2ecf20Sopenharmony_ci	  Support running unmodified book3s_64 guest kernels in
908c2ecf20Sopenharmony_ci	  virtual machines on POWER7 and newer processors that have
918c2ecf20Sopenharmony_ci	  hypervisor mode available to the host.
928c2ecf20Sopenharmony_ci
938c2ecf20Sopenharmony_ci	  If you say Y here, KVM will use the hardware virtualization
948c2ecf20Sopenharmony_ci	  facilities of POWER7 (and later) processors, meaning that
958c2ecf20Sopenharmony_ci	  guest operating systems will run at full hardware speed
968c2ecf20Sopenharmony_ci	  using supervisor and user modes.  However, this also means
978c2ecf20Sopenharmony_ci	  that KVM is not usable under PowerVM (pHyp), is only usable
988c2ecf20Sopenharmony_ci	  on POWER7 or later processors, and cannot emulate a
998c2ecf20Sopenharmony_ci	  different processor from the host processor.
1008c2ecf20Sopenharmony_ci
1018c2ecf20Sopenharmony_ci	  If unsure, say N.
1028c2ecf20Sopenharmony_ci
1038c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_64_PR
1048c2ecf20Sopenharmony_ci	tristate "KVM support without using hypervisor mode in host"
1058c2ecf20Sopenharmony_ci	depends on KVM_BOOK3S_64
1068c2ecf20Sopenharmony_ci	select KVM_BOOK3S_PR_POSSIBLE
1078c2ecf20Sopenharmony_ci	help
1088c2ecf20Sopenharmony_ci	  Support running guest kernels in virtual machines on processors
1098c2ecf20Sopenharmony_ci	  without using hypervisor mode in the host, by running the
1108c2ecf20Sopenharmony_ci	  guest in user mode (problem state) and emulating all
1118c2ecf20Sopenharmony_ci	  privileged instructions and registers.
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci	  This is not as fast as using hypervisor mode, but works on
1148c2ecf20Sopenharmony_ci	  machines where hypervisor mode is not available or not usable,
1158c2ecf20Sopenharmony_ci	  and can emulate processors that are different from the host
1168c2ecf20Sopenharmony_ci	  processor, including emulating 32-bit processors on a 64-bit
1178c2ecf20Sopenharmony_ci	  host.
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ciconfig KVM_BOOK3S_HV_EXIT_TIMING
1208c2ecf20Sopenharmony_ci	bool "Detailed timing for hypervisor real-mode code"
1218c2ecf20Sopenharmony_ci	depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS
1228c2ecf20Sopenharmony_ci	help
1238c2ecf20Sopenharmony_ci	  Calculate time taken for each vcpu in the real-mode guest entry,
1248c2ecf20Sopenharmony_ci	  exit, and interrupt handling code, plus time spent in the guest
1258c2ecf20Sopenharmony_ci	  and in nap mode due to idle (cede) while other threads are still
1268c2ecf20Sopenharmony_ci	  in the guest.  The total, minimum and maximum times in nanoseconds
1278c2ecf20Sopenharmony_ci	  together with the number of executions are reported in debugfs in
1288c2ecf20Sopenharmony_ci	  kvm/vm#/vcpu#/timings.  The overhead is of the order of 30 - 40
1298c2ecf20Sopenharmony_ci	  ns per exit on POWER8.
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci	  If unsure, say N.
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ciconfig KVM_BOOKE_HV
1348c2ecf20Sopenharmony_ci	bool
1358c2ecf20Sopenharmony_ci
1368c2ecf20Sopenharmony_ciconfig KVM_EXIT_TIMING
1378c2ecf20Sopenharmony_ci	bool "Detailed exit timing"
1388c2ecf20Sopenharmony_ci	depends on KVM_E500V2 || KVM_E500MC
1398c2ecf20Sopenharmony_ci	help
1408c2ecf20Sopenharmony_ci	  Calculate elapsed time for every exit/enter cycle. A per-vcpu
1418c2ecf20Sopenharmony_ci	  report is available in debugfs kvm/vm#_vcpu#_timing.
1428c2ecf20Sopenharmony_ci	  The overhead is relatively small, however it is not recommended for
1438c2ecf20Sopenharmony_ci	  production environments.
1448c2ecf20Sopenharmony_ci
1458c2ecf20Sopenharmony_ci	  If unsure, say N.
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ciconfig KVM_E500V2
1488c2ecf20Sopenharmony_ci	bool "KVM support for PowerPC E500v2 processors"
1498c2ecf20Sopenharmony_ci	depends on E500 && !PPC_E500MC
1508c2ecf20Sopenharmony_ci	select KVM
1518c2ecf20Sopenharmony_ci	select KVM_MMIO
1528c2ecf20Sopenharmony_ci	select MMU_NOTIFIER
1538c2ecf20Sopenharmony_ci	help
1548c2ecf20Sopenharmony_ci	  Support running unmodified E500 guest kernels in virtual machines on
1558c2ecf20Sopenharmony_ci	  E500v2 host processors.
1568c2ecf20Sopenharmony_ci
1578c2ecf20Sopenharmony_ci	  This module provides access to the hardware capabilities through
1588c2ecf20Sopenharmony_ci	  a character device node named /dev/kvm.
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci	  If unsure, say N.
1618c2ecf20Sopenharmony_ci
1628c2ecf20Sopenharmony_ciconfig KVM_E500MC
1638c2ecf20Sopenharmony_ci	bool "KVM support for PowerPC E500MC/E5500/E6500 processors"
1648c2ecf20Sopenharmony_ci	depends on PPC_E500MC
1658c2ecf20Sopenharmony_ci	select KVM
1668c2ecf20Sopenharmony_ci	select KVM_MMIO
1678c2ecf20Sopenharmony_ci	select KVM_BOOKE_HV
1688c2ecf20Sopenharmony_ci	select MMU_NOTIFIER
1698c2ecf20Sopenharmony_ci	help
1708c2ecf20Sopenharmony_ci	  Support running unmodified E500MC/E5500/E6500 guest kernels in
1718c2ecf20Sopenharmony_ci	  virtual machines on E500MC/E5500/E6500 host processors.
1728c2ecf20Sopenharmony_ci
1738c2ecf20Sopenharmony_ci	  This module provides access to the hardware capabilities through
1748c2ecf20Sopenharmony_ci	  a character device node named /dev/kvm.
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci	  If unsure, say N.
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ciconfig KVM_MPIC
1798c2ecf20Sopenharmony_ci	bool "KVM in-kernel MPIC emulation"
1808c2ecf20Sopenharmony_ci	depends on KVM && E500
1818c2ecf20Sopenharmony_ci	select HAVE_KVM_IRQCHIP
1828c2ecf20Sopenharmony_ci	select HAVE_KVM_IRQFD
1838c2ecf20Sopenharmony_ci	select HAVE_KVM_IRQ_ROUTING
1848c2ecf20Sopenharmony_ci	select HAVE_KVM_MSI
1858c2ecf20Sopenharmony_ci	help
1868c2ecf20Sopenharmony_ci	  Enable support for emulating MPIC devices inside the
1878c2ecf20Sopenharmony_ci	  host kernel, rather than relying on userspace to emulate.
1888c2ecf20Sopenharmony_ci	  Currently, support is limited to certain versions of
1898c2ecf20Sopenharmony_ci	  Freescale's MPIC implementation.
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ciconfig KVM_XICS
1928c2ecf20Sopenharmony_ci	bool "KVM in-kernel XICS emulation"
1938c2ecf20Sopenharmony_ci	depends on KVM_BOOK3S_64 && !KVM_MPIC
1948c2ecf20Sopenharmony_ci	select HAVE_KVM_IRQCHIP
1958c2ecf20Sopenharmony_ci	select HAVE_KVM_IRQFD
1968c2ecf20Sopenharmony_ci	default y
1978c2ecf20Sopenharmony_ci	help
1988c2ecf20Sopenharmony_ci	  Include support for the XICS (eXternal Interrupt Controller
1998c2ecf20Sopenharmony_ci	  Specification) interrupt controller architecture used on
2008c2ecf20Sopenharmony_ci	  IBM POWER (pSeries) servers.
2018c2ecf20Sopenharmony_ci
2028c2ecf20Sopenharmony_ciconfig KVM_XIVE
2038c2ecf20Sopenharmony_ci	bool
2048c2ecf20Sopenharmony_ci	default y
2058c2ecf20Sopenharmony_ci	depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ciendif # VIRTUALIZATION
208