[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization f
From: |
Pavel Dovgaluk |
Subject: |
Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix |
Date: |
Fri, 19 Sep 2014 14:43:01 +0400 |
Hi, Paolo!
> From: Paolo Bonzini [mailto:address@hidden On Behalf Of Paolo Bonzini
> From: Pavel Dovgalyuk <address@hidden>
>
> This patch postpones vapic_paddr initialization, which is performed
> during migration. When vapic_paddr is synchronized within the migration
> process, apic_common functions could operate with incorrect apic state,
> if it hadn't loaded yet. This patch postpones the synchronization until
> the virtual machine is started, ensuring that the whole virtual machine
> state has been loaded.
>
>
> +static int vapic_post_load(void *opaque, int version_id)
> +{
> + VAPICROMState *s = opaque;
> +
> /*
> * The old implementation of qemu-kvm did not provide the state
> * VAPIC_STANDBY. Reconstruct it.
> @@ -752,17 +776,8 @@ static int vapic_post_load(void *opaque, int version_id)
> return -1;
> }
> }
> - if (s->state == VAPIC_ACTIVE) {
> - if (smp_cpus == 1) {
> - run_on_cpu(first_cpu, do_vapic_enable, s);
> - } else {
> - zero = g_malloc0(s->rom_state.vapic_size);
> - cpu_physical_memory_write(s->vapic_paddr, zero,
> - s->rom_state.vapic_size);
> - g_free(zero);
> - }
> - }
>
> + s->vmsentry = qemu_add_vm_change_state_handler(kvmvapic_vm_state_change,
> s);
> return 0;
I've tested this patch with replay. I enabled VM reset (which was previously
disabled for replay)
while loading the VM state and discovered the following problem.
vapic_enable function in kvmapic.c retrieves cpu number with the
get_kpcr_number() function.
When cpu number is -1 vapic_enable exits and does not call apic_enable_vapic,
which should
setup vapic_paddr field.
Without this call vapic_paddr remains initialized with default value and
behavior of the virtual
machine becomes different.
Pavel Dovgalyuk
- [Qemu-devel] [PULL 03/21] util: Move general qemu_getauxval to util/getauxval.c, (continued)
- [Qemu-devel] [PULL 03/21] util: Move general qemu_getauxval to util/getauxval.c, Paolo Bonzini, 2014/09/12
- [Qemu-devel] [PULL 06/21] exec: add parameter errp to qemu_ram_alloc and qemu_ram_alloc_from_ptr, Paolo Bonzini, 2014/09/12
- [Qemu-devel] [PULL 08/21] memory: add parameter errp to memory_region_init_rom_device, Paolo Bonzini, 2014/09/12
- [Qemu-devel] [PULL 09/21] hostmem-ram: don't exit qemu if size of memory-backend-ram is way too big, Paolo Bonzini, 2014/09/12
- [Qemu-devel] [PULL 07/21] memory: add parameter errp to memory_region_init_ram, Paolo Bonzini, 2014/09/12
- [Qemu-devel] [PULL 11/21] exec: add parameter errp to gethugepagesize, Paolo Bonzini, 2014/09/12
- [Qemu-devel] [PULL 10/21] exec: report error when memory < hpagesize, Paolo Bonzini, 2014/09/12
- [Qemu-devel] [PULL 05/21] rules.mak: Fix DSO build by pulling in archive symbols, Paolo Bonzini, 2014/09/12
- [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Paolo Bonzini, 2014/09/12
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix,
Pavel Dovgaluk <=
- Message not available
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Paolo Bonzini, 2014/09/19
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Pavel Dovgaluk, 2014/09/19
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Paolo Bonzini, 2014/09/19
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Pavel Dovgaluk, 2014/09/22
- Message not available
- Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Paolo Bonzini, 2014/09/22
Re: [Qemu-devel] [PULL 13/21] apic_common: vapic_paddr synchronization fix, Pavel Dovgaluk, 2014/09/26
[Qemu-devel] [PULL 14/21] cpu: init vmstate for ticks and clock offset, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 15/21] fdc: adding vmstate for save/restore, Paolo Bonzini, 2014/09/12
[Qemu-devel] [PULL 12/21] vl: use QLIST_FOREACH_SAFE to visit change state handlers, Paolo Bonzini, 2014/09/12