[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1422568135-28402-5-git-send-email-rkrcmar@redhat.com>
Date: Thu, 29 Jan 2015 22:48:51 +0100
From: Radim Krčmář <rkrcmar@...hat.com>
To: linux-kernel@...r.kernel.org
Cc: kvm@...r.kernel.org, Paolo Bonzini <pbonzini@...hat.com>,
Nadav Amit <namit@...technion.ac.il>,
Gleb Natapov <gleb@...nel.org>
Subject: [PATCH 4/8] 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@...hat.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists