From nobody Thu Apr 2 01:08:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774904998316540.6166116687128; Mon, 30 Mar 2026 14:09:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7JrQ-0006j1-4r; Mon, 30 Mar 2026 17:09:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w7JrO-0006ig-QA for qemu-devel@nongnu.org; Mon, 30 Mar 2026 17:09:22 -0400 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w7JrM-0001XI-Kd for qemu-devel@nongnu.org; Mon, 30 Mar 2026 17:09:22 -0400 Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id 934375969EC; Mon, 30 Mar 2026 23:09:18 +0200 (CEST) Received: from zero.eik.bme.hu ([127.0.0.1]) by localhost (zero.eik.bme.hu [127.0.0.1]) (amavis, port 10028) with ESMTP id MjuE2w2rx-gu; Mon, 30 Mar 2026 23:09:16 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 941ED5969F2; Mon, 30 Mar 2026 23:09:16 +0200 (CEST) X-Virus-Scanned: amavis at eik.bme.hu Message-ID: <24161ec41f118ad097387f8a84897dee7b4747b8.1774904832.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 1/2] ati-vga: Silence warning about operator precedence MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , marcandre.lureau@redhat.com, Chad Jablonski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Date: Mon, 30 Mar 2026 23:09:16 +0200 (CEST) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1774905000797154100 Content-Type: text/plain; charset="utf-8" Coverity in CID 1645969 warns about possible operator precendence issue which is a false positive in this case but simplify the expression to silence the warning. Signed-off-by: BALATON Zoltan Reviewed-by: Peter Maydell --- hw/display/ati_2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/ati_2d.c b/hw/display/ati_2d.c index 23527b2c50..9baf6ff37b 100644 --- a/hw/display/ati_2d.c +++ b/hw/display/ati_2d.c @@ -91,7 +91,7 @@ static void setup_2d_blt_ctx(const ATIVGAState *s, ATI2DC= tx *ctx) ctx->host_data_active =3D s->host_data.active; ctx->left_to_right =3D s->regs.dp_cntl & DST_X_LEFT_TO_RIGHT; ctx->top_to_bottom =3D s->regs.dp_cntl & DST_Y_TOP_TO_BOTTOM; - ctx->need_swap =3D HOST_BIG_ENDIAN !=3D s->vga.big_endian_fb ? true : = false; + ctx->need_swap =3D (HOST_BIG_ENDIAN !=3D s->vga.big_endian_fb); ctx->frgd_clr =3D s->regs.dp_brush_frgd_clr; ctx->palette =3D s->vga.palette; ctx->dst_offset =3D s->regs.dst_offset; --=20 2.41.3 From nobody Thu Apr 2 01:08:44 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1774904998311497.9845659402655; Mon, 30 Mar 2026 14:09:58 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w7JrR-0006jg-6k; Mon, 30 Mar 2026 17:09:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w7JrP-0006iy-Py for qemu-devel@nongnu.org; Mon, 30 Mar 2026 17:09:23 -0400 Received: from zero.eik.bme.hu ([152.66.115.2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1w7JrM-0001XM-RW for qemu-devel@nongnu.org; Mon, 30 Mar 2026 17:09:23 -0400 Received: from localhost (localhost [127.0.0.1]) by zero.eik.bme.hu (Postfix) with ESMTP id A09D2596A2C; Mon, 30 Mar 2026 23:09:19 +0200 (CEST) Received: from zero.eik.bme.hu ([127.0.0.1]) by localhost (zero.eik.bme.hu [127.0.0.1]) (amavis, port 10028) with ESMTP id OkTHR36y2fOX; Mon, 30 Mar 2026 23:09:17 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 9F7BF5969F9; Mon, 30 Mar 2026 23:09:17 +0200 (CEST) X-Virus-Scanned: amavis at eik.bme.hu Message-ID: <541ffffdaa4c67b9dcbca6c2498e69b137bce95d.1774904832.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 2/2] ati-vga: Add upper limit to x-linear-aper-size property MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , marcandre.lureau@redhat.com, Chad Jablonski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell Date: Mon, 30 Mar 2026 23:09:17 +0200 (CEST) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=152.66.115.2; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1774905001868154100 Content-Type: text/plain; charset="utf-8" Coverity warns in CID 1645968 about possible integer overflow. This should never happen but to ensure that, add an upper limit on the x-linear-aper-size. This may not silence the warning but makes sure users cannot cause an overflow. Signed-off-by: BALATON Zoltan Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/ati.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/display/ati.c b/hw/display/ati.c index fc19737d1f..97d871b1e2 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -1130,6 +1130,10 @@ static void ati_vga_realize(PCIDevice *dev, Error **= errp) s->linear_aper_sz =3D ATI_R100_LINEAR_APER_SIZE; } } + if (s->linear_aper_sz > 256 * MiB) { + error_setg(errp, "x-linear-aper-size is too large (maximum 256 MiB= )"); + return; + } if (s->linear_aper_sz < 16 * MiB) { error_setg(errp, "x-linear-aper-size is too small (minimum 16 MiB)= "); return; --=20 2.41.3