Skip to content

Commit c0a1666

Browse files
committed
KVM: VMX: use cmpxchg64
This fixes a compilation failure on 32-bit systems. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 31afb2e commit c0a1666

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/x86/kvm/vmx.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -2238,8 +2238,8 @@ static void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int cpu)
22382238
new.ndst = (dest << 8) & 0xFF00;
22392239

22402240
new.sn = 0;
2241-
} while (cmpxchg(&pi_desc->control, old.control,
2242-
new.control) != old.control);
2241+
} while (cmpxchg64(&pi_desc->control, old.control,
2242+
new.control) != old.control);
22432243
}
22442244

22452245
static void decache_tsc_multiplier(struct vcpu_vmx *vmx)
@@ -11730,8 +11730,8 @@ static void __pi_post_block(struct kvm_vcpu *vcpu)
1173011730

1173111731
/* set 'NV' to 'notification vector' */
1173211732
new.nv = POSTED_INTR_VECTOR;
11733-
} while (cmpxchg(&pi_desc->control, old.control,
11734-
new.control) != old.control);
11733+
} while (cmpxchg64(&pi_desc->control, old.control,
11734+
new.control) != old.control);
1173511735

1173611736
if (!WARN_ON_ONCE(vcpu->pre_pcpu == -1)) {
1173711737
spin_lock(&per_cpu(blocked_vcpu_on_cpu_lock, vcpu->pre_pcpu));
@@ -11800,8 +11800,8 @@ static int pi_pre_block(struct kvm_vcpu *vcpu)
1180011800

1180111801
/* set 'NV' to 'wakeup vector' */
1180211802
new.nv = POSTED_INTR_WAKEUP_VECTOR;
11803-
} while (cmpxchg(&pi_desc->control, old.control,
11804-
new.control) != old.control);
11803+
} while (cmpxchg64(&pi_desc->control, old.control,
11804+
new.control) != old.control);
1180511805

1180611806
/* We should not block the vCPU if an interrupt is posted for it. */
1180711807
if (pi_test_on(pi_desc) == 1)

0 commit comments

Comments
 (0)