From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW8xP-0000Xc-Kq for qemu-devel@nongnu.org; Mon, 22 Sep 2014 15:07:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XW8xK-0002Xt-4s for qemu-devel@nongnu.org; Mon, 22 Sep 2014 15:07:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XW8xJ-0002W8-Tb for qemu-devel@nongnu.org; Mon, 22 Sep 2014 15:07:26 -0400 Message-ID: <54207362.9010704@redhat.com> Date: Mon, 22 Sep 2014 21:07:14 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <20140922121423.2848.41987.stgit@PASHA-ISP> In-Reply-To: <20140922121423.2848.41987.stgit@PASHA-ISP> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] kvmvapic: fix migration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Dovgalyuk , qemu-devel@nongnu.org Cc: zealot351@gmail.com, maria.klimushenkova@ispras.ru, batuzovk@ispras.ru Il 22/09/2014 14:14, Pavel Dovgalyuk ha scritto: > 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, > Thanks. Paolo