diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2015-01-30 00:48:51 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-01-30 14:26:46 +0300 |
commit | 8a395363e2f9f52ec44a1cd892881e8ee1a53269 (patch) | |
tree | 7580a8b0da6c1cd5630b7468d9eb2d09aafc7030 /arch/x86/kvm/lapic.c | |
parent | 3697f302ab37000c109e2ab9f1763187853efb72 (diff) | |
download | linux-8a395363e2f9f52ec44a1cd892881e8ee1a53269.tar.xz |
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>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r-- | arch/x86/kvm/lapic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 99c536597332..555956c3c473 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -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); |