* [PATCH 1/7] Documentation: KVM: Fix references to non-existent identifiers
2026-11-11 8:54 [PATCH 0/7] KVM: Documentation and comment fixes Fuad Tabba
@ 2026-11-11 8:54 ` Fuad Tabba
2026-11-11 8:54 ` [PATCH 2/7] Documentation: KVM: Fix lock names and a lock type in locking.rst Fuad Tabba
` (5 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Fuad Tabba @ 2026-11-11 8:54 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson
Cc: kvm, linux-doc, linux-kernel, Jonathan Corbet,
Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
Huacai Chen, linux-mips, Will Deacon, Fuad Tabba
The KVM API documentation and the review checklist refer to
non-existent ioctls, capabilities, structures, fields and constants.
Use the names from the uAPI headers.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
Documentation/virt/kvm/api.rst | 40 ++++++++++-----------
Documentation/virt/kvm/review-checklist.rst | 2 +-
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index e95c9cda085d9..ccdc210575e25 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -897,7 +897,7 @@ x86 allows the operating system to program the interrupt polarity
(active-low/active-high) for level-triggered interrupts, and KVM used
to consider the polarity. However, due to bitrot in the handling of
active-low interrupts, the above convention is now valid on x86 too.
-This is signaled by KVM_CAP_X86_IOAPIC_POLARITY_IGNORED. Userspace
+This is signaled by KVM_CAP_IOAPIC_POLARITY_IGNORED. Userspace
should not present interrupts to the guest as active-low unless this
capability is present (or unless it is not using the in-kernel irqchip,
of course).
@@ -941,7 +941,7 @@ be used for a userspace interrupt controller.
struct kvm_irq_level {
union {
__u32 irq; /* GSI */
- __s32 status; /* not used for KVM_IRQ_LEVEL */
+ __s32 status; /* not used for KVM_IRQ_LINE */
};
__u32 level; /* 0 or 1 */
};
@@ -3219,7 +3219,7 @@ With KVM_CAP_IRQFD_RESAMPLE, KVM_IRQFD supports a de-assert and notify
mechanism allowing emulation of level-triggered, irqfd-based
interrupts. When KVM_IRQFD_FLAG_RESAMPLE is set the user must pass an
additional eventfd in the kvm_irqfd.resamplefd field. When operating
-in resample mode, posting of an interrupt through kvm_irq.fd asserts
+in resample mode, posting of an interrupt through kvm_irqfd.fd asserts
the specified gsi in the irqchip. When the irqchip is resampled, such
as from an EOI, the gsi is de-asserted and the user is notified via
kvm_irqfd.resamplefd. It is the user's responsibility to re-queue
@@ -4982,8 +4982,8 @@ Errors:
#define KVM_STATE_NESTED_VMX_VMCS_SIZE 0x1000
#define KVM_STATE_NESTED_SVM_VMCB_SIZE 0x1000
- #define KVM_STATE_NESTED_VMX_SMM_GUEST_MODE 0x00000001
- #define KVM_STATE_NESTED_VMX_SMM_VMXON 0x00000002
+ #define KVM_STATE_NESTED_SMM_GUEST_MODE 0x00000001
+ #define KVM_STATE_NESTED_SMM_VMXON 0x00000002
#define KVM_STATE_NESTED_GIF_SET 0x00000100
@@ -5448,14 +5448,14 @@ KVM_PV_DISABLE
KVM_PV_ASYNC_CLEANUP_PERFORM, it will be torn down in this call
together with the current protected VM.
-KVM_PV_VM_SET_SEC_PARMS
+KVM_PV_SET_SEC_PARMS
Pass the image header from VM memory to the Ultravisor in
preparation of image unpacking and verification.
-KVM_PV_VM_UNPACK
+KVM_PV_UNPACK
Unpack (protect and decrypt) a page of the encrypted boot image.
-KVM_PV_VM_VERIFY
+KVM_PV_VERIFY
Verify the integrity of the unpacked image. Only if this succeeds,
KVM is allowed to start protected VCPUs.
@@ -5951,7 +5951,7 @@ This ioctl (when supported) replaces the KVM_SET_SREGS.
4.133 KVM_GET_STATS_FD
----------------------
-:Capability: KVM_CAP_STATS_BINARY_FD
+:Capability: KVM_CAP_BINARY_STATS_FD
:Architectures: all
:Type: vm ioctl, vcpu ioctl
:Parameters: none
@@ -6087,10 +6087,10 @@ Bits 0-3 of ``flags`` encode the type:
* ``KVM_STATS_TYPE_LINEAR_HIST``
The statistic is reported as a linear histogram. The number of
buckets is specified by the ``size`` field. The size of buckets is specified
- by the ``hist_param`` field. The range of the Nth bucket (1 <= N < ``size``)
- is [``hist_param``*(N-1), ``hist_param``*N), while the range of the last
- bucket is [``hist_param``*(``size``-1), +INF). (+INF means positive infinity
- value.)
+ by the ``bucket_size`` field. The range of the Nth bucket
+ (1 <= N < ``size``) is [``bucket_size``*(N-1), ``bucket_size``*N), while
+ the range of the last bucket is [``bucket_size``*(``size``-1), +INF).
+ (+INF means positive infinity value.)
* ``KVM_STATS_TYPE_LOG_HIST``
The statistic is reported as a logarithmic histogram. The number of
buckets is specified by the ``size`` field. The range of the first bucket is
@@ -6962,8 +6962,8 @@ to the byte array.
.. note::
- For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_PAPR, KVM_EXIT_XEN,
- KVM_EXIT_EPR, KVM_EXIT_HYPERCALL, KVM_EXIT_TDX,
+ For KVM_EXIT_IO, KVM_EXIT_MMIO, KVM_EXIT_OSI, KVM_EXIT_PAPR_HCALL,
+ KVM_EXIT_XEN, KVM_EXIT_EPR, KVM_EXIT_HYPERCALL, KVM_EXIT_TDX,
KVM_EXIT_X86_RDMSR and KVM_EXIT_X86_WRMSR the corresponding
operations are complete (and guest state is consistent) only after userspace
has re-entered the kernel with KVM_RUN. The kernel side will first finish
@@ -8607,7 +8607,7 @@ See Documentation/arch/x86/sgx.rst for more details.
:Parameters: args[0] whether the feature should be enabled or not
When this capability is enabled, an emulation failure will result in an exit
-to userspace with KVM_INTERNAL_ERROR (except when the emulator was invoked
+to userspace with KVM_EXIT_INTERNAL_ERROR (except when the emulator was invoked
to handle a VMware backdoor instruction). Furthermore, KVM will now provide up
to 15 instruction bytes for any exit to userspace resulting from an emulation
failure. When these exits to userspace occur use the emulation_failure struct
@@ -9232,7 +9232,7 @@ utilises it.
If KVM_CHECK_EXTENSION on a kvm VM handle indicates that this capability is
available, it means that the VM is using full hardware assisted virtualization
capabilities of the hardware. This is useful to check after creating a VM with
-KVM_VM_MIPS_DEFAULT.
+KVM_VM_MIPS_AUTO.
The value returned by KVM_CHECK_EXTENSION should be compared against known
values (see below). All other values are reserved. This is to allow for the
@@ -9541,8 +9541,8 @@ related to event channel delivery, timers, and the XENVER_version
interception.
The KVM_XEN_HVM_CONFIG_RUNSTATE_UPDATE_FLAG flag indicates that KVM supports
-the KVM_XEN_ATTR_TYPE_RUNSTATE_UPDATE_FLAG attribute in the KVM_XEN_SET_ATTR
-and KVM_XEN_GET_ATTR ioctls. This controls whether KVM will set the
+the KVM_XEN_ATTR_TYPE_RUNSTATE_UPDATE_FLAG attribute in the KVM_XEN_HVM_SET_ATTR
+and KVM_XEN_HVM_GET_ATTR ioctls. This controls whether KVM will set the
XEN_RUNSTATE_UPDATE flag in guest memory mapped vcpu_runstate_info during
updates of the runstate information. Note that versions of KVM which support
the RUNSTATE feature above, but not the RUNSTATE_UPDATE_FLAG feature, will
@@ -9750,7 +9750,7 @@ Local APIC features
CPU[EAX=1]:ECX[21] (X2APIC) is reported by ``KVM_GET_SUPPORTED_CPUID``,
but it can only be enabled if ``KVM_CREATE_IRQCHIP`` or
-``KVM_ENABLE_CAP(KVM_CAP_IRQCHIP_SPLIT)`` are used to enable in-kernel emulation of
+``KVM_ENABLE_CAP(KVM_CAP_SPLIT_IRQCHIP)`` are used to enable in-kernel emulation of
the local APIC.
The same is true for the ``KVM_FEATURE_PV_UNHALT`` paravirtualized feature.
diff --git a/Documentation/virt/kvm/review-checklist.rst b/Documentation/virt/kvm/review-checklist.rst
index 053f00c50d669..5f8398be52472 100644
--- a/Documentation/virt/kvm/review-checklist.rst
+++ b/Documentation/virt/kvm/review-checklist.rst
@@ -18,7 +18,7 @@ Review checklist for kvm patches
5. New features must default to off (userspace should explicitly request them).
Performance improvements can and should default to on.
-6. New cpu features should be exposed via KVM_GET_SUPPORTED_CPUID2,
+6. New cpu features should be exposed via KVM_GET_SUPPORTED_CPUID,
or its equivalent for non-x86 architectures
7. The feature should be testable (see below).
--
2.47.3
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 2/7] Documentation: KVM: Fix lock names and a lock type in locking.rst
2026-11-11 8:54 [PATCH 0/7] KVM: Documentation and comment fixes Fuad Tabba
2026-11-11 8:54 ` [PATCH 1/7] Documentation: KVM: Fix references to non-existent identifiers Fuad Tabba
@ 2026-11-11 8:54 ` Fuad Tabba
2026-11-11 8:54 ` [PATCH 3/7] Documentation: KVM: Fix the function that implements halt polling Fuad Tabba
` (4 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Fuad Tabba @ 2026-11-11 8:54 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson
Cc: kvm, linux-doc, linux-kernel, Jonathan Corbet,
Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
Huacai Chen, linux-mips, Will Deacon, Fuad Tabba
The x86 lock ordering refers to kvm->arch.mmu_lock instead of
kvm->mmu_lock. The entry for wakeup_vcpus_on_cpu_lock gives its type
as spinlock_t instead of raw_spinlock_t, and its comment uses the list
and lock names from before commit 12a8eee5686ef ("KVM: Move x86 VMX's
posted interrupt list_head to vcpu_vmx").
Fix all three.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
Documentation/virt/kvm/locking.rst | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/Documentation/virt/kvm/locking.rst b/Documentation/virt/kvm/locking.rst
index 662231e958a07..df0db74630976 100644
--- a/Documentation/virt/kvm/locking.rst
+++ b/Documentation/virt/kvm/locking.rst
@@ -54,9 +54,9 @@ On x86:
- vcpu->mutex is taken outside kvm->arch.hyperv.hv_lock and kvm->arch.xen.xen_lock
-- kvm->arch.mmu_lock is an rwlock; critical sections for
+- kvm->mmu_lock is an rwlock; critical sections for
kvm->arch.tdp_mmu_pages_lock and kvm->arch.mmu_unsync_pages_lock must
- also take kvm->arch.mmu_lock
+ also take kvm->mmu_lock
Everything else is a leaf: no other lock is taken inside the critical
sections.
@@ -297,13 +297,13 @@ time it will be set using the Dirty tracking mechanism described above.
``wakeup_vcpus_on_cpu_lock``
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-:Type: spinlock_t
+:Type: raw_spinlock_t
:Arch: x86
:Protects: wakeup_vcpus_on_cpu
:Comment: This is a per-CPU lock and it is used for VT-d posted-interrupts.
When VT-d posted-interrupts are supported and the VM has assigned
- devices, we put the blocked vCPU on the list blocked_vcpu_on_cpu
- protected by blocked_vcpu_on_cpu_lock. When VT-d hardware issues
+ devices, we put the blocked vCPU on the list wakeup_vcpus_on_cpu
+ protected by wakeup_vcpus_on_cpu_lock. When VT-d hardware issues
wakeup notification event since external interrupts from the
assigned devices happens, we will find the vCPU on the list to
wakeup.
--
2.47.3
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 3/7] Documentation: KVM: Fix the function that implements halt polling
2026-11-11 8:54 [PATCH 0/7] KVM: Documentation and comment fixes Fuad Tabba
2026-11-11 8:54 ` [PATCH 1/7] Documentation: KVM: Fix references to non-existent identifiers Fuad Tabba
2026-11-11 8:54 ` [PATCH 2/7] Documentation: KVM: Fix lock names and a lock type in locking.rst Fuad Tabba
@ 2026-11-11 8:54 ` Fuad Tabba
2026-11-11 8:54 ` [PATCH 4/7] Documentation: KVM: Drop the stale number of vCPU request flags Fuad Tabba
` (3 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Fuad Tabba @ 2026-11-11 8:54 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson
Cc: kvm, linux-doc, linux-kernel, Jonathan Corbet,
Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
Huacai Chen, linux-mips, Will Deacon, Fuad Tabba
The generic halt polling code is in kvm_vcpu_halt() since
commit 91b99ea706578 ("KVM: Rename kvm_vcpu_block() =>
kvm_vcpu_halt()"), but halt-polling.rst still names kvm_vcpu_block().
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
Documentation/virt/kvm/halt-polling.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/virt/kvm/halt-polling.rst b/Documentation/virt/kvm/halt-polling.rst
index a6790a67e2058..c311aac1ff9e9 100644
--- a/Documentation/virt/kvm/halt-polling.rst
+++ b/Documentation/virt/kvm/halt-polling.rst
@@ -22,7 +22,7 @@ savings of not invoking the scheduler are distinguishable.
The generic halt polling code is implemented in:
- virt/kvm/kvm_main.c: kvm_vcpu_block()
+ virt/kvm/kvm_main.c: kvm_vcpu_halt()
The powerpc kvm-hv specific case is implemented in:
--
2.47.3
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 4/7] Documentation: KVM: Drop the stale number of vCPU request flags
2026-11-11 8:54 [PATCH 0/7] KVM: Documentation and comment fixes Fuad Tabba
` (2 preceding siblings ...)
2026-11-11 8:54 ` [PATCH 3/7] Documentation: KVM: Fix the function that implements halt polling Fuad Tabba
@ 2026-11-11 8:54 ` Fuad Tabba
2026-11-11 8:54 ` [PATCH 5/7] KVM: Fix comments that refer to non-existent identifiers Fuad Tabba
` (2 subsequent siblings)
6 siblings, 0 replies; 9+ messages in thread
From: Fuad Tabba @ 2026-11-11 8:54 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson
Cc: kvm, linux-doc, linux-kernel, Jonathan Corbet,
Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
Huacai Chen, linux-mips, Will Deacon, Fuad Tabba
vcpu-requests.rst states that only two request flags are defined, but
KVM_REQUEST_NO_ACTION is a third. Drop the number.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
Documentation/virt/kvm/vcpu-requests.rst | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/Documentation/virt/kvm/vcpu-requests.rst b/Documentation/virt/kvm/vcpu-requests.rst
index 06718b9bc9597..eedf338d47d6a 100644
--- a/Documentation/virt/kvm/vcpu-requests.rst
+++ b/Documentation/virt/kvm/vcpu-requests.rst
@@ -141,8 +141,7 @@ KVM_REQUEST_MASK
VCPU requests should be masked by KVM_REQUEST_MASK before using them with
bitops. This is because only the lower 8 bits are used to represent the
-request's number. The upper bits are used as flags. Currently only two
-flags are defined.
+request's number. The upper bits are used as flags.
VCPU Request Flags
------------------
--
2.47.3
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 5/7] KVM: Fix comments that refer to non-existent identifiers
2026-11-11 8:54 [PATCH 0/7] KVM: Documentation and comment fixes Fuad Tabba
` (3 preceding siblings ...)
2026-11-11 8:54 ` [PATCH 4/7] Documentation: KVM: Drop the stale number of vCPU request flags Fuad Tabba
@ 2026-11-11 8:54 ` Fuad Tabba
2026-11-11 8:54 ` [PATCH 6/7] KVM: Fix the range of reserved arch-independent request bits Fuad Tabba
2026-11-11 8:54 ` [PATCH 7/7] KVM: Fix typos in comments Fuad Tabba
6 siblings, 0 replies; 9+ messages in thread
From: Fuad Tabba @ 2026-11-11 8:54 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson
Cc: kvm, linux-doc, linux-kernel, Jonathan Corbet,
Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
Huacai Chen, linux-mips, Will Deacon, Fuad Tabba
Comments in the generic KVM code and its headers refer to functions,
structures, fields, capabilities and Kconfig symbols that have been
misspelled or renamed. Use the current names.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
include/linux/kvm_dirty_ring.h | 2 +-
include/linux/kvm_host.h | 4 ++--
include/linux/kvm_irqfd.h | 4 ++--
include/uapi/linux/kvm.h | 2 +-
virt/kvm/binary_stats.c | 2 +-
virt/kvm/eventfd.c | 2 +-
virt/kvm/kvm_main.c | 2 +-
7 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/include/linux/kvm_dirty_ring.h b/include/linux/kvm_dirty_ring.h
index eb10d87adf7d5..8679ba17bd1ff 100644
--- a/include/linux/kvm_dirty_ring.h
+++ b/include/linux/kvm_dirty_ring.h
@@ -29,7 +29,7 @@ struct kvm_dirty_ring {
#ifndef CONFIG_HAVE_KVM_DIRTY_RING
/*
- * If CONFIG_HAVE_HVM_DIRTY_RING not defined, kvm_dirty_ring.o should
+ * If CONFIG_HAVE_KVM_DIRTY_RING not defined, kvm_dirty_ring.o should
* not be included as well, so define these nop functions for the arch.
*/
static inline u32 kvm_dirty_ring_get_rsvd_entries(struct kvm *kvm)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index e7fc94e2910a8..4b91ef9667703 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -764,7 +764,7 @@ struct kvm {
struct mutex slots_lock;
/*
- * Protects the arch-specific fields of struct kvm_memory_slots in
+ * Protects the arch-specific fields of struct kvm_memory_slot in
* use by the VM. To be used under the slots_lock (above) or in a
* kvm->srcu critical section where acquiring the slots_lock would
* lead to deadlock with the synchronize_srcu in
@@ -802,7 +802,7 @@ struct kvm {
/*
* created_vcpus is protected by kvm->lock, and is incremented
* at the beginning of KVM_CREATE_VCPU. online_vcpus is only
- * incremented after storing the kvm_vcpu pointer in vcpus,
+ * incremented after storing the kvm_vcpu pointer in vcpu_array,
* and is accessed atomically.
*/
atomic_t online_vcpus;
diff --git a/include/linux/kvm_irqfd.h b/include/linux/kvm_irqfd.h
index ef8c134ded8a3..bca430a4ae3a8 100644
--- a/include/linux/kvm_irqfd.h
+++ b/include/linux/kvm_irqfd.h
@@ -23,13 +23,13 @@
struct kvm_kernel_irqfd_resampler {
struct kvm *kvm;
/*
- * List of resampling struct _irqfd objects sharing this gsi.
+ * List of resampling struct kvm_kernel_irqfd objects sharing this gsi.
* RCU list modified under kvm->irqfds.resampler_lock
*/
struct list_head list;
struct kvm_irq_ack_notifier notifier;
/*
- * Entry in list of kvm->irqfd.resampler_list. Use for sharing
+ * Entry in list of kvm->irqfds.resampler_list. Use for sharing
* resamplers among irqfds on the same gsi.
* RCU list modified under kvm->irqfds.resampler_lock
*/
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 8dff2fc1972e9..951b891b8ae60 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -1459,7 +1459,7 @@ struct kvm_enc_region {
#define KVM_GET_NESTED_STATE _IOWR(KVMIO, 0xbe, struct kvm_nested_state)
#define KVM_SET_NESTED_STATE _IOW(KVMIO, 0xbf, struct kvm_nested_state)
-/* Available with KVM_CAP_MANUAL_DIRTY_LOG_PROTECT_2 */
+/* Available with KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2 */
#define KVM_CLEAR_DIRTY_LOG _IOWR(KVMIO, 0xc0, struct kvm_clear_dirty_log)
/* Available with KVM_CAP_HYPERV_CPUID (vcpu) / KVM_CAP_SYS_HYPERV_CPUID (system) */
diff --git a/virt/kvm/binary_stats.c b/virt/kvm/binary_stats.c
index 76ce697c773bf..c772fe7be5dd7 100644
--- a/virt/kvm/binary_stats.c
+++ b/virt/kvm/binary_stats.c
@@ -116,7 +116,7 @@ ssize_t kvm_stats_read(char *id, const struct kvm_stats_header *header,
* The descriptors copy would be skipped in the typical case that
* userspace periodically read stats data, since the pos would be
* greater than the end address of descriptors
- * (header->header.desc_offset + size_desc) causing copylen <= 0.
+ * (header->desc_offset + size_desc) causing copylen <= 0.
*/
copylen = header->desc_offset + size_desc - pos;
copylen = min(copylen, remain);
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index f43b8b25bc854..81ed20ec0d4a1 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -248,7 +248,7 @@ irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
/*
* Taking irqfds.lock is safe here, as KVM holds a reference to
* the eventfd when registering the irqfd, i.e. this path can't
- * be reached while kvm_irqfd_add() is running.
+ * be reached while kvm_irqfd_register() is running.
*/
spin_lock_irqsave(&kvm->irqfds.lock, iflags);
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index cf4cb586f1407..ba8f53ec3d718 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -4338,7 +4338,7 @@ static int kvm_vm_ioctl_create_vcpu(struct kvm *kvm, unsigned long id)
/*
* Pairs with smp_rmb() in kvm_get_vcpu. Store the vcpu
- * pointer before kvm->online_vcpu's incremented value.
+ * pointer before incrementing kvm->online_vcpus.
*/
smp_wmb();
atomic_inc(&kvm->online_vcpus);
--
2.47.3
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 6/7] KVM: Fix the range of reserved arch-independent request bits
2026-11-11 8:54 [PATCH 0/7] KVM: Documentation and comment fixes Fuad Tabba
` (4 preceding siblings ...)
2026-11-11 8:54 ` [PATCH 5/7] KVM: Fix comments that refer to non-existent identifiers Fuad Tabba
@ 2026-11-11 8:54 ` Fuad Tabba
2026-11-11 8:54 ` [PATCH 7/7] KVM: Fix typos in comments Fuad Tabba
6 siblings, 0 replies; 9+ messages in thread
From: Fuad Tabba @ 2026-11-11 8:54 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson
Cc: kvm, linux-doc, linux-kernel, Jonathan Corbet,
Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
Huacai Chen, linux-mips, Will Deacon, Fuad Tabba
KVM_REQ_DIRTY_RING_SOFT_FULL is bit 3, so the bits reserved for more
architecture-independent requests are 4-7. Fix the comment.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
include/linux/kvm_host.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 4b91ef9667703..21207d234618a 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -165,7 +165,7 @@ static inline bool kvm_is_error_gpa(gpa_t gpa)
#define KVM_REQUEST_NO_ACTION BIT(10)
/*
* Architecture-independent vcpu->requests bit members
- * Bits 3-7 are reserved for more arch-independent bits.
+ * Bits 4-7 are reserved for more arch-independent bits.
*/
#define KVM_REQ_TLB_FLUSH (0 | KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
#define KVM_REQ_VM_DEAD (1 | KVM_REQUEST_WAIT | KVM_REQUEST_NO_WAKEUP)
--
2.47.3
^ permalink raw reply [flat|nested] 9+ messages in thread* [PATCH 7/7] KVM: Fix typos in comments
2026-11-11 8:54 [PATCH 0/7] KVM: Documentation and comment fixes Fuad Tabba
` (5 preceding siblings ...)
2026-11-11 8:54 ` [PATCH 6/7] KVM: Fix the range of reserved arch-independent request bits Fuad Tabba
@ 2026-11-11 8:54 ` Fuad Tabba
2026-11-11 17:05 ` Randy Dunlap
6 siblings, 1 reply; 9+ messages in thread
From: Fuad Tabba @ 2026-11-11 8:54 UTC (permalink / raw)
To: Paolo Bonzini, Sean Christopherson
Cc: kvm, linux-doc, linux-kernel, Jonathan Corbet,
Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
Huacai Chen, linux-mips, Will Deacon, Fuad Tabba
Fix typos in comments in the generic KVM code and in the KVM uAPI
header.
Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev>
---
include/linux/kvm_host.h | 10 +++++-----
include/uapi/linux/kvm.h | 6 +++---
virt/kvm/binary_stats.c | 2 +-
virt/kvm/eventfd.c | 2 +-
virt/kvm/guest_memfd.c | 2 +-
virt/kvm/kvm_main.c | 6 +++---
6 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 21207d234618a..f94fada229053 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -105,7 +105,7 @@
#define KVM_PFN_ERR_NEEDS_IO (KVM_PFN_ERR_MASK + 4)
/*
- * error pfns indicate that the gfn is in slot but faild to
+ * error pfns indicate that the gfn is in slot but failed to
* translate it to pfn on host.
*/
static inline bool is_error_pfn(kvm_pfn_t pfn)
@@ -174,7 +174,7 @@ static inline bool kvm_is_error_gpa(gpa_t gpa)
#define KVM_REQUEST_ARCH_BASE 8
/*
- * KVM_REQ_OUTSIDE_GUEST_MODE exists is purely as way to force the vCPU to
+ * KVM_REQ_OUTSIDE_GUEST_MODE exists purely as a way to force the vCPU to
* OUTSIDE_GUEST_MODE. KVM_REQ_OUTSIDE_GUEST_MODE differs from a vCPU "kick"
* in that it ensures the vCPU has reached OUTSIDE_GUEST_MODE before continuing
* on. A kick only guarantees that the vCPU is on its way out, e.g. a previous
@@ -2185,7 +2185,7 @@ static inline int mmu_invalidate_retry_gfn(struct kvm *kvm,
* If mmu_invalidate_in_progress is non-zero, then the range maintained
* by kvm_mmu_notifier_invalidate_range_start contains all addresses
* that might be being invalidated. Note that it may include some false
- * positives, due to shortcuts when handing concurrent invalidations.
+ * positives, due to shortcuts when handling concurrent invalidations.
*/
if (unlikely(kvm->mmu_invalidate_in_progress)) {
/*
@@ -2471,7 +2471,7 @@ void kvm_arch_update_irqfd_routing(struct kvm_kernel_irqfd *irqfd,
#endif /* CONFIG_HAVE_KVM_IRQ_BYPASS */
#ifdef __KVM_HAVE_INVALID_WAKEUPS
-/* If we wakeup during the poll time, was it a sucessful poll? */
+/* If we wakeup during the poll time, was it a successful poll? */
static inline bool vcpu_valid_wakeup(struct kvm_vcpu *vcpu)
{
return vcpu->valid_wakeup;
@@ -2526,7 +2526,7 @@ static inline int kvm_xfer_to_guest_mode_handle_work(struct kvm_vcpu *vcpu)
/*
* If more than one page is being (un)accounted, @virt must be the address of
- * the first page of a block of pages what were allocated together (i.e
+ * the first page of a block of pages that were allocated together (i.e
* accounted together).
*
* kvm_account_pgtable_pages() is thread-safe because mod_lruvec_page_state()
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h
index 951b891b8ae60..3d709737c3f83 100644
--- a/include/uapi/linux/kvm.h
+++ b/include/uapi/linux/kvm.h
@@ -508,7 +508,7 @@ struct kvm_run {
/*
* shared registers between kvm and userspace.
* kvm_valid_regs specifies the register classes set by the host
- * kvm_dirty_regs specified the register classes dirtied by userspace
+ * kvm_dirty_regs specifies the register classes dirtied by userspace
* struct kvm_sync_regs is architecture specific, as well as the
* bits for kvm_valid_regs and kvm_dirty_regs
*/
@@ -1556,12 +1556,12 @@ struct kvm_dirty_gfn {
* @flags: Some extra information for header, always 0 for now.
* @name_size: The size in bytes of the memory which contains statistics
* name string including trailing '\0'. The memory is allocated
- * at the send of statistics descriptor.
+ * at the end of statistics descriptor.
* @num_desc: The number of statistics the vm or vcpu has.
* @id_offset: The offset of the vm/vcpu stats' id string in the file pointed
* by vm/vcpu stats fd.
* @desc_offset: The offset of the vm/vcpu stats' descriptor block in the file
- * pointd by vm/vcpu stats fd.
+ * pointed by vm/vcpu stats fd.
* @data_offset: The offset of the vm/vcpu stats' data block in the file
* pointed by vm/vcpu stats fd.
*
diff --git a/virt/kvm/binary_stats.c b/virt/kvm/binary_stats.c
index c772fe7be5dd7..654381d22480f 100644
--- a/virt/kvm/binary_stats.c
+++ b/virt/kvm/binary_stats.c
@@ -22,7 +22,7 @@
* @user_buffer: start address of userspace buffer
* @size: requested read size from userspace
* @offset: the start position from which the content will be read for the
- * corresponding vm or vcp file descriptor
+ * corresponding vm or vcpu file descriptor
*
* The file content of a vm/vcpu file descriptor is now defined as below:
* +-------------+
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index 81ed20ec0d4a1..73db4938d5a11 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -470,7 +470,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
/*
* Register the irqfd with the eventfd by polling on the eventfd, and
- * simultaneously and the irqfd to KVM's list. If there was en event
+ * simultaneously add the irqfd to KVM's list. If there was an event
* pending on the eventfd prior to registering, manually trigger IRQ
* injection.
*/
diff --git a/virt/kvm/guest_memfd.c b/virt/kvm/guest_memfd.c
index 8c97a69b16dc0..3e02acf889396 100644
--- a/virt/kvm/guest_memfd.c
+++ b/virt/kvm/guest_memfd.c
@@ -376,7 +376,7 @@ static int kvm_gmem_release(struct inode *inode, struct file *file)
* CPU0 CPU1
* kvm_gmem_get_pfn()
* slot->gmem.file == A
- * kvm_gmem_release())
+ * kvm_gmem_release()
* slot->gmem.file = NULL
*
* kvm_set_memory_region()
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index ba8f53ec3d718..65dc9d3eb8448 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1628,7 +1628,7 @@ static void kvm_swap_active_memslots(struct kvm *kvm, int as_id)
{
struct kvm_memslots *slots = kvm_get_inactive_memslots(kvm, as_id);
- /* Grab the generation from the activate memslots. */
+ /* Grab the generation from the active memslots. */
u64 gen = __kvm_memslots(kvm, as_id)->generation;
WARN_ON(gen & KVM_MEMSLOT_GEN_UPDATE_IN_PROGRESS);
@@ -3044,7 +3044,7 @@ static int hva_to_pfn_remapped(struct vm_area_struct *vma,
/*
* Remapped memory cannot be pinned in any meaningful sense. Bail if
* the caller wants to pin the page, i.e. access the page outside of
- * MMU notifier protection, and unsafe umappings are disallowed.
+ * MMU notifier protection, and unsafe mappings are disallowed.
*/
if (kfp->pin && !allow_unsafe_mappings)
return -EINVAL;
@@ -4044,7 +4044,7 @@ static bool vcpu_dy_runnable(struct kvm_vcpu *vcpu)
/*
* By default, simply query the target vCPU's current mode when checking if a
* vCPU was preempted in kernel mode. All architectures except x86 (or more
- * specifical, except VMX) allow querying whether or not a vCPU is in kernel
+ * specifically, except VMX) allow querying whether or not a vCPU is in kernel
* mode even if the vCPU is NOT loaded, i.e. using kvm_arch_vcpu_in_kernel()
* directly for cross-vCPU checks is functionally correct and accurate.
*/
--
2.47.3
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH 7/7] KVM: Fix typos in comments
2026-11-11 8:54 ` [PATCH 7/7] KVM: Fix typos in comments Fuad Tabba
@ 2026-11-11 17:05 ` Randy Dunlap
0 siblings, 0 replies; 9+ messages in thread
From: Randy Dunlap @ 2026-11-11 17:05 UTC (permalink / raw)
To: Fuad Tabba, Paolo Bonzini, Sean Christopherson
Cc: kvm, linux-doc, linux-kernel, Jonathan Corbet,
Christian Borntraeger, Janosch Frank, Claudio Imbrenda,
Huacai Chen, linux-mips, Will Deacon, Fuad Tabba
On 11/11/26 12:54 AM, Fuad Tabba wrote:
> @@ -2526,7 +2526,7 @@ static inline int kvm_xfer_to_guest_mode_handle_work(struct kvm_vcpu *vcpu)
>
> /*
> * If more than one page is being (un)accounted, @virt must be the address of
> - * the first page of a block of pages what were allocated together (i.e
> + * the first page of a block of pages that were allocated together (i.e
i.e.
> * accounted together).
Anyway, these changes look good.
Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
Thanks.
--
~Randy
^ permalink raw reply [flat|nested] 9+ messages in thread