kernel-hacking-2024-linux-s.../Documentation
Sean Christopherson b4886fab6f KVM: Add a module param to allow enabling virtualization when KVM is loaded
Add an on-by-default module param, enable_virt_at_load, to let userspace
force virtualization to be enabled in hardware when KVM is initialized,
i.e. just before /dev/kvm is exposed to userspace.  Enabling virtualization
during KVM initialization allows userspace to avoid the additional latency
when creating/destroying the first/last VM (or more specifically, on the
0=>1 and 1=>0 edges of creation/destruction).

Now that KVM uses the cpuhp framework to do per-CPU enabling, the latency
could be non-trivial as the cpuhup bringup/teardown is serialized across
CPUs, e.g. the latency could be problematic for use case that need to spin
up VMs quickly.

Prior to commit 10474ae894 ("KVM: Activate Virtualization On Demand"),
KVM _unconditionally_ enabled virtualization during load, i.e. there's no
fundamental reason KVM needs to dynamically toggle virtualization.  These
days, the only known argument for not enabling virtualization is to allow
KVM to be autoloaded without blocking other out-of-tree hypervisors, and
such use cases can simply change the module param, e.g. via command line.

Note, the aforementioned commit also mentioned that enabling SVM (AMD's
virtualization extensions) can result in "using invalid TLB entries".
It's not clear whether the changelog was referring to a KVM bug, a CPU
bug, or something else entirely.  Regardless, leaving virtualization off
by default is not a robust "fix", as any protection provided is lost the
instant userspace creates the first VM.

Reviewed-by: Chao Gao <chao.gao@intel.com>
Acked-by: Kai Huang <kai.huang@intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Tested-by: Farrah Chen <farrah.chen@intel.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20240830043600.127750-8-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2024-09-04 11:02:33 -04:00
..
ABI doc: platform: cznic: turris-omnia-mcu: Use double backticks for attribute value 2024-08-07 14:43:54 +02:00
accel
accounting
admin-guide KVM: Add a module param to allow enabling virtualization when KVM is loaded 2024-09-04 11:02:33 -04:00
arch arm64: errata: Expand speculative SSBS workaround (again) 2024-08-01 16:11:28 +01:00
block
bpf
cdrom
core-api Updates for the interrupt subsystem: 2024-07-22 13:52:05 -07:00
cpu-freq
crypto
dev-tools - 875fa64577da ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00
devicetree USB fixes for 6.11-rc3 2024-08-11 09:55:32 -07:00
doc-guide
driver-api thermal: core: Update thermal zone registration documentation 2024-08-02 13:22:37 +02:00
fault-injection
fb
features LoongArch: Add ARCH_HAS_DEBUG_VM_PGTABLE support 2024-07-20 22:40:59 +08:00
filesystems - 875fa64577da ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00
firmware-guide
firmware_class
fpga
gpu Documentation/amdgpu: Fix duplicate declaration 2024-07-16 11:45:22 -04:00
hid
hwmon hwmon updates for v6.11-rc1 2024-07-15 17:39:13 -07:00
i2c
iio
images
infiniband
input
isdn
kbuild kbuild: doc: gcc to CC change 2024-07-24 01:18:25 +09:00
kernel-hacking
leds
litmus-tests
livepatch
locking
maintainer docs: maintainer: discourage taking conversations off-list 2024-07-16 11:08:26 -06:00
mhi
misc-devices
mm - 875fa64577da ("mm/hugetlb_vmemmap: fix race with speculative PFN 2024-07-21 17:15:46 -07:00
netlabel
netlink ethtool: rss: echo the context number back 2024-07-25 16:23:47 -07:00
networking ethtool: rss: echo the context number back 2024-07-25 16:23:47 -07:00
nvdimm
nvme
PCI Merge branch 'pci/misc' 2024-07-19 10:10:33 -05:00
pcmcia
peci
power
process Documentation: embargoed-hardware-issues.rst: add a section documenting the "early access" process 2024-07-31 13:26:43 +02:00
RCU
rust Rust changes for v6.11 2024-07-27 13:44:54 -07:00
scheduler
scsi
security
sound
sphinx
sphinx-static
spi
staging
target
tee
timers
tools
trace ftrace: Rewrite of function graph tracer 2024-07-18 13:36:33 -07:00
translations pci-v6.11-changes 2024-07-19 19:03:18 -07:00
usb
userspace-api media: v4l: Fix missing tabular column hint for Y14P format 2024-07-30 08:36:29 +02:00
virt KVM: Register cpuhp and syscore callbacks when enabling hardware 2024-09-04 11:02:33 -04:00
w1
watchdog
wmi platform/x86: msi-wmi-platform: Fix spelling mistakes 2024-07-31 12:37:01 +03:00
.gitignore
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py
docutils.conf
dontdiff
index.rst
Kconfig
Makefile
memory-barriers.txt
SubmittingPatches
subsystem-apis.rst