summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Jones <drjones@redhat.com>2014-01-15 13:39:59 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2014-01-15 13:42:14 +0100
commit0dce7cd67fd9055c4a2ff278f8af1431e646d346 (patch)
tree454bfdea72661a0e3e4295a9ee2f9a12dc63b815
parent7e22e91102c6b9df7c4ae2168910e19d2bb14cd6 (diff)
kvm: x86: fix apic_base enable check
Commit e66d2ae7c67bd moved the assignment vcpu->arch.apic_base = value above a condition with (vcpu->arch.apic_base ^ value), causing that check to always fail. Use old_value, vcpu->arch.apic_base's old value, in the condition instead. Signed-off-by: Andrew Jones <drjones@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--arch/x86/kvm/lapic.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 1673940cf9c3..775702f649ca 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -1355,7 +1355,7 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
vcpu->arch.apic_base = value;
/* update jump label if enable bit changes */
- if ((vcpu->arch.apic_base ^ value) & MSR_IA32_APICBASE_ENABLE) {
+ if ((old_value ^ value) & MSR_IA32_APICBASE_ENABLE) {
if (value & MSR_IA32_APICBASE_ENABLE)
static_key_slow_dec_deferred(&apic_hw_disabled);
else