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