Skip to content

Commit

Permalink
KVM: x86: fix x2apic logical address matching
Browse files Browse the repository at this point in the history
We cannot hit the bug now, but future patches will expose this path.

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 Jan 30, 2015
1 parent 3697f30 commit 8a39536
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/x86/kvm/lapic.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,8 @@ static bool kvm_apic_match_logical_addr(struct kvm_lapic *apic, u32 mda)
logical_id = kvm_apic_get_reg(apic, APIC_LDR);

if (apic_x2apic_mode(apic))
return (logical_id & mda) != 0;
return ((logical_id >> 16) == (mda >> 16))
&& (logical_id & mda & 0xffff) != 0;

logical_id = GET_APIC_LOGICAL_ID(logical_id);

Expand Down

0 comments on commit 8a39536

Please sign in to comment.