diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2016-07-12 22:09:23 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-14 09:03:54 +0200 |
commit | 49bd29ba1dbd57b029f69cd9afb335a8f564f32f (patch) | |
tree | 12962ebefef8456746872e020cd032c4b9e35867 /arch/x86 | |
parent | a92e2543d6a8653a8ab45cf5df7ef07dafcf3f3e (diff) | |
download | op-kernel-dev-49bd29ba1dbd57b029f69cd9afb335a8f564f32f.zip op-kernel-dev-49bd29ba1dbd57b029f69cd9afb335a8f564f32f.tar.gz |
KVM: x86: reset APIC ID when enabling LAPIC
APIC ID should be set to the initial APIC ID when enabling LAPIC.
This only matters if the guest changes APIC ID. No sane OS does that.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kvm/lapic.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 41089dbee..0fce77f 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1720,9 +1720,10 @@ void kvm_lapic_set_base(struct kvm_vcpu *vcpu, u64 value) /* update jump label if enable bit changes */ if ((old_value ^ value) & MSR_IA32_APICBASE_ENABLE) { - if (value & MSR_IA32_APICBASE_ENABLE) + if (value & MSR_IA32_APICBASE_ENABLE) { + kvm_apic_set_xapic_id(apic, vcpu->vcpu_id); static_key_slow_dec_deferred(&apic_hw_disabled); - else + } else static_key_slow_inc(&apic_hw_disabled.key); recalculate_apic_map(vcpu->kvm); } |