KVM: x86: use correct APIC ID on x2APIC transition
authorRadim Krčmář <rkrcmar@redhat.com>
Fri, 22 May 2015 16:45:11 +0000 (18:45 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 28 May 2015 08:43:35 +0000 (10:43 +0200)
commit257b9a5faab5849fa61f1a523b429dc279d33cc3
tree5a29d2fd7b2ba3947f1e81e7b45b1443449148d3
parent630994b3c798dec3de1fb1d5a3dd9201267036f6
KVM: x86: use correct APIC ID on x2APIC transition

SDM April 2015, 10.12.5 State Changes From xAPIC Mode to x2APIC Mode
• Any APIC ID value written to the memory-mapped local APIC ID register
  is not preserved.

Fix it by sourcing vcpu_id (= initial APIC ID) instead of memory-mapped
APIC ID.  Proper use of apic functions would result in two calls to
recalculate_apic_map(), so this patch makes a new helper.

Signed-off-by: Radim KrÄ\8dmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c