From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38399) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFkeJ-0001k5-Sy for qemu-devel@nongnu.org; Mon, 17 Oct 2011 06:42:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RFkeI-0002lH-DP for qemu-devel@nongnu.org; Mon, 17 Oct 2011 06:42:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RFkeI-0002l9-3A for qemu-devel@nongnu.org; Mon, 17 Oct 2011 06:42:26 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9HAgPxB000835 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Oct 2011 06:42:25 -0400 Message-ID: <4E9C0652.9050801@redhat.com> Date: Mon, 17 Oct 2011 12:41:22 +0200 From: Yonit Halperin MIME-Version: 1.0 References: <1318847060-14080-1-git-send-email-alevy@redhat.com> In-Reply-To: <1318847060-14080-1-git-send-email-alevy@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] qxl: create slots on post_load in any state (fix RHBZ 740547) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alon Levy Cc: qemu-devel@nongnu.org, kraxel@redhat.com ACK On 10/17/2011 12:24 PM, Alon Levy wrote: > If we migrate when the device is not in a native state the guest > still believes the slots are created, and will cause operations > that reference the slots, causing a "panic: virtual address out of range" > on the first of them. Easy to see by migrating in vga mode (with > a driver loaded, for instance windows cmd window in full screen mode) > and then exiting vga mode back to native mode will cause said panic. > > Fixed by doing the slot recreation unconditionally at post_load > > Signed-off-by: Alon Levy > --- > hw/qxl.c | 14 ++++++++------ > 1 files changed, 8 insertions(+), 6 deletions(-) > > diff --git a/hw/qxl.c b/hw/qxl.c > index 03848ed..4e9f39f 100644 > --- a/hw/qxl.c > +++ b/hw/qxl.c > @@ -1684,6 +1684,14 @@ static int qxl_post_load(void *opaque, int version) > qxl_mode_to_string(d->mode)); > newmode = d->mode; > d->mode = QXL_MODE_UNDEFINED; > + for (i = 0; i< NUM_MEMSLOTS; i++) { > + if (!d->guest_slots[i].active) { > + continue; > + } > + dprint(d, 1, "%s: restoring guest slot %d delta %"PRIu64"\n", > + __func__, i, d->guest_slots[i].delta); > + qxl_add_memslot(d, i, d->guest_slots[i].delta, QXL_SYNC); > + } > switch (newmode) { > case QXL_MODE_UNDEFINED: > break; > @@ -1691,12 +1699,6 @@ static int qxl_post_load(void *opaque, int version) > qxl_enter_vga_mode(d); > break; > case QXL_MODE_NATIVE: > - for (i = 0; i< NUM_MEMSLOTS; i++) { > - if (!d->guest_slots[i].active) { > - continue; > - } > - qxl_add_memslot(d, i, 0, QXL_SYNC); > - } > qxl_create_guest_primary(d, 1, QXL_SYNC); > > /* replay surface-create and cursor-set commands */