From nobody Sun Apr 28 02:28:24 2024 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.zoho.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 1490000148538672.8537794950474; Mon, 20 Mar 2017 01:55:48 -0700 (PDT) Received: from localhost ([::1]:59892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpt6P-0003Cq-CJ for importer@patchew.org; Mon, 20 Mar 2017 04:55:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpt5W-0003Cd-Eo for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpt5T-0000Gj-Al for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:11228) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cpt5T-0000GQ-2I for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF89D3710C9; Mon, 20 Mar 2017 08:54:46 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-104.ams2.redhat.com [10.36.116.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id 183A218654; Mon, 20 Mar 2017 08:54:42 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 1FC3B807C6; Mon, 20 Mar 2017 09:54:40 +0100 (CET) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BF89D3710C9 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BF89D3710C9 From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 20 Mar 2017 09:54:36 +0100 Message-Id: <1490000078-31202-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1490000078-31202-1-git-send-email-kraxel@redhat.com> References: <1490000078-31202-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 20 Mar 2017 08:54:46 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-2.9 1/3] ui/console: ensure graphic updates don't race with TCG vCPUs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Alex Benn=C3=A9e Commit 8d04fb55.. tcg: drop global lock during TCG code execution ..broke the assumption that updates to the GUI couldn't happen at the same time as TCG vCPUs where running. As a result the TCG vCPU could still be updating a directly mapped frame-buffer while the display side was updating. This would cause artefacts to appear when the update code assumed that memory block hadn't changed. The simplest solution is to ensure the two things can't happen at the same time like the old BQL locking scheme. Here we use the solution introduced for MTTCG and schedule the update as async_safe_work when we know no vCPUs can be running. Reported-by: Mark Cave-Ayland Signed-off-by: Alex Benn=C3=A9e Message-id: 20170315144825.3108-1-alex.bennee@linaro.org Cc: BALATON Zoltan Cc: Gerd Hoffmann Cc: Paolo Bonzini Signed-off-by: Alex Benn=C3=A9e [ kraxel: updated comment clarifying the display adapters are buggy and this is a temporary workaround ] Signed-off-by: Gerd Hoffmann --- ui/console.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ui/console.c b/ui/console.c index 4c70d8b..937c950 100644 --- a/ui/console.c +++ b/ui/console.c @@ -1575,13 +1575,32 @@ bool dpy_gfx_check_format(QemuConsole *con, return true; } =20 +/* + * Safe DPY refresh for TCG guests. This runs when the TCG vCPUs are + * quiescent so we can avoid races between dirty page tracking for + * direct frame-buffer access by the guest. + * + * This is a temporary stopgap until we've fixed the dirty tracking + * races in display adapters. + */ +static void do_safe_dpy_refresh(CPUState *cpu, run_on_cpu_data opaque) +{ + DisplayChangeListener *dcl =3D opaque.host_ptr; + dcl->ops->dpy_refresh(dcl); +} + static void dpy_refresh(DisplayState *s) { DisplayChangeListener *dcl; =20 QLIST_FOREACH(dcl, &s->listeners, next) { if (dcl->ops->dpy_refresh) { - dcl->ops->dpy_refresh(dcl); + if (tcg_enabled()) { + async_safe_run_on_cpu(first_cpu, do_safe_dpy_refresh, + RUN_ON_CPU_HOST_PTR(dcl)); + } else { + dcl->ops->dpy_refresh(dcl); + } } } } --=20 1.8.3.1 From nobody Sun Apr 28 02:28:24 2024 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.zoho.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 1490000148824430.5827669045583; Mon, 20 Mar 2017 01:55:48 -0700 (PDT) Received: from localhost ([::1]:59894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpt6R-0003ED-Do for importer@patchew.org; Mon, 20 Mar 2017 04:55:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpt5W-0003Cc-Em for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpt5T-0000Gu-Ht for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60920) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cpt5T-0000GZ-Cb for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:47 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 56A2343A3C for ; Mon, 20 Mar 2017 08:54:47 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-104.ams2.redhat.com [10.36.116.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id F239362931; Mon, 20 Mar 2017 08:54:42 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 312A180C2F; Mon, 20 Mar 2017 09:54:40 +0100 (CET) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 56A2343A3C Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 56A2343A3C From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 20 Mar 2017 09:54:37 +0100 Message-Id: <1490000078-31202-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1490000078-31202-1-git-send-email-kraxel@redhat.com> References: <1490000078-31202-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 20 Mar 2017 08:54:47 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-2.9 2/3] cirrus: fix off-by-one in cirrus_bitblt_rop_bkwd_transp_*_16 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The switch from pointers to addresses (commit 026aeffcb4752054830ba203020ed6eb05bcaba8 and ffaf857778286ca54e3804432a2369a279e73aa7) added a off-by-one bug to 16bit backward blits. Fix. Reported-by: =E6=9D=8E=E5=BC=BA Signed-off-by: Gerd Hoffmann Reviewed-by: Li Qiang Message-id: 1489735296-19047-1-git-send-email-kraxel@redhat.com --- hw/display/cirrus_vga_rop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/cirrus_vga_rop.h b/hw/display/cirrus_vga_rop.h index c61a677..0841b9e 100644 --- a/hw/display/cirrus_vga_rop.h +++ b/hw/display/cirrus_vga_rop.h @@ -219,7 +219,7 @@ glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_16= )(CirrusVGAState *s, srcpitch +=3D bltwidth; for (y =3D 0; y < bltheight; y++) { for (x =3D 0; x < bltwidth; x+=3D2) { - ROP_OP_TR_16(s, dstaddr, cirrus_src16(s, srcaddr), transp); + ROP_OP_TR_16(s, dstaddr - 1, cirrus_src16(s, srcaddr - 1), tra= nsp); dstaddr -=3D 2; srcaddr -=3D 2; } --=20 1.8.3.1 From nobody Sun Apr 28 02:28:24 2024 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.zoho.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 1490000241944934.1937991070615; Mon, 20 Mar 2017 01:57:21 -0700 (PDT) Received: from localhost ([::1]:59903 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpt7w-0004mz-Pn for importer@patchew.org; Mon, 20 Mar 2017 04:57:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cpt5a-0003E1-Bq for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cpt5Z-0000JH-A7 for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32956) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cpt5Z-0000Ii-5P for qemu-devel@nongnu.org; Mon, 20 Mar 2017 04:54:53 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 290F98A4D8 for ; Mon, 20 Mar 2017 08:54:53 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-104.ams2.redhat.com [10.36.116.104]) by smtp.corp.redhat.com (Postfix) with ESMTP id F202078484; Mon, 20 Mar 2017 08:54:42 +0000 (UTC) Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 40CEC80C40; Mon, 20 Mar 2017 09:54:40 +0100 (CET) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 290F98A4D8 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=kraxel@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 290F98A4D8 From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 20 Mar 2017 09:54:38 +0100 Message-Id: <1490000078-31202-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1490000078-31202-1-git-send-email-kraxel@redhat.com> References: <1490000078-31202-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Mon, 20 Mar 2017 08:54:53 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL for-2.9 3/3] vnc: fix a qio-channel leak X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Marc-Andr=C3=A9 Lureau Spotted by ASAN. Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Daniel P. Berrange Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20170317092802.17973-1-marcandre.lureau@redhat.com Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/vnc.c b/ui/vnc.c index 8bfb1e0..6e93b88 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -3677,6 +3677,7 @@ static int vnc_display_listen_addr(VncDisplay *vd, qio_channel_set_name(QIO_CHANNEL(sioc), name); if (qio_channel_socket_listen_sync( sioc, rawaddrs[i], listenerr =3D=3D NULL ? &listenerr : NU= LL) < 0) { + object_unref(OBJECT(sioc)); continue; } listening =3D true; --=20 1.8.3.1