Return-Path: Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:33106 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932476AbeB1PWM (ORCPT ); Wed, 28 Feb 2018 10:22:12 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Chegu Vinod" , "Gleb Natapov" , "Avi Kivity" Date: Wed, 28 Feb 2018 15:20:21 +0000 Message-ID: Subject: [PATCH 3.2 012/140] KVM: apic: fix LDR calculation in x2apic mode In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: 3.2.100-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Gleb Natapov commit 7f46ddbd487e0d0528d89534fdfb31d885977804 upstream. Signed-off-by: Gleb Natapov Reviewed-by: Chegu Vinod Tested-by: Chegu Vinod Signed-off-by: Avi Kivity [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings --- arch/x86/kvm/lapic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1022,7 +1022,7 @@ void kvm_lapic_set_base(struct kvm_vcpu vcpu->arch.apic_base = value; if (apic_x2apic_mode(apic)) { u32 id = kvm_apic_id(apic); - u32 ldr = ((id & ~0xf) << 16) | (1 << (id & 0xf)); + u32 ldr = ((id >> 4) << 16) | (1 << (id & 0xf)); apic_set_reg(apic, APIC_LDR, ldr); } apic->base_address = apic->vcpu->arch.apic_base &