KVM: x86: use MSR_ICR instead of a number
authorRadim Krčmář <rkrcmar@redhat.com>
Wed, 26 Nov 2014 16:07:05 +0000 (17:07 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 4 Dec 2014 14:29:05 +0000 (15:29 +0100)
0x830 MSR is 0x300 xAPIC MMIO, which is MSR_ICR.

Signed-off-by: Radim KrÄ\8dmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c

index 1b9bf964f3e4f48c8c52336eaa9972c7bb65e66e..3634303218a372c78e0e9f6560a78a7fff68e9d2 100644 (file)
@@ -1887,7 +1887,7 @@ int kvm_x2apic_msr_write(struct kvm_vcpu *vcpu, u32 msr, u64 data)
                return 1;
 
        /* if this is ICR write vector before command */
-       if (msr == 0x830)
+       if (reg == APIC_ICR)
                apic_reg_write(apic, APIC_ICR2, (u32)(data >> 32));
        return apic_reg_write(apic, reg, (u32)data);
 }
@@ -1908,7 +1908,7 @@ int kvm_x2apic_msr_read(struct kvm_vcpu *vcpu, u32 msr, u64 *data)
 
        if (apic_reg_read(apic, reg, 4, &low))
                return 1;
-       if (msr == 0x830)
+       if (reg == APIC_ICR)
                apic_reg_read(apic, APIC_ICR2, 4, &high);
 
        *data = (((u64)high) << 32) | low;