From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW2Vo-0007Z5-KA for qemu-devel@nongnu.org; Mon, 22 Sep 2014 08:14:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW2Vi-0000Gr-JC for qemu-devel@nongnu.org; Mon, 22 Sep 2014 08:14:36 -0400 Received: from mail.ispras.ru ([83.149.199.45]:47115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW2Vi-0000FO-C8 for qemu-devel@nongnu.org; Mon, 22 Sep 2014 08:14:30 -0400 From: Pavel Dovgalyuk Date: Mon, 22 Sep 2014 16:14:24 +0400 Message-ID: <20140922121423.2848.41987.stgit@PASHA-ISP> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] kvmvapic: fix migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, zealot351@gmail.com, maria.klimushenkova@ispras.ru, pavel.dovgaluk@ispras.ru, batuzovk@ispras.ru This patch fixes migration by extending do_vapic_enable function. This function called vapic_enable which read cpu number from the guest memory. When cpu number could not be read, vapic was not enabled while loading the VM state. This patch adds required code for cpu_number=0 to do_vapic_enable function, because it is called only when cpu_number=0. Signed-off-by: Pavel Dovgalyuk --- hw/i386/kvmvapic.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/hw/i386/kvmvapic.c b/hw/i386/kvmvapic.c index 2cca7a4..f9da050 100644 --- a/hw/i386/kvmvapic.c +++ b/hw/i386/kvmvapic.c @@ -732,7 +732,11 @@ static void do_vapic_enable(void *data) VAPICROMState *s = data; X86CPU *cpu = X86_CPU(first_cpu); - vapic_enable(s, cpu); + static const uint8_t enabled = 1; + cpu_physical_memory_write(s->vapic_paddr + offsetof(VAPICState, enabled), + &enabled, sizeof(enabled)); + apic_enable_vapic(cpu->apic_state, s->vapic_paddr); + s->state = VAPIC_ACTIVE; } static void kvmvapic_vm_state_change(void *opaque, int running,