chengshan / rpms / kernel

Forked from rpms/kernel 2 years ago
Clone
e293be
commit c0a1666bcb2a33e84187a15eabdcd54056be9a97
e293be
Author: Paolo Bonzini <pbonzini@redhat.com>
e293be
Date:   Thu Sep 28 17:58:41 2017 +0200
e293be
e293be
    KVM: VMX: use cmpxchg64
e293be
    
e293be
    This fixes a compilation failure on 32-bit systems.
e293be
    
e293be
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
e293be
e293be
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
e293be
index b9d2140..7f62c94 100644
e293be
--- a/arch/x86/kvm/vmx.c
e293be
+++ b/arch/x86/kvm/vmx.c
e293be
@@ -2238,8 +2238,8 @@ static void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu)
e293be
 			new.ndst = (dest << 8) & 0xFF00;
e293be
 
e293be
 		new.sn = 0;
e293be
-	} while (cmpxchg(&pi_desc->control, old.control,
e293be
-			new.control) != old.control);
e293be
+	} while (cmpxchg64(&pi_desc->control, old.control,
e293be
+			   new.control) != old.control);
e293be
 }
e293be
 
e293be
 static void decache_tsc_multiplier(struct vcpu_vmx *vmx)
e293be
@@ -11730,8 +11730,8 @@ static void __pi_post_block(struct kvm_vcpu *vcpu)
e293be
 
e293be
 		/* set 'NV' to 'notification vector' */
e293be
 		new.nv = POSTED_INTR_VECTOR;
e293be
-	} while (cmpxchg(&pi_desc->control, old.control,
e293be
-			new.control) != old.control);
e293be
+	} while (cmpxchg64(&pi_desc->control, old.control,
e293be
+			   new.control) != old.control);
e293be
 
e293be
 	if (!WARN_ON_ONCE(vcpu->pre_pcpu == -1)) {
e293be
 		spin_lock(&per_cpu(blocked_vcpu_on_cpu_lock, vcpu->pre_pcpu));
e293be
@@ -11800,8 +11800,8 @@ static int pi_pre_block(struct kvm_vcpu *vcpu)
e293be
 
e293be
 		/* set 'NV' to 'wakeup vector' */
e293be
 		new.nv = POSTED_INTR_WAKEUP_VECTOR;
e293be
-	} while (cmpxchg(&pi_desc->control, old.control,
e293be
-			new.control) != old.control);
e293be
+	} while (cmpxchg64(&pi_desc->control, old.control,
e293be
+			   new.control) != old.control);
e293be
 
e293be
 	/* We should not block the vCPU if an interrupt is posted for it.  */
e293be
 	if (pi_test_on(pi_desc) == 1)