Skip to content

Commit 7f46ddb

Browse files
Gleb Natapovavikivity
authored andcommitted
KVM: apic: fix LDR calculation in x2apic mode
Signed-off-by: Gleb Natapov <gleb@redhat.com> Reviewed-by: Chegu Vinod <chegu_vinod@hp.com> Tested-by: Chegu Vinod <chegu_vinod@hp.com> Signed-off-by: Avi Kivity <avi@redhat.com>
1 parent f3ac1a4 commit 7f46ddb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/x86/kvm/lapic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value)
13111311
vcpu->arch.apic_base = value;
13121312
if (apic_x2apic_mode(apic)) {
13131313
u32 id = kvm_apic_id(apic);
1314-
u32 ldr = ((id & ~0xf) << 16) | (1 << (id & 0xf));
1314+
u32 ldr = ((id >> 4) << 16) | (1 << (id & 0xf));
13151315
kvm_apic_set_ldr(apic, ldr);
13161316
}
13171317
apic->base_address = apic->vcpu->arch.apic_base &

0 commit comments

Comments
 (0)