Kconfig 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # KVM configuration
  4. #
  5. source "virt/kvm/Kconfig"
  6. menuconfig VIRTUALIZATION
  7. bool "Virtualization"
  8. help
  9. Say Y here to get to see options for using your Linux host to run
  10. other operating systems inside virtual machines (guests).
  11. This option alone does not add any kernel code.
  12. If you say N, all options in this submenu will be skipped and
  13. disabled.
  14. if VIRTUALIZATION
  15. config KVM
  16. bool
  17. select KVM_COMMON
  18. select KVM_VFIO
  19. select HAVE_KVM_IRQ_BYPASS
  20. config KVM_BOOK3S_HANDLER
  21. bool
  22. config KVM_BOOK3S_32_HANDLER
  23. bool
  24. select KVM_BOOK3S_HANDLER
  25. select KVM_MMIO
  26. config KVM_BOOK3S_64_HANDLER
  27. bool
  28. select KVM_BOOK3S_HANDLER
  29. config KVM_BOOK3S_PR_POSSIBLE
  30. bool
  31. select KVM_MMIO
  32. config KVM_BOOK3S_HV_POSSIBLE
  33. bool
  34. config KVM_BOOK3S_32
  35. tristate "KVM support for PowerPC book3s_32 processors"
  36. depends on PPC_BOOK3S_32 && !SMP && !PTE_64BIT
  37. depends on !CONTEXT_TRACKING_USER
  38. select KVM
  39. select KVM_BOOK3S_32_HANDLER
  40. select KVM_BOOK3S_PR_POSSIBLE
  41. select PPC_FPU
  42. help
  43. Support running unmodified book3s_32 guest kernels
  44. in virtual machines on book3s_32 host processors.
  45. This module provides access to the hardware capabilities through
  46. a character device node named /dev/kvm.
  47. If unsure, say N.
  48. config KVM_BOOK3S_64
  49. tristate "KVM support for PowerPC book3s_64 processors"
  50. depends on PPC_BOOK3S_64
  51. select KVM_BOOK3S_64_HANDLER
  52. select KVM
  53. select KVM_BOOK3S_PR_POSSIBLE if !KVM_BOOK3S_HV_POSSIBLE
  54. select PPC_64S_HASH_MMU
  55. select SPAPR_TCE_IOMMU if IOMMU_SUPPORT && (PPC_PSERIES || PPC_POWERNV)
  56. help
  57. Support running unmodified book3s_64 and book3s_32 guest kernels
  58. in virtual machines on book3s_64 host processors.
  59. This module provides access to the hardware capabilities through
  60. a character device node named /dev/kvm.
  61. If unsure, say N.
  62. config KVM_BOOK3S_64_HV
  63. tristate "KVM for POWER7 and later using hypervisor mode in host"
  64. depends on KVM_BOOK3S_64 && PPC_POWERNV
  65. select KVM_BOOK3S_HV_POSSIBLE
  66. select KVM_BOOK3S_HV_PMU
  67. select CMA
  68. help
  69. Support running unmodified book3s_64 guest kernels in
  70. virtual machines on POWER7 and newer processors that have
  71. hypervisor mode available to the host.
  72. If you say Y here, KVM will use the hardware virtualization
  73. facilities of POWER7 (and later) processors, meaning that
  74. guest operating systems will run at full hardware speed
  75. using supervisor and user modes. However, this also means
  76. that KVM is not usable under PowerVM (pHyp), is only usable
  77. on POWER7 or later processors, and cannot emulate a
  78. different processor from the host processor.
  79. If unsure, say N.
  80. config KVM_BOOK3S_64_PR
  81. tristate "KVM support without using hypervisor mode in host"
  82. depends on KVM_BOOK3S_64
  83. depends on !CONTEXT_TRACKING_USER
  84. select KVM_BOOK3S_PR_POSSIBLE
  85. help
  86. Support running guest kernels in virtual machines on processors
  87. without using hypervisor mode in the host, by running the
  88. guest in user mode (problem state) and emulating all
  89. privileged instructions and registers.
  90. This is only available for hash MMU mode and only supports
  91. guests that use hash MMU mode.
  92. This is not as fast as using hypervisor mode, but works on
  93. machines where hypervisor mode is not available or not usable,
  94. and can emulate processors that are different from the host
  95. processor, including emulating 32-bit processors on a 64-bit
  96. host.
  97. Selecting this option will cause the SCV facility to be
  98. disabled when the kernel is booted on the pseries platform in
  99. hash MMU mode (regardless of PR VMs running). When any PR VMs
  100. are running, "AIL" mode is disabled which may slow interrupts
  101. and system calls on the host.
  102. config KVM_BOOK3S_HV_EXIT_TIMING
  103. bool
  104. config KVM_BOOK3S_HV_P9_TIMING
  105. bool "Detailed timing for the P9 entry point"
  106. select KVM_BOOK3S_HV_EXIT_TIMING
  107. depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS
  108. help
  109. Calculate time taken for each vcpu during vcpu entry and
  110. exit, time spent inside the guest and time spent handling
  111. hypercalls and page faults. The total, minimum and maximum
  112. times in nanoseconds together with the number of executions
  113. are reported in debugfs in kvm/vm#/vcpu#/timings.
  114. If unsure, say N.
  115. config KVM_BOOK3S_HV_P8_TIMING
  116. bool "Detailed timing for hypervisor real-mode code (for POWER8)"
  117. select KVM_BOOK3S_HV_EXIT_TIMING
  118. depends on KVM_BOOK3S_HV_POSSIBLE && DEBUG_FS && !KVM_BOOK3S_HV_P9_TIMING
  119. help
  120. Calculate time taken for each vcpu in the real-mode guest entry,
  121. exit, and interrupt handling code, plus time spent in the guest
  122. and in nap mode due to idle (cede) while other threads are still
  123. in the guest. The total, minimum and maximum times in nanoseconds
  124. together with the number of executions are reported in debugfs in
  125. kvm/vm#/vcpu#/timings. The overhead is of the order of 30 - 40
  126. ns per exit on POWER8.
  127. If unsure, say N.
  128. config KVM_BOOK3S_HV_NESTED_PMU_WORKAROUND
  129. bool "Nested L0 host workaround for L1 KVM host PMU handling bug" if EXPERT
  130. depends on KVM_BOOK3S_HV_POSSIBLE
  131. default !EXPERT
  132. help
  133. Old nested HV capable Linux guests have a bug where they don't
  134. reflect the PMU in-use status of their L2 guest to the L0 host
  135. while the L2 PMU registers are live. This can result in loss
  136. of L2 PMU register state, causing perf to not work correctly in
  137. L2 guests.
  138. Selecting this option for the L0 host implements a workaround for
  139. those buggy L1s which saves the L2 state, at the cost of performance
  140. in all nested-capable guest entry/exit.
  141. config KVM_BOOK3S_HV_PMU
  142. tristate "Hypervisor Perf events for KVM Book3s-HV"
  143. depends on KVM_BOOK3S_64_HV
  144. help
  145. Enable Book3s-HV Hypervisor Perf events PMU named 'kvm-hv'. These
  146. Perf events give an overview of hypervisor performance overall
  147. instead of a specific guests. Currently the PMU reports
  148. L0-Hypervisor stats on a kvm-hv enabled PSeries LPAR like:
  149. * Total/Used Guest-Heap
  150. * Total/Used Guest Page-table Memory
  151. * Total amount of Guest Page-table Memory reclaimed
  152. config KVM_BOOKE_HV
  153. bool
  154. config KVM_EXIT_TIMING
  155. bool "Detailed exit timing"
  156. depends on KVM_E500V2 || KVM_E500MC
  157. help
  158. Calculate elapsed time for every exit/enter cycle. A per-vcpu
  159. report is available in debugfs kvm/vm#_vcpu#_timing.
  160. The overhead is relatively small, however it is not recommended for
  161. production environments.
  162. If unsure, say N.
  163. config KVM_E500V2
  164. bool "KVM support for PowerPC E500v2 processors"
  165. depends on PPC_E500 && !PPC_E500MC
  166. depends on !CONTEXT_TRACKING_USER
  167. select KVM
  168. select KVM_MMIO
  169. help
  170. Support running unmodified E500 guest kernels in virtual machines on
  171. E500v2 host processors.
  172. This module provides access to the hardware capabilities through
  173. a character device node named /dev/kvm.
  174. If unsure, say N.
  175. config KVM_E500MC
  176. bool "KVM support for PowerPC E500MC/E5500/E6500 processors"
  177. depends on PPC_E500MC
  178. depends on !CONTEXT_TRACKING_USER
  179. select KVM
  180. select KVM_MMIO
  181. select KVM_BOOKE_HV
  182. help
  183. Support running unmodified E500MC/E5500/E6500 guest kernels in
  184. virtual machines on E500MC/E5500/E6500 host processors.
  185. This module provides access to the hardware capabilities through
  186. a character device node named /dev/kvm.
  187. If unsure, say N.
  188. config KVM_MPIC
  189. bool "KVM in-kernel MPIC emulation"
  190. depends on KVM && PPC_E500
  191. select HAVE_KVM_IRQCHIP
  192. select HAVE_KVM_IRQ_ROUTING
  193. select HAVE_KVM_MSI
  194. help
  195. Enable support for emulating MPIC devices inside the
  196. host kernel, rather than relying on userspace to emulate.
  197. Currently, support is limited to certain versions of
  198. Freescale's MPIC implementation.
  199. config KVM_XICS
  200. bool "KVM in-kernel XICS emulation"
  201. depends on KVM_BOOK3S_64 && !KVM_MPIC
  202. select HAVE_KVM_IRQCHIP
  203. default y
  204. help
  205. Include support for the XICS (eXternal Interrupt Controller
  206. Specification) interrupt controller architecture used on
  207. IBM POWER (pSeries) servers.
  208. config KVM_XIVE
  209. bool
  210. default y
  211. depends on KVM_XICS && PPC_XIVE_NATIVE && KVM_BOOK3S_HV_POSSIBLE
  212. endif # VIRTUALIZATION