lkml.org 
[lkml]   [2015]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/8] KVM: x86: fix x2apic logical address matching
Date
We cannot hit the bug now, but future patches will expose this path.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
arch/x86/kvm/lapic.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 0ee743c6b4f1..aae043f38548 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -602,7 +602,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;
+ return ((logical_id >> 16) == (mda >> 16))
+ && (logical_id & mda & 0xffff);

logical_id = GET_APIC_LOGICAL_ID(logical_id);

--
2.2.2


\
 
 \ /
  Last update: 2015-01-29 23:01    [W:0.216 / U:19.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site