Skip to contentSkip to conversation

KVM: x86: hyper-v: Fix erroneous 'current_vcpu' usage in kvm_hv_flush_tlb()

PATCH In review Vitaly Kuznetsov 2 participants 2 messages Feb 9, 2021

Subsystems (4)
lore
Share & tools
lore

Vitaly Kuznetsov

author maintainer
#0 lore raw

PATCH 1/1 KVM: x86: hyper-v: Fix erroneous 'current_vcpu' usage in kvm_hv_flush_tlb()

Previously, we used to use 'current_vcpu' instead of 'vcpu' in kvm_hv_flush_tlb() but this is no longer the case, it should clearly be 'vcpu' here, a mistake was made during rebase.

Fixes d210b1e5b685 ("KVM: x86: hyper-v: Always use to_hv_vcpu() accessor to get to 'struct kvm_vcpu_hv'"

---
The broken patch is only in kvm/queue atm, we may as well want to squash the change.

---
 arch/x86/kvm/hyperv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/hyperv.c +1 -1
index 880ba3c678db..7d2dae92d638 100644
@@ -1555,7 +1555,7 @@ static __always_inline unsigned long *sparse_set_to_vcpu_mask(
 static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, u64 ingpa, u16 rep_cnt, bool ex)
 {
 	struct kvm *kvm = vcpu->kvm;
-	struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(current_vcpu);
+	struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
 	struct hv_tlb_flush_ex flush_ex;
 	struct hv_tlb_flush flush;
 	u64 vp_bitmap[KVM_HV_MAX_SPARSE_VCPU_SET_BITS];
Signature · 1 line
2.29.2
maintainer
#1 lore raw
Quoted 20 lines · Vitaly Kuznetsov

Previously, we used to use 'current_vcpu' instead of 'vcpu' in kvm_hv_flush_tlb() but this is no longer the case, it should clearly be 'vcpu' here, a mistake was made during rebase.

Fixes d210b1e5b685 ("KVM: x86: hyper-v: Always use to_hv_vcpu() accessor to get to 'struct kvm_vcpu_hv'"

---
The broken patch is only in kvm/queue atm, we may as well want to squash the change.

---
  arch/x86/kvm/hyperv.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kvm/hyperv.c +0 -0
index 880ba3c678db..7d2dae92d638 100644

arch/x86/kvm/hyperv.c static __always_inline unsigned long *sparse_set_to_vcpu_mask( · line 1561

Quoted 8 lines
arch/x86/kvm/hyperv.c +1 -1
@@ -1555,7 +1555,7 @@ static __always_inline unsigned long *sparse_set_to_vcpu_mask(
  static u64 kvm_hv_flush_tlb(struct kvm_vcpu *vcpu, u64 ingpa, u16 rep_cnt, bool ex)
  {
  	struct kvm *kvm = vcpu->kvm;
-	struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(current_vcpu);
+	struct kvm_vcpu_hv *hv_vcpu = to_hv_vcpu(vcpu);
  	struct hv_tlb_flush_ex flush_ex;
  	struct hv_tlb_flush flush;
  	u64 vp_bitmap[KVM_HV_MAX_SPARSE_VCPU_SET_BITS];

Squashed, thanks.

Paolo