2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-28 23:23:55 +08:00

KVM: x86: fix x2apic logical address matching

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>
This commit is contained in:
Radim Krčmář 2015-01-29 22:48:51 +01:00 committed by Paolo Bonzini
parent 3697f302ab
commit 8a395363e2

View File

@ -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);