diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-12-10 16:56:46 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-12-15 12:21:02 +0100 |
commit | 575a6f4082c45778b93032ef1e7fbea4467b3a2a (patch) | |
tree | f2e37755232d9dc23fa0196856b2e6e6c7753820 /hw/i386/kvm | |
parent | 2f9ac42acf4602453d5839221df6cc7cabc3355e (diff) | |
download | qemu-575a6f4082c45778b93032ef1e7fbea4467b3a2a.zip qemu-575a6f4082c45778b93032ef1e7fbea4467b3a2a.tar.gz qemu-575a6f4082c45778b93032ef1e7fbea4467b3a2a.tar.bz2 |
kvm/apic: fix 2.2->2.1 migration
The wait_for_sipi field is set back to 1 after an INIT, so it was not
effective to reset it in kvm_apic_realize. Introduce a reset callback
and reset wait_for_sipi there.
Reported-by: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-stable@nongnu.org
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/i386/kvm')
-rw-r--r-- | hw/i386/kvm/apic.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/hw/i386/kvm/apic.c b/hw/i386/kvm/apic.c index 271e97f..5b47056 100644 --- a/hw/i386/kvm/apic.c +++ b/hw/i386/kvm/apic.c @@ -171,12 +171,15 @@ static const MemoryRegionOps kvm_apic_io_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -static void kvm_apic_realize(DeviceState *dev, Error **errp) +static void kvm_apic_reset(APICCommonState *s) { - APICCommonState *s = APIC_COMMON(dev); - /* Not used by KVM, which uses the CPU mp_state instead. */ s->wait_for_sipi = 0; +} + +static void kvm_apic_realize(DeviceState *dev, Error **errp) +{ + APICCommonState *s = APIC_COMMON(dev); memory_region_init_io(&s->io_memory, NULL, &kvm_apic_io_ops, s, "kvm-apic-msi", APIC_SPACE_SIZE); @@ -191,6 +194,7 @@ static void kvm_apic_class_init(ObjectClass *klass, void *data) APICCommonClass *k = APIC_COMMON_CLASS(klass); k->realize = kvm_apic_realize; + k->reset = kvm_apic_reset; k->set_base = kvm_apic_set_base; k->set_tpr = kvm_apic_set_tpr; k->get_tpr = kvm_apic_get_tpr; |