From nobody Wed Nov 5 05:25:45 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153321193095560.88873870149723; Thu, 2 Aug 2018 05:12:10 -0700 (PDT) Received: from localhost ([::1]:45396 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flCSf-0008L4-5l for importer@patchew.org; Thu, 02 Aug 2018 08:12:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1flCRn-00081l-Gk for qemu-devel@nongnu.org; Thu, 02 Aug 2018 08:11:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1flCRj-0007k7-5s for qemu-devel@nongnu.org; Thu, 02 Aug 2018 08:11:15 -0400 Received: from indium.canonical.com ([91.189.90.7]:40718) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1flCRi-0007jL-Uu for qemu-devel@nongnu.org; Thu, 02 Aug 2018 08:11:11 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1flCRh-0002bq-7V for ; Thu, 02 Aug 2018 12:11:09 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 37D2C2E80CC for ; Thu, 2 Aug 2018 12:11:09 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Thu, 02 Aug 2018 12:05:03 -0000 From: Stefan Berger <1784900@bugs.launchpad.net> To: qemu-devel@nongnu.org X-Launchpad-Notification-Type: bug X-Launchpad-Bug: product=qemu; status=New; importance=Undecided; assignee=None; X-Launchpad-Bug-Information-Type: Public X-Launchpad-Bug-Private: no X-Launchpad-Bug-Security-Vulnerability: no X-Launchpad-Bug-Commenters: dgilbert-h stefanb-us X-Launchpad-Bug-Reporter: Stefan Berger (stefanb-us) X-Launchpad-Bug-Modifier: Stefan Berger (stefanb-us) References: <153314156256.17371.7866837258800403867.malonedeb@soybean.canonical.com> Message-Id: <153321150379.28572.4771679861864409417.malone@chaenomeles.canonical.com> X-Launchpad-Message-Rationale: Subscriber (QEMU) @qemu-devel-ml X-Launchpad-Message-For: qemu-devel-ml Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="18739"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: ce7d356b67fa8a9dacd76a5251d8f9ccee83d6eb X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 91.189.90.7 Subject: [Qemu-devel] [Bug 1784900] Re: QEMU (frontend) crashes upon warm reboot with virtio-gpu device and vga=775 on Linux cmdline X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Bug 1784900 <1784900@bugs.launchpad.net> Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Another patch that seems to work tries to remember the old surface: diff --git a/hw/display/vga.c b/hw/display/vga.c index ed476e4e80..1aae6a6d3b 100644 --- a/hw/display/vga.c +++ b/hw/display/vga.c @@ -1554,7 +1554,8 @@ static void vga_draw_graphic(VGACommonState *s, int f= ull_update) height !=3D s->last_height || s->last_depth !=3D depth || s->last_byteswap !=3D byteswap || - share_surface !=3D is_buffer_shared(surface)) { + share_surface !=3D is_buffer_shared(surface) || + s->last_surface !=3D surface) { /* display parameters changed -> need new display surface */ s->last_scr_width =3D disp_width; s->last_scr_height =3D height; @@ -1563,8 +1564,10 @@ static void vga_draw_graphic(VGACommonState *s, int = full_update) s->last_line_offset =3D s->line_offset; s->last_depth =3D depth; s->last_byteswap =3D byteswap; + s->last_surface =3D surface; full_update =3D 1; } + fprintf(stderr, "%p vs %p share_surface: %d surface: %p\n", surfac= e_data(surface), s->vram_ptr + (s->start_addr * 4), share_surface, surface); if (surface_data(surface) !=3D s->vram_ptr + (s->start_addr * 4) && is_buffer_shared(surface)) { /* base address changed (page flip) -> shared display surfaces diff --git a/hw/display/vga_int.h b/hw/display/vga_int.h index f8fcf62a56..91afc52b0e 100644 --- a/hw/display/vga_int.h +++ b/hw/display/vga_int.h @@ -122,6 +122,7 @@ typedef struct VGACommonState { uint32_t last_width, last_height; /* in chars or pixels */ uint32_t last_scr_width, last_scr_height; /* in pixels */ uint32_t last_depth; /* in bits */ + void *last_surface; bool last_byteswap; bool force_shadow; uint8_t cursor_start, cursor_end; --=20 You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1784900 Title: QEMU (frontend) crashes upon warm reboot with virtio-gpu device and vga=3D775 on Linux cmdline Status in QEMU: New Bug description: With vga=3D775 on the Linux command line a first boot of the VM running Linux works fine. After a warm reboot it crashes during Linux boot. The VM was used remotely via virt-manager and VNC. Bisecting the code lead to the following patch that introduced the bug: commit 1fccd7c5a9a722a9cbf1bc91693f4618034f01ac (HEAD, refs/bisect/bad) Author: Gerd Hoffmann Date: Mon Jul 2 18:24:43 2018 +0200 virtio-gpu: disable scanout when backing resource is destroyed Signed-off-by: Gerd Hoffmann Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 20180702162443.16796-4-kraxel@redhat.com diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c index 336dc59007..08cd567218 100644 --- a/hw/display/virtio-gpu.c +++ b/hw/display/virtio-gpu.c @@ -430,6 +430,16 @@ static void virtio_gpu_disable_scanout(VirtIOGPU *g,= int scanout_id) static void virtio_gpu_resource_destroy(VirtIOGPU *g, struct virtio_gpu_simple_resourc= e *res) { + int i; + + if (res->scanout_bitmask) { + for (i =3D 0; i < g->conf.max_outputs; i++) { + if (res->scanout_bitmask & (1 << i)) { + virtio_gpu_disable_scanout(g, i); + } + } + } + pixman_image_unref(res->image); virtio_gpu_cleanup_mapping(res); QTAILQ_REMOVE(&g->reslist, res, next); =20 Reported backtraces can be found here: https://paste.fedoraproject.org/p= aste/OUDEfCk1IY7xiy0I0PDlkw To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1784900/+subscriptions