Skip to content

Commit

Permalink
KVM: x86: use MSR_ICR instead of a number
Browse files Browse the repository at this point in the history
0x830 MSR is 0x300 xAPIC MMIO, which is MSR_ICR.

Signed-off-by: Radim Kr�mář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Radim Krčmář authored and Paolo Bonzini committed Dec 4, 2014
1 parent c69d3d9 commit decdc28
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/x86/kvm/lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
Expand Down

0 comments on commit decdc28

Please sign in to comment.