Skip to contentSkip to conversation

KVM: Replace VCPU_RUN with KVM_RUN in comments and docs

PATCH Applied Fuad Tabba 4 participants 8 messages Sep 15 – Oct 7

Subsystems (6)
Documentation KVM PowerPC arm64 +2 more subsystems
lore
Share & tools
lore

Fuad Tabba

author reviewer
#0 lore raw

cover KVM: Replace VCPU_RUN with KVM_RUN in comments and docs

Hi folks,

This one has been bugging me for a while. Five comments and doc lines name a VCPU_RUN ioctl (KVM_VCPU_RUN in book3s_hv.c, VCPU RUN in kvm_host.h). The ioctl that enters the guest is KVM_RUN.

The patches are independent and split by tree, one each for generic KVM, KVM/arm64 and Book3S HV, so each can go through its own maintainer. Nothing else in the tree refers to the ioctl by a wrong name.

Based on Linux 7.3-rc3 (fd73f4a665989).

Cheers,
/fuad

Fuad Tabba (3):
KVM: Fix comments that refer to the non-existent VCPU_RUN ioctl
KVM: arm64: Fix references to the non-existent VCPU_RUN ioctl
KVM: PPC: Book3S HV: Fix comment naming a non-existent KVM_VCPU_RUN
ioctl

 Documentation/virt/kvm/arm/pkvm.rst | 2 +-
 arch/arm64/kvm/arm.c                | 2 +-
 arch/powerpc/kvm/book3s_hv.c        | 2 +-
 include/linux/kvm_host.h            | 2 +-
 virt/kvm/kvm_main.c                 | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

base-commit: fd73f4a6659897191fa0d40695fe370925dd3780

Signature · 1 line
2.39.5
author reviewer
#1 lore raw

PATCH 1/3 KVM: Fix comments that refer to the non-existent VCPU_RUN ioctl

Neither the VCPU_RUN in kvm_main.c nor the VCPU RUN in kvm_host.h names an ioctl that exists. The one that enters the guest is KVM_RUN, so refer to it by that name.

---
 include/linux/kvm_host.h | 2 +-
 virt/kvm/kvm_main.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/kvm_host.h +1 -1
index 03bfc92864b6e..acae5a61e7f8f 100644
@@ -562,7 +562,7 @@ static inline int kvm_vcpu_exiting_guest_mode(struct kvm_vcpu *vcpu)
 	/*
 	 * The memory barrier ensures a previous write to vcpu->requests cannot
 	 * be reordered with the read of vcpu->mode.  It pairs with the general
-	 * memory barrier following the write of vcpu->mode in VCPU RUN.
+	 * memory barrier following the write of vcpu->mode in KVM_RUN.
 	 */
 	smp_mb__before_atomic();
 	return cmpxchg(&vcpu->mode, IN_GUEST_MODE, EXITING_GUEST_MODE);
virt/kvm/kvm_main.c +1 -1
index 65eb26a0520d8..cc391b0666a6d 100644
@@ -470,7 +470,7 @@ static void kvm_vcpu_destroy(struct kvm_vcpu *vcpu)
 	kvm_dirty_ring_free(&vcpu->dirty_ring);
 
 	/*
-	 * No need for rcu_read_lock as VCPU_RUN is the only place that changes
+	 * No need for rcu_read_lock as KVM_RUN is the only place that changes
 	 * the vcpu->pid pointer, and at destruction time all file descriptors
 	 * are already gone.
 	 */
Signature · 1 line
2.39.5
author reviewer
#2 lore raw

PATCH 2/3 KVM: arm64: Fix references to the non-existent VCPU_RUN ioctl

In reply to Fuad Tabba

There is no VCPU_RUN ioctl. The one that enters the guest is KVM_RUN, so refer to it by that name.

---
 Documentation/virt/kvm/arm/pkvm.rst | 2 +-
 arch/arm64/kvm/arm.c                | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Documentation/virt/kvm/arm/pkvm.rst +1 -1
index 514992a79a833..18d8afe36ebce 100644
@@ -67,7 +67,7 @@ largely due to the lack of MMU notifiers:
   then it will either return ``-EFAULT`` or forcefully reclaim the
   memory pages. Reclaimed memory is zeroed by the hypervisor and a
   subsequent attempt to access it in the pVM will return ``-EFAULT``
-  from the ``VCPU_RUN`` ioctl().
+  from the ``KVM_RUN`` ioctl().
 
 CPU state isolation
 -------------------
arch/arm64/kvm/arm.c +1 -1
index 8b080804bc90b..a18ec13bd6677 100644
@@ -1263,7 +1263,7 @@ static int noinstr kvm_arm_vcpu_enter_exit(struct kvm_vcpu *vcpu)
  * kvm_arch_vcpu_ioctl_run - the main VCPU run function to execute guest code
  * @vcpu:	The VCPU pointer
  *
- * This function is called through the VCPU_RUN ioctl called from user space. It
+ * This function is called through the KVM_RUN ioctl called from user space. It
  * will execute VM code in a loop until the time slice for the process is used
  * or some emulation is needed from user space in which case the function will
  * return with return value 0 and with the kvm_run structure filled in with the
Signature · 1 line
2.39.5
author reviewer
#3 lore raw

PATCH 3/3 KVM: PPC: Book3S HV: Fix comment naming a non-existent KVM_VCPU_RUN ioctl

In reply to Fuad Tabba

There is no KVM_VCPU_RUN ioctl. The one that enters the guest is KVM_RUN, so refer to it by that name.

---
 arch/powerpc/kvm/book3s_hv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/book3s_hv.c +1 -1
index dbac3573b2c89..db090f4c5e95b 100644
@@ -269,7 +269,7 @@ static void kvmppc_fast_vcpu_kick_hv(struct kvm_vcpu *vcpu)
  * stolen time for a vcore when it is inactive, or for a vcpu
  * when it is in state RUNNING or NOTREADY.  NOTREADY is a bit of
  * a misnomer; it means that the vcpu task is not executing in
- * the KVM_VCPU_RUN ioctl, i.e. it is in userspace or elsewhere in
+ * the KVM_RUN ioctl, i.e. it is in userspace or elsewhere in
  * the kernel.  We don't have any way of dividing up that time
  * between time that the vcpu is genuinely stopped, time that
  * the task is actively working on behalf of the vcpu, and time
Signature · 1 line
2.39.5
Reviewed-by on v1 3/3
#5 lore raw

Re: [PATCH 3/3] KVM: PPC: Book3S HV: Fix comment naming a non-existent KVM_VCPU_RUN ioctl

In reply to Fuad Tabba
Quoted 13 lines · Fuad Tabba

There is no KVM_VCPU_RUN ioctl. The one that enters the guest is KVM_RUN, so refer to it by that name.

---
 arch/powerpc/kvm/book3s_hv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kvm/book3s_hv.c +0 -0
index dbac3573b2c89..db090f4c5e95b 100644

arch/powerpc/kvm/book3s_hv.c static void kvmppc_fast_vcpu_kick_hv(struct kvm_vcpu *vcpu) · line 272

Quoted 5 lines
arch/powerpc/kvm/book3s_hv.c +1 -1
@@ -269,7 +269,7 @@ static void kvmppc_fast_vcpu_kick_hv(struct kvm_vcpu *vcpu)
  * stolen time for a vcore when it is inactive, or for a vcpu
  * when it is in state RUNNING or NOTREADY.  NOTREADY is a bit of
  * a misnomer; it means that the vcpu task is not executing in
- * the KVM_VCPU_RUN ioctl, i.e. it is in userspace or elsewhere in
+ * the KVM_RUN ioctl, i.e. it is in userspace or elsewhere in

The erroneous name was introduced by commit c7b676709c16 ("KVM: PPC: Book3S HV:
Fix accounting of stolen time") and has sat untouched since. KVM_VCPU_RUN was never a real ioctl; KVM_RUN is correct.

Thanks,
Amit

maintainer Applied
#7 lore raw
In reply to Fuad Tabba
Quoted 10 lines · Fuad Tabba

This one has been bugging me for a while. Five comments and doc lines name a VCPU_RUN ioctl (KVM_VCPU_RUN in book3s_hv.c, VCPU RUN in kvm_host.h). The ioctl that enters the guest is KVM_RUN.

The patches are independent and split by tree, one each for generic KVM, KVM/arm64 and Book3S HV, so each can go through its own maintainer. Nothing else in the tree refers to the ioctl by a wrong name.

[...]

Applied to next, thanks!

[1/3] KVM: Fix comments that refer to the non-existent VCPU_RUN ioctl

      commit: 8233000034a630432a7da0311d94e8725207a095
[2/3] KVM: arm64: Fix references to the non-existent VCPU_RUN ioctl
      commit: 0ab1034969130967bda8e6eab5b8dd6745604f1b
[3/3] KVM: PPC: Book3S HV: Fix comment naming a non-existent KVM_VCPU_RUN ioctl
      commit: 6ce8b5c0effb227f5625b35965c0f74c0e953efb

Cheers,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.