From nobody Thu Nov 6 01:27:56 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538738186287322.80844573609465; Fri, 5 Oct 2018 04:16:26 -0700 (PDT) Received: from localhost ([::1]:34567 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8O5k-0005m1-8i for importer@patchew.org; Fri, 05 Oct 2018 07:16:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8O1e-00036j-Lk for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8O1b-0003q7-D9 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47944) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g8O1b-0003pY-71 for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:03 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 90DC63084040 for ; Fri, 5 Oct 2018 11:12:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2FDB16A749; Fri, 5 Oct 2018 11:11:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 04098982BD; Fri, 5 Oct 2018 13:11:58 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 13:11:54 +0200 Message-Id: <20181005111157.12801-2-kraxel@redhat.com> In-Reply-To: <20181005111157.12801-1-kraxel@redhat.com> References: <20181005111157.12801-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Fri, 05 Oct 2018 11:12:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 1/4] edid: Ignore built binary 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: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Eric Blake Added in commit 72d277a7. Signed-off-by: Eric Blake Message-id: 20181004140522.945682-1-eblake@redhat.com Signed-off-by: Gerd Hoffmann --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5668d02782..64efdfd929 100644 --- a/.gitignore +++ b/.gitignore @@ -107,6 +107,7 @@ /qemu-doc.html /qemu-doc.info /qemu-doc.txt +/qemu-edid /qemu-img /qemu-nbd /qemu-options.def --=20 2.9.3 From nobody Thu Nov 6 01:27:56 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538738095417529.0978027039168; Fri, 5 Oct 2018 04:14:55 -0700 (PDT) Received: from localhost ([::1]:34559 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8O4M-0004yN-2i for importer@patchew.org; Fri, 05 Oct 2018 07:14:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8O1e-00036l-Lj for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8O1b-0003qd-NY for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45652) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g8O1b-0003po-Eq for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:03 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C0FD33086265; Fri, 5 Oct 2018 11:12:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 22C002E182; Fri, 5 Oct 2018 11:11:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 0D2D8982BE; Fri, 5 Oct 2018 13:11:58 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 13:11:55 +0200 Message-Id: <20181005111157.12801-3-kraxel@redhat.com> In-Reply-To: <20181005111157.12801-1-kraxel@redhat.com> References: <20181005111157.12801-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.49]); Fri, 05 Oct 2018 11:12:02 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 2/4] hw/display/qxl: Suppress clang-7 warning about misaligned atomic operation 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: Peter Maydell , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Peter Maydell If QEMU is compiled with clang-7 it results in the warning: hw/display/qxl.c:1884:19: error: misaligned or large atomic operation may incur significant performance penalty [-Werror,-Watomic-alignment] old_pending =3D atomic_fetch_or(&d->ram->int_pending, le_events); ^ This is because the Spice headers forgot to define the QXLRam struct with the '__aligned__(4)' attribute. clang 7 and newer will thus warn that the access here to int_pending might not be 4-aligned (because the QXLRam object d->ram points at might start at a misaligned address). In fact we set up d->ram in init_qxl_ram() so it always starts at a 4K boundary, so we know the atomic access here is OK. Newer Spice versions (with Spice commit beda5ec7a6848be20c0cac2a9a8ef2a41e8069c1) will fix the bug; for older Spice versions, work around it by telling the compiler explicitly that the alignment is OK using __builtin_assume_aligned(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20180927155538.699-1-peter.maydell@linaro.org Signed-off-by: Gerd Hoffmann --- include/qemu/compiler.h | 9 +++++++++ hw/display/qxl.c | 26 +++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h index 5843812710..bf47e7bee4 100644 --- a/include/qemu/compiler.h +++ b/include/qemu/compiler.h @@ -122,6 +122,15 @@ #ifndef __has_feature #define __has_feature(x) 0 /* compatibility with non-clang compilers */ #endif + +#ifndef __has_builtin +#define __has_builtin(x) 0 /* compatibility with non-clang compilers */ +#endif + +#if __has_builtin(__builtin_assume_aligned) || QEMU_GNUC_PREREQ(4, 7) +#define HAS_ASSUME_ALIGNED +#endif + /* Implement C11 _Generic via GCC builtins. Example: * * QEMU_GENERIC(x, (float, sinf), (long double, sinl), sin) (x) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 747986478f..e628cf1286 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -1893,7 +1893,31 @@ static void qxl_send_events(PCIQXLDevice *d, uint32_= t events) trace_qxl_send_events_vm_stopped(d->id, events); return; } - old_pending =3D atomic_fetch_or(&d->ram->int_pending, le_events); + /* + * Older versions of Spice forgot to define the QXLRam struct + * with the '__aligned__(4)' attribute. clang 7 and newer will + * thus warn that atomic_fetch_or(&d->ram->int_pending, ...) + * might be a misaligned atomic access, and will generate an + * out-of-line call for it, which results in a link error since + * we don't currently link against libatomic. + * + * In fact we set up d->ram in init_qxl_ram() so it always starts + * at a 4K boundary, so we know that &d->ram->int_pending is + * naturally aligned for a uint32_t. Newer Spice versions + * (with Spice commit beda5ec7a6848be20c0cac2a9a8ef2a41e8069c1) + * will fix the bug directly. To deal with older versions, + * we tell the compiler to assume the address really is aligned. + * Any compiler which cares about the misalignment will have + * __builtin_assume_aligned. + */ +#ifdef HAS_ASSUME_ALIGNED +#define ALIGNED_UINT32_PTR(P) ((uint32_t *)__builtin_assume_aligned(P, 4)) +#else +#define ALIGNED_UINT32_PTR(P) ((uint32_t *)P) +#endif + + old_pending =3D atomic_fetch_or(ALIGNED_UINT32_PTR(&d->ram->int_pendin= g), + le_events); if ((old_pending & le_events) =3D=3D le_events) { return; } --=20 2.9.3 From nobody Thu Nov 6 01:27:56 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538738010387484.0612607741475; Fri, 5 Oct 2018 04:13:30 -0700 (PDT) Received: from localhost ([::1]:34552 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8O2v-0003or-E9 for importer@patchew.org; Fri, 05 Oct 2018 07:13:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43235) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8O1e-00036m-Ln for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8O1b-0003pt-0Q for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47418) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g8O1a-0003oz-QO for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:02 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 258C4307D86F; Fri, 5 Oct 2018 11:12:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4ECE56A74A; Fri, 5 Oct 2018 11:11:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 14D06982BF; Fri, 5 Oct 2018 13:11:58 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 13:11:56 +0200 Message-Id: <20181005111157.12801-4-kraxel@redhat.com> In-Reply-To: <20181005111157.12801-1-kraxel@redhat.com> References: <20181005111157.12801-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Fri, 05 Oct 2018 11:12:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 3/4] secondary-vga: delete mmio subregions upon exit 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: "remy.noel" , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "remy.noel" 93abfc88bd649de1933588bfc7175605331b3ea9 introduced a reference cycle in the vga-pci devices, preventing cleanup of the object upon hotblug. This patch allows to break the cycle. Signed-off-by: remy.noel Message-id: 20181002121935.23706-1-remy.noel@blade-group.com [ kraxel: delete the recently added edid region too ] Signed-off-by: Gerd Hoffmann --- hw/display/vga-pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c index 24ca1b3e1f..a17c96e703 100644 --- a/hw/display/vga-pci.c +++ b/hw/display/vga-pci.c @@ -309,6 +309,14 @@ static void pci_secondary_vga_exit(PCIDevice *dev) VGACommonState *s =3D &d->vga; =20 graphic_console_close(s->con); + memory_region_del_subregion(&d->mmio, &d->mrs[0]); + memory_region_del_subregion(&d->mmio, &d->mrs[1]); + if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_QEXT)) { + memory_region_del_subregion(&d->mmio, &d->mrs[2]); + } + if (d->flags & (1 << PCI_VGA_FLAG_ENABLE_EDID)) { + memory_region_del_subregion(&d->mmio, &d->mrs[3]); + } } =20 static void pci_secondary_vga_init(Object *obj) --=20 2.9.3 From nobody Thu Nov 6 01:27:56 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; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538738007484623.7844239067769; Fri, 5 Oct 2018 04:13:27 -0700 (PDT) Received: from localhost ([::1]:34553 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8O2w-0003r5-Cr for importer@patchew.org; Fri, 05 Oct 2018 07:13:26 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g8O1e-00036k-Lj for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g8O1b-0003qV-KB for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36064) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g8O1b-0003pl-EO for qemu-devel@nongnu.org; Fri, 05 Oct 2018 07:12:03 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C2389C0587FF for ; Fri, 5 Oct 2018 11:12:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-29.ams2.redhat.com [10.36.116.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 25EB85C1B4; Fri, 5 Oct 2018 11:11:59 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 1DDCF99AC1; Fri, 5 Oct 2018 13:11:58 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 5 Oct 2018 13:11:57 +0200 Message-Id: <20181005111157.12801-5-kraxel@redhat.com> In-Reply-To: <20181005111157.12801-1-kraxel@redhat.com> References: <20181005111157.12801-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 05 Oct 2018 11:12:02 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/4] edid: fix vendor default 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: RDMRC_1 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" "EMU" actually is "Emulex Corporation", so not a good idea to use that by default. Lets use the Red Hat vendor id instead, which is in line with the pci ids which are allocated from Red Hat vendor ids too. Vendor list is available from http://www.uefi.org/pnp_id_list Signed-off-by: Gerd Hoffmann Message-id: 20181005091934.12143-1-kraxel@redhat.com --- include/hw/display/edid.h | 2 +- hw/display/edid-generate.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/display/edid.h b/include/hw/display/edid.h index bd51d26916..bacf170889 100644 --- a/include/hw/display/edid.h +++ b/include/hw/display/edid.h @@ -4,7 +4,7 @@ #include "hw/hw.h" =20 typedef struct qemu_edid_info { - const char *vendor; + const char *vendor; /* http://www.uefi.org/pnp_id_list */ const char *name; const char *serial; uint32_t dpi; diff --git a/hw/display/edid-generate.c b/hw/display/edid-generate.c index c80397ea96..37e60fe42a 100644 --- a/hw/display/edid-generate.c +++ b/hw/display/edid-generate.c @@ -301,7 +301,7 @@ void qemu_edid_generate(uint8_t *edid, size_t size, /* =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D set defaults =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D */ =20 if (!info->vendor || strlen(info->vendor) !=3D 3) { - info->vendor =3D "EMU"; + info->vendor =3D "RHT"; } if (!info->name) { info->name =3D "QEMU Monitor"; --=20 2.9.3