From nobody Fri Nov 14 18:04:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589815014; cv=none; d=zohomail.com; s=zohoarc; b=Gv6G060Vk8NjAPxWbJzKxSp7Wj02Phix0s0RRJ2vjw9gKA2dwH9EsRQRzbfHfGaQAiuew8Wet+TwkcCfdWI+SdFxYmOqZb8ek7KXrQv365lbRoEt7mrVGZDuCzWTsRRY6wZRdYdqBT9JJtp0XJhj9g+YJXiEec9DnRcwY7E78bA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589815014; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ldHYNRCCIyCjzZACk5BSdTldkMiO0XhPJ88/SX/DWp8=; b=QnVPE2ybD6zf1pcRtl2qp2HZJtS+B2Dnb+hDVDkWj4EpCAfBdCCGLM5Qgn2g3SoNE3imi5hTqXv3T2pPbA1fCW3JQ+SAOj9m+jM02d2wtJFJNQ51ndBsGdPXOY7KzqjXNWywkXKhhdzsYY8E0SSnzusLdjMZ3+nlxJpLDsVrqIc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589815014374248.39786057476795; Mon, 18 May 2020 08:16:54 -0700 (PDT) Received: from localhost ([::1]:45256 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jahVd-0004h4-IE for importer@patchew.org; Mon, 18 May 2020 11:16:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47646) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jahS6-0008D0-Vx for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:15 -0400 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:36145 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jahS1-0005xH-Vu for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:14 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-378-pLmnozaoP9ueV0CW8_RSEQ-1; Mon, 18 May 2020 11:13:05 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id D707B107ACCD; Mon, 18 May 2020 15:13:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37C335C1B2; Mon, 18 May 2020 15:12:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8319817477; Mon, 18 May 2020 17:12:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589814789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=ldHYNRCCIyCjzZACk5BSdTldkMiO0XhPJ88/SX/DWp8=; b=b8Qmr2U7jeKwE3tDdD6JE875ypGSKjbvYny5VP62Wta5qoi6svp2646Rzi5+m/r+Gf8GJY w+qPmkNQYC34Q3c7ReDuraZOEu4tVBIPJbjQn3dZaGSVtMq7338tulJgqMIcCyMFi7erbL Xdt5X/atSrkQaqFOD3m5lUqHQ2SEp/M= X-MC-Unique: pLmnozaoP9ueV0CW8_RSEQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 1/8] ati-vga: Do not allow unaligned access via index register Date: Mon, 18 May 2020 17:12:48 +0200 Message-Id: <20200518151255.10785-2-kraxel@redhat.com> In-Reply-To: <20200518151255.10785-1-kraxel@redhat.com> References: <20200518151255.10785-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.61; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 23:32:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Paolo Bonzini , Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: BALATON Zoltan According to docs bits 1 and 0 of MM_INDEX are hard coded to 0 so unaligned access via this register should not be possible. This also fixes problems reported in bug #1878134. Buglink: https://bugs.launchpad.net/qemu/+bug/1878134 Signed-off-by: BALATON Zoltan Tested-by: Alexander Bulekov Acked-by: Alexander Bulekov Message-id: 20200516132352.39E9374594E@zero.eik.bme.hu Signed-off-by: Gerd Hoffmann --- hw/display/ati.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/ati.c b/hw/display/ati.c index 58ec8291d460..065f197678e4 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -511,7 +511,7 @@ static void ati_mm_write(void *opaque, hwaddr addr, } switch (addr) { case MM_INDEX: - s->regs.mm_index =3D data; + s->regs.mm_index =3D data & ~3; break; case MM_DATA ... MM_DATA + 3: /* indexed access to regs or memory */ --=20 2.18.4 From nobody Fri Nov 14 18:04:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589815014; cv=none; d=zohomail.com; s=zohoarc; b=JOvUtMxtfJsJRv9MAnDbhn2eyomd1mLINUT+F/xjFn3bS3TNZPPM9SUeD/cfiEDZ5kaYFtydTMUf1rFyilUgxx3ILVgcOd1idTgi8MYVypTt7MUoy3WeTEhN9X22p0I8DmUj36iEie6Gsixx/OfTkpeJEMPJqLG/9zJ18Zd5tSM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589815014; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=+YCI2nfcVXJ1PDK3L/CPcyRZvTy24qI3gtfy+cKDHFE=; b=DCvy56LTByIlm+dnNI0J0euZyGvnyADl/y0l2LQ+RDGZxMQpWWn6vklokFeo6WgevsFGv3Peucf0LbZYmp8rwRW0L9URYDzZ/UGOWttFjd6qMNwnDQNQ7WImnTcwh24hZ4qJgxC8a1mPi+C8T8SfU6OD0YIYowElHNsfnIhnecg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589815014360377.39922266379745; Mon, 18 May 2020 08:16:54 -0700 (PDT) Received: from localhost ([::1]:45222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jahVd-0004gE-Dw for importer@patchew.org; Mon, 18 May 2020 11:16:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jahS6-0008Cw-Qf for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:14 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:54410 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jahS1-0005xE-UN for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:10 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-412-zDufPmW7NCKkz82R7VT-JQ-1; Mon, 18 May 2020 11:13:03 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B1131853B03; Mon, 18 May 2020 15:13:02 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BEBF1002394; Mon, 18 May 2020 15:12:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8D4991750A; Mon, 18 May 2020 17:12:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589814788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+YCI2nfcVXJ1PDK3L/CPcyRZvTy24qI3gtfy+cKDHFE=; b=S9MHh8rVcsrWd31oHyfXu3Cr+0lrICpH6bZC8ozG0CLFqXPoUk7xFxY0cVa0ijHssYZ+ka Vz/nhVnvAKSPYSPZY2VhsEwk3XIYyLilDNG3mlpsdkoG+eDbixiq4IsMtjQCJnV1coYo76 lYRVoCkgbboiKDfHoY3X2AgKaKGj62I= X-MC-Unique: zDufPmW7NCKkz82R7VT-JQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 2/8] hw/display: Include local 'framebuffer.h' Date: Mon, 18 May 2020 17:12:49 +0200 Message-Id: <20200518151255.10785-3-kraxel@redhat.com> In-Reply-To: <20200518151255.10785-1-kraxel@redhat.com> References: <20200518151255.10785-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 22:51:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Paolo Bonzini , Alex Williamson , Gerd Hoffmann , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Philippe Mathieu-Daud=C3=A9 The "framebuffer.h" header is not an exported include. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Message-id: 20200504082003.16298-2-f4bug@amsat.org Signed-off-by: Gerd Hoffmann --- hw/display/artist.c | 2 +- hw/display/next-fb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/display/artist.c b/hw/display/artist.c index 7e2a4556bd06..6261bfe65b72 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -21,7 +21,7 @@ #include "migration/vmstate.h" #include "ui/console.h" #include "trace.h" -#include "hw/display/framebuffer.h" +#include "framebuffer.h" =20 #define TYPE_ARTIST "artist" #define ARTIST(obj) OBJECT_CHECK(ARTISTState, (obj), TYPE_ARTIST) diff --git a/hw/display/next-fb.c b/hw/display/next-fb.c index 2b726a10f845..b0513a8fba62 100644 --- a/hw/display/next-fb.c +++ b/hw/display/next-fb.c @@ -27,7 +27,7 @@ #include "hw/hw.h" #include "hw/boards.h" #include "hw/loader.h" -#include "hw/display/framebuffer.h" +#include "framebuffer.h" #include "ui/pixel_ops.h" #include "hw/m68k/next-cube.h" =20 --=20 2.18.4 From nobody Fri Nov 14 18:04:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589814872; cv=none; d=zohomail.com; s=zohoarc; b=j94D1Sp0EIWDaLehKmVRaEh9vd4x5zCkNQgRI43FCKJYwzESEkbyB5Z7s8E/y4Fh8NZdHbR/PXiKP8x6Wx+K9TimXMKzCG56l6mgkOnSW+u+ls1RUwlf7EiahpDZ99mLVk/EkcjL/ukrKnLsH52nEGiZ+9blethme3cQCgKcflM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589814872; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=ddE1J3IeNEdn4AeoJi2TcC6T3/GhYGv2cotZGl9fFUk=; b=YqaVahcTbw6/7MvBtXBuTjkvVm1G/7WegHr3nlEAwFng506ZXgW8afJyOgBvx2BOi3I/yUKi530mk8VDetyv1ZruoGnIvho7vCTcE62jBy1vVf0rUtDJMzkx2mxdbCbHiVQ58KWLs6zizv748LnUnqzradBV8Kx8MbTZ+wwFkJQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589814872819798.8013894717839; Mon, 18 May 2020 08:14:32 -0700 (PDT) Received: from localhost ([::1]:37722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jahTK-0001Q8-1m for importer@patchew.org; Mon, 18 May 2020 11:14:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47620) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jahS2-0008CT-MB for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:10 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:26982 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jahS0-0005x7-VM for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:09 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-110-PSAQBG95MZmhcie1xhnpzQ-1; Mon, 18 May 2020 11:13:06 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 662EB107ACF4; Mon, 18 May 2020 15:13:05 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id A59375D9DC; Mon, 18 May 2020 15:12:56 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9C38117538; Mon, 18 May 2020 17:12:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589814788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=ddE1J3IeNEdn4AeoJi2TcC6T3/GhYGv2cotZGl9fFUk=; b=VDa9udDDJ//8FdQkHJzoISMhGsDN5VIVEkZhl4jo4XxpTQ5pRQnsnSt0U86QFD1kUiISkM u6iPM3oA1y7Klw+QT65Hr7mHNIhg96yVD71ZG0EgDtyiowtzCw1hbjlr8UvfURj2jMhIUE Yr2q5SP2G3v0eLtLFAvFnGJXj8/by/M= X-MC-Unique: PSAQBG95MZmhcie1xhnpzQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 3/8] Revert "hw/display/ramfb: initialize fw-config space with xres/ yres" Date: Mon, 18 May 2020 17:12:50 +0200 Message-Id: <20200518151255.10785-4-kraxel@redhat.com> In-Reply-To: <20200518151255.10785-1-kraxel@redhat.com> References: <20200518151255.10785-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 22:51:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Paolo Bonzini , Alex Williamson , Gerd Hoffmann , Hou Qiming Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This reverts commit f79081b4b71b72640bedd40a7cd76f864c8287f1. Patch has broken byteorder handling: RAMFBCfg fields are in bigendian byteorder, the reset function doesn't care so native byteorder is used instead. Given this went unnoticed so far the feature is obviously unused, so just revert the patch. Cc: Hou Qiming Signed-off-by: Gerd Hoffmann Acked-by: Laszlo Ersek Message-id: 20200429115236.28709-2-kraxel@redhat.com --- include/hw/display/ramfb.h | 2 +- hw/display/ramfb-standalone.c | 12 +----------- hw/display/ramfb.c | 16 +--------------- hw/vfio/display.c | 4 ++-- stubs/ramfb.c | 2 +- 5 files changed, 6 insertions(+), 30 deletions(-) diff --git a/include/hw/display/ramfb.h b/include/hw/display/ramfb.h index f6c2de93b222..b33a2c467b28 100644 --- a/include/hw/display/ramfb.h +++ b/include/hw/display/ramfb.h @@ -4,7 +4,7 @@ /* ramfb.c */ typedef struct RAMFBState RAMFBState; void ramfb_display_update(QemuConsole *con, RAMFBState *s); -RAMFBState *ramfb_setup(DeviceState *dev, Error **errp); +RAMFBState *ramfb_setup(Error **errp); =20 /* ramfb-standalone.c */ #define TYPE_RAMFB_DEVICE "ramfb" diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c index d76a9d0fe2c9..b18db97eeb1b 100644 --- a/hw/display/ramfb-standalone.c +++ b/hw/display/ramfb-standalone.c @@ -3,7 +3,6 @@ #include "qemu/module.h" #include "hw/loader.h" #include "hw/qdev-properties.h" -#include "hw/isa/isa.h" #include "hw/display/ramfb.h" #include "ui/console.h" =20 @@ -13,8 +12,6 @@ typedef struct RAMFBStandaloneState { SysBusDevice parent_obj; QemuConsole *con; RAMFBState *state; - uint32_t xres; - uint32_t yres; } RAMFBStandaloneState; =20 static void display_update_wrapper(void *dev) @@ -37,22 +34,15 @@ static void ramfb_realizefn(DeviceState *dev, Error **e= rrp) RAMFBStandaloneState *ramfb =3D RAMFB(dev); =20 ramfb->con =3D graphic_console_init(dev, 0, &wrapper_ops, dev); - ramfb->state =3D ramfb_setup(dev, errp); + ramfb->state =3D ramfb_setup(errp); } =20 -static Property ramfb_properties[] =3D { - DEFINE_PROP_UINT32("xres", RAMFBStandaloneState, xres, 0), - DEFINE_PROP_UINT32("yres", RAMFBStandaloneState, yres, 0), - DEFINE_PROP_END_OF_LIST(), -}; - static void ramfb_class_initfn(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); =20 set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->realize =3D ramfb_realizefn; - device_class_set_props(dc, ramfb_properties); dc->desc =3D "ram framebuffer standalone device"; dc->user_creatable =3D true; } diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c index 7ba07c80f6e1..bd4746dc1768 100644 --- a/hw/display/ramfb.c +++ b/hw/display/ramfb.c @@ -13,7 +13,6 @@ =20 #include "qemu/osdep.h" #include "qapi/error.h" -#include "qemu/option.h" #include "hw/loader.h" #include "hw/display/ramfb.h" #include "ui/console.h" @@ -31,7 +30,6 @@ struct QEMU_PACKED RAMFBCfg { struct RAMFBState { DisplaySurface *ds; uint32_t width, height; - uint32_t starting_width, starting_height; struct RAMFBCfg cfg; bool locked; }; @@ -117,11 +115,9 @@ static void ramfb_reset(void *opaque) RAMFBState *s =3D (RAMFBState *)opaque; s->locked =3D false; memset(&s->cfg, 0, sizeof(s->cfg)); - s->cfg.width =3D s->starting_width; - s->cfg.height =3D s->starting_height; } =20 -RAMFBState *ramfb_setup(DeviceState* dev, Error **errp) +RAMFBState *ramfb_setup(Error **errp) { FWCfgState *fw_cfg =3D fw_cfg_find(); RAMFBState *s; @@ -133,16 +129,6 @@ RAMFBState *ramfb_setup(DeviceState* dev, Error **errp) =20 s =3D g_new0(RAMFBState, 1); =20 - const char *s_fb_width =3D qemu_opt_get(dev->opts, "xres"); - const char *s_fb_height =3D qemu_opt_get(dev->opts, "yres"); - if (s_fb_width) { - s->cfg.width =3D atoi(s_fb_width); - s->starting_width =3D s->cfg.width; - } - if (s_fb_height) { - s->cfg.height =3D atoi(s_fb_height); - s->starting_height =3D s->cfg.height; - } s->locked =3D false; =20 rom_add_vga("vgabios-ramfb.bin"); diff --git a/hw/vfio/display.c b/hw/vfio/display.c index f4977c66e1b5..a57a22674d62 100644 --- a/hw/vfio/display.c +++ b/hw/vfio/display.c @@ -353,7 +353,7 @@ static int vfio_display_dmabuf_init(VFIOPCIDevice *vdev= , Error **errp) &vfio_display_dmabuf_ops, vdev); if (vdev->enable_ramfb) { - vdev->dpy->ramfb =3D ramfb_setup(DEVICE(vdev), errp); + vdev->dpy->ramfb =3D ramfb_setup(errp); } vfio_display_edid_init(vdev); return 0; @@ -479,7 +479,7 @@ static int vfio_display_region_init(VFIOPCIDevice *vdev= , Error **errp) &vfio_display_region_ops, vdev); if (vdev->enable_ramfb) { - vdev->dpy->ramfb =3D ramfb_setup(DEVICE(vdev), errp); + vdev->dpy->ramfb =3D ramfb_setup(errp); } return 0; } diff --git a/stubs/ramfb.c b/stubs/ramfb.c index 0799093a5d6e..48143f33542f 100644 --- a/stubs/ramfb.c +++ b/stubs/ramfb.c @@ -6,7 +6,7 @@ void ramfb_display_update(QemuConsole *con, RAMFBState *s) { } =20 -RAMFBState *ramfb_setup(DeviceState* dev, Error **errp) +RAMFBState *ramfb_setup(Error **errp) { error_setg(errp, "ramfb support not available"); return NULL; --=20 2.18.4 From nobody Fri Nov 14 18:04:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589815016; cv=none; d=zohomail.com; s=zohoarc; b=f8JKn9aVqbb/r9Q/Sg4oopEBjaCxiwR2ZX8Sv5CHe7+OcItH5Rmef1d49/skohOJklvmKadfe70fwJTxy8YUU6Teq0I1zpJNRBagNpdO4X5WQ2xplBeyiIzYhpcW3XXu6NmlA5WxNcJFJsse0JJiJUzyunlwfxIreZ1r4aPWWSA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589815016; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=+iI8FGRKs81adLpcBjB+Oh9YO05lIOQpzFUXVMZs9XA=; b=dXbmpaig5ixBaks+izV5+KzMVwYkabWJsUn85J6xKKZCfB7sUifVF0WGy4a7W4csRe7U/S0VVPKcY8aVPCjVLngnK4jHnYsmrtKgxmF9F9iW2mdz/rFEh+NwY74xCgcsxdb+MWjsKNyMXOiAX3RLz9qND8qPQQ2Y/Sl4hfMfqMQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589815016085861.0433496753561; Mon, 18 May 2020 08:16:56 -0700 (PDT) Received: from localhost ([::1]:45298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jahVe-0004i2-HY for importer@patchew.org; Mon, 18 May 2020 11:16:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jahS7-0008DI-Dn for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:15 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:23405 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jahS0-0005wr-U4 for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:15 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-251-ZLrXOuxSPE2VLEQSGIjyag-1; Mon, 18 May 2020 11:13:04 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 99CC1805726; Mon, 18 May 2020 15:13:03 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id B6B8A99ED; Mon, 18 May 2020 15:12:57 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A50F59DAD; Mon, 18 May 2020 17:12:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589814787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=+iI8FGRKs81adLpcBjB+Oh9YO05lIOQpzFUXVMZs9XA=; b=P1OpDumv24JBrnngvxcOqJVEK0+tzFiIygOuFUF2TqiPr5eQlSRThDQQMOBqgCZU/iNjiT xq9Dylt+a/4o/TnpO4Fp/EtGnhA9e5RxofaFDrL2/5zA/3I2b/n1W0/av4S1FUQ3E+IR6d vRi7qRTk6EKOTLW+rUIAV74X0l1dNoE= X-MC-Unique: ZLrXOuxSPE2VLEQSGIjyag-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 4/8] Revert "hw/display/ramfb: lock guest resolution after it's set" Date: Mon, 18 May 2020 17:12:51 +0200 Message-Id: <20200518151255.10785-5-kraxel@redhat.com> In-Reply-To: <20200518151255.10785-1-kraxel@redhat.com> References: <20200518151255.10785-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/18 00:53:04 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Paolo Bonzini , Alex Williamson , Gerd Hoffmann , Hou Qiming Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This reverts commit a9e0cb67b7f4c485755659f9b764c38b5f970de4. This breaks OVMF. Reproducer: Just hit 'ESC' at early boot to enter firmware setup. OVMF wants switch from (default) 800x600 to 640x480 for that, and this patch blocks it. Cc: Hou Qiming Signed-off-by: Gerd Hoffmann Reviewed-by: Laszlo Ersek Message-id: 20200429115236.28709-3-kraxel@redhat.com --- hw/display/ramfb.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c index bd4746dc1768..9d41c2ad2868 100644 --- a/hw/display/ramfb.c +++ b/hw/display/ramfb.c @@ -31,7 +31,6 @@ struct RAMFBState { DisplaySurface *ds; uint32_t width, height; struct RAMFBCfg cfg; - bool locked; }; =20 static void ramfb_unmap_display_surface(pixman_image_t *image, void *unuse= d) @@ -72,25 +71,18 @@ static DisplaySurface *ramfb_create_display_surface(int= width, int height, static void ramfb_fw_cfg_write(void *dev, off_t offset, size_t len) { RAMFBState *s =3D dev; - uint32_t fourcc, format, width, height; + uint32_t fourcc, format; hwaddr stride, addr; =20 - width =3D be32_to_cpu(s->cfg.width); - height =3D be32_to_cpu(s->cfg.height); + s->width =3D be32_to_cpu(s->cfg.width); + s->height =3D be32_to_cpu(s->cfg.height); stride =3D be32_to_cpu(s->cfg.stride); fourcc =3D be32_to_cpu(s->cfg.fourcc); addr =3D be64_to_cpu(s->cfg.addr); format =3D qemu_drm_format_to_pixman(fourcc); =20 fprintf(stderr, "%s: %dx%d @ 0x%" PRIx64 "\n", __func__, - width, height, addr); - if (s->locked) { - fprintf(stderr, "%s: resolution locked, change rejected\n", __func= __); - return; - } - s->locked =3D true; - s->width =3D width; - s->height =3D height; + s->width, s->height, addr); s->ds =3D ramfb_create_display_surface(s->width, s->height, format, stride, addr); } @@ -110,13 +102,6 @@ void ramfb_display_update(QemuConsole *con, RAMFBState= *s) dpy_gfx_update_full(con); } =20 -static void ramfb_reset(void *opaque) -{ - RAMFBState *s =3D (RAMFBState *)opaque; - s->locked =3D false; - memset(&s->cfg, 0, sizeof(s->cfg)); -} - RAMFBState *ramfb_setup(Error **errp) { FWCfgState *fw_cfg =3D fw_cfg_find(); @@ -129,12 +114,9 @@ RAMFBState *ramfb_setup(Error **errp) =20 s =3D g_new0(RAMFBState, 1); =20 - s->locked =3D false; - rom_add_vga("vgabios-ramfb.bin"); fw_cfg_add_file_callback(fw_cfg, "etc/ramfb", NULL, ramfb_fw_cfg_write, s, &s->cfg, sizeof(s->cfg), false); - qemu_register_reset(ramfb_reset, s); return s; } --=20 2.18.4 From nobody Fri Nov 14 18:04:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589814869; cv=none; d=zohomail.com; s=zohoarc; b=UFoG7ibc2IHslA01fWlzIE6w3UjWx91J8J94ruOGFyDY/aYabd+7yY50BiPhYVEWY46hIz3xB06zFE0hINwmvCT9q7ya+vjpj62lvcTUhkx9CV+BMl+KkieTFsE27zDR6u9Hr994LR8/aXBzwPriCNodesuACohD1pADiEWZDCU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589814869; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=6eB67NrJRwks3wq3b/evsRLH9VPaAsga7aoULUOuONk=; b=aOSPheUv0EFrTdE9f4mfUdOWVYhMkdGYYu516dqm8pkKZ3mmPI4ZWJQ+VEWzRA42gOo1DbaPa80KWIc6r8HvpEdQraFj/7iAlgUJ5hqH1lKDxnTnehDrNnrXgx/xra5lYdyoGlK6vn79askt18nUNlpf1C4WdegYtcuZOs22dxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589814869071547.8783254734979; Mon, 18 May 2020 08:14:29 -0700 (PDT) Received: from localhost ([::1]:37730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jahTG-0001QF-SG for importer@patchew.org; Mon, 18 May 2020 11:14:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jahS2-0008CU-Ot for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:10 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:60098 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jahS0-0005wu-UE for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:10 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-472-eawVyf9aNSS3M37YpZb-rg-1; Mon, 18 May 2020 11:13:05 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 635931054F92; Mon, 18 May 2020 15:13:04 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id AE4F55C1B5; Mon, 18 May 2020 15:13:03 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id ADC3D9DAE; Mon, 18 May 2020 17:12:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589814787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6eB67NrJRwks3wq3b/evsRLH9VPaAsga7aoULUOuONk=; b=I1kflOlFop78GpnCY+bTKSHU+whzNTZbJlWsi0o4gv7luGPdTbKtErSuq4mANAK/0DfoK+ N4oLl9QHQ1zI2sSKuIuE6ASMMZsD5PA1TLkPjioIzUA2zbifp0hQUtcz3ZWym/Zx8QIuA8 2cJI1QO/bTuawBzCyZaDqwLq3Uj5eXE= X-MC-Unique: eawVyf9aNSS3M37YpZb-rg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 5/8] ramfb: drop leftover debug message Date: Mon, 18 May 2020 17:12:52 +0200 Message-Id: <20200518151255.10785-6-kraxel@redhat.com> In-Reply-To: <20200518151255.10785-1-kraxel@redhat.com> References: <20200518151255.10785-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 22:51:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Paolo Bonzini , Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laszlo Ersek Message-id: 20200429115236.28709-4-kraxel@redhat.com --- hw/display/ramfb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c index 9d41c2ad2868..228defee5683 100644 --- a/hw/display/ramfb.c +++ b/hw/display/ramfb.c @@ -81,8 +81,6 @@ static void ramfb_fw_cfg_write(void *dev, off_t offset, s= ize_t len) addr =3D be64_to_cpu(s->cfg.addr); format =3D qemu_drm_format_to_pixman(fourcc); =20 - fprintf(stderr, "%s: %dx%d @ 0x%" PRIx64 "\n", __func__, - s->width, s->height, addr); s->ds =3D ramfb_create_display_surface(s->width, s->height, format, stride, addr); } --=20 2.18.4 From nobody Fri Nov 14 18:04:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589815106; cv=none; d=zohomail.com; s=zohoarc; b=VLaFYF807w55Bjossaa+wScvUgKSFpEDAx6SWKqI/YkeYYVoan4sMrLgdQ1QjXqG0sSGDEKweTJ0YSjXq8eIguVju6ho+iuS/0giwHo+95spWdu+2ftbZXxleokUoQTF8rSzXtfts3VL5TW+slt5P0l1OaZqharS1LGP97w3FwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589815106; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YtqUmKQMGjg6mbojO7jrd87kWqX6KkWWBX0ulVrUm/w=; b=DGgrJg0e9BVRCAloG5AlgQxm9NTL3P0vialiktR7PQF6ITldm4C8UtyyyhvMuphomZJlYv3lGiwcHhnWqyUuKuouf8+BcC7HV7aNhrIqDzI4R08xtfWep3ng+rfZDGmKaCU4i0cRCBeiJRa6LcjefoRzGsvwtUNgLGqfIqx7tqQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589815106651544.6274182140005; Mon, 18 May 2020 08:18:26 -0700 (PDT) Received: from localhost ([::1]:50714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jahX7-00072R-R1 for importer@patchew.org; Mon, 18 May 2020 11:18:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jahS8-0008FR-Ji for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:16 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:23865 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jahS6-0005xw-HZ for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:16 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-185-9bWC0OqIMKu1EQ-y2nOC0w-1; Mon, 18 May 2020 11:13:08 -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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB68E107ACF4; Mon, 18 May 2020 15:13:07 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id B10695C1B2; Mon, 18 May 2020 15:13:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B6C5A9DAF; Mon, 18 May 2020 17:12:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589814790; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YtqUmKQMGjg6mbojO7jrd87kWqX6KkWWBX0ulVrUm/w=; b=KjQcWrrUgJzdfVA3bwJG29Wwuj/jE1siEXwcexxYCXqqpzWt5LszQhihdBkzcvBXERdZAY u417gtaUHPgZchpuMRQ3BFBx1KDU4uuI9gRDvR+SWyWC0JyWkNK0PWGnNC1pBuRN5Za9ut 2Z3D5e+l6FqO7cj+anh5i34O+iJjjy8= X-MC-Unique: 9bWC0OqIMKu1EQ-y2nOC0w-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 6/8] ramfb: don't update RAMFBState on errors Date: Mon, 18 May 2020 17:12:53 +0200 Message-Id: <20200518151255.10785-7-kraxel@redhat.com> In-Reply-To: <20200518151255.10785-1-kraxel@redhat.com> References: <20200518151255.10785-1-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 22:52:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Paolo Bonzini , Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Store width & height & surface in local variables. Update RAMFBState with the new values only in case the ramfb_create_display_surface() call succeeds. Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Laszlo Ersek Message-id: 20200429115236.28709-5-kraxel@redhat.com --- hw/display/ramfb.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c index 228defee5683..1a20bdec416f 100644 --- a/hw/display/ramfb.c +++ b/hw/display/ramfb.c @@ -71,18 +71,26 @@ static DisplaySurface *ramfb_create_display_surface(int= width, int height, static void ramfb_fw_cfg_write(void *dev, off_t offset, size_t len) { RAMFBState *s =3D dev; - uint32_t fourcc, format; + DisplaySurface *surface; + uint32_t fourcc, format, width, height; hwaddr stride, addr; =20 - s->width =3D be32_to_cpu(s->cfg.width); - s->height =3D be32_to_cpu(s->cfg.height); - stride =3D be32_to_cpu(s->cfg.stride); - fourcc =3D be32_to_cpu(s->cfg.fourcc); - addr =3D be64_to_cpu(s->cfg.addr); - format =3D qemu_drm_format_to_pixman(fourcc); + width =3D be32_to_cpu(s->cfg.width); + height =3D be32_to_cpu(s->cfg.height); + stride =3D be32_to_cpu(s->cfg.stride); + fourcc =3D be32_to_cpu(s->cfg.fourcc); + addr =3D be64_to_cpu(s->cfg.addr); + format =3D qemu_drm_format_to_pixman(fourcc); =20 - s->ds =3D ramfb_create_display_surface(s->width, s->height, - format, stride, addr); + surface =3D ramfb_create_display_surface(width, height, + format, stride, addr); + if (!surface) { + return; + } + + s->width =3D width; + s->height =3D height; + s->ds =3D surface; } =20 void ramfb_display_update(QemuConsole *con, RAMFBState *s) --=20 2.18.4 From nobody Fri Nov 14 18:04:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589814880; cv=none; d=zohomail.com; s=zohoarc; b=lO8mCNgPNqiiXw8No+qnG8yJMVY1BzPWQ0Xa5YMWlFy6F6rbUc6aZA6QO+TAoFWBZrDpSj4hjSPq92nMU3laoU/QGkVtjyqazYOirU89cC7IBkhzcei6UZxQWeeu3NBZQYY5qxEmwn8ezE9ayvoPh0y+celz/DcN84n7M+o7BEA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589814880; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=fXCvUdEx+FrIo7wUpO72NoYceQqIJ/OQc6Hck1dyBrU=; b=AOKY9McEhMzjaaauKjavCzY/ar//PJ5+IRC/DBgtLSS/OPizwcE2O3cii/0dFT13ce7pqt8GbyD7VN04PTf0pn+vfDgHkdy3v6CM8Zu67XEV3A3uEALfgHW9ABPgW9VLutpBjJx1AYBk6RoWp/yBFrtygvbPUf4eEjxY8A9PAjA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589814880268971.9890745814827; Mon, 18 May 2020 08:14:40 -0700 (PDT) Received: from localhost ([::1]:37768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jahTQ-0001RL-Re for importer@patchew.org; Mon, 18 May 2020 11:14:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jahS2-0008CZ-Sk for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:10 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:35388 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jahS1-0005x4-8c for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:10 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-395-9EHauikqP3SUlRfd3g_lrQ-1; Mon, 18 May 2020 11:13:06 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4AC89872FEB; Mon, 18 May 2020 15:13:05 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id E22971001925; Mon, 18 May 2020 15:13:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id BF7269DB0; Mon, 18 May 2020 17:12:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589814788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=fXCvUdEx+FrIo7wUpO72NoYceQqIJ/OQc6Hck1dyBrU=; b=SamT9/RR2sa453ap1Y8nz0FDZYVyDEdQfc7FTWA7gtnB7G6VrvgGIPeqqNKJ7nXGKpQAvY PG42kTJpzwB0/XVVx82BoxERuS5oX/zoyHiGLFYP4hMtJ69FQ6TSDvHsDTns1NCPukOGSG ZvfdUkOSItQMTOxNu6EP6ykKH1JEtJg= X-MC-Unique: 9EHauikqP3SUlRfd3g_lrQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 7/8] ramfb: add sanity checks to ramfb_create_display_surface Date: Mon, 18 May 2020 17:12:54 +0200 Message-Id: <20200518151255.10785-8-kraxel@redhat.com> In-Reply-To: <20200518151255.10785-1-kraxel@redhat.com> References: <20200518151255.10785-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=207.211.31.81; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 22:52:27 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Paolo Bonzini , Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Gerd Hoffmann Reviewed-by: Laszlo Ersek Message-id: 20200429115236.28709-6-kraxel@redhat.com --- hw/display/ramfb.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c index 1a20bdec416f..52dae78db48f 100644 --- a/hw/display/ramfb.c +++ b/hw/display/ramfb.c @@ -15,6 +15,7 @@ #include "qapi/error.h" #include "hw/loader.h" #include "hw/display/ramfb.h" +#include "hw/display/bochs-vbe.h" /* for limits */ #include "ui/console.h" #include "sysemu/reset.h" =20 @@ -49,6 +50,11 @@ static DisplaySurface *ramfb_create_display_surface(int = width, int height, hwaddr size; void *data; =20 + if (width < 16 || width > VBE_DISPI_MAX_XRES || + height < 16 || height > VBE_DISPI_MAX_YRES || + format =3D=3D 0 /* unknown format */) + return NULL; + if (linesize =3D=3D 0) { linesize =3D width * PIXMAN_FORMAT_BPP(format) / 8; } --=20 2.18.4 From nobody Fri Nov 14 18:04:29 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1589814869; cv=none; d=zohomail.com; s=zohoarc; b=cp9JSfKRpnnXxb3KFxilBTevFzDIf0i/Vd35OnV9JYAGO+qZc7PASRZINF9LG3IQIKpeqlHpqoG2U7D4K1pRwrkvoSYyh2Bud6HNGBwD+fQjUTrtCpWLVV417TNhXPODtbac8IYuDUrwB6LdlvrAUsWemCRGukmOlT734b2xsNk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589814869; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=m+oXLR/s2hsUzUabYgFwDLrpvj1T3gZYj4iuWFEwGKY=; b=D7+6fkixffAX4FjMiRWlJzKAcfiGv5YKCUplY+qncpaa64SrPPawh7nwFpJexiKrDqrpHQFgdtmks6ByNRCUBFyposlUfe2baZKQsjn/joCOvpVmml+vW7243b/vZoJvnnbOmChnm1H2S421RRw+8feifmjp17yOduDWNhR1Uyw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1589814869121833.9221962314397; Mon, 18 May 2020 08:14:29 -0700 (PDT) Received: from localhost ([::1]:37660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jahTG-0001Oe-Td for importer@patchew.org; Mon, 18 May 2020 11:14:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jahS2-0008CW-Rx for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:10 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:41654 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jahS1-0005xG-T8 for qemu-devel@nongnu.org; Mon, 18 May 2020 11:13:10 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-462-1Q3EqMwkP5yxQ8k2pWoYLg-1; Mon, 18 May 2020 11:13:06 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3EA49EC1A2; Mon, 18 May 2020 15:13:05 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-113-50.ams2.redhat.com [10.36.113.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id C45515D9DD; Mon, 18 May 2020 15:13:04 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C82BE9D54; Mon, 18 May 2020 17:12:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589814788; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=m+oXLR/s2hsUzUabYgFwDLrpvj1T3gZYj4iuWFEwGKY=; b=Voql2cjRyEIkW3v4w7VQzED3Dz7ZQDHytrvUbuuNoqrCPssRegON+L7Bo3Mgxb63CdUKzG Nr2erfd4etPdBYErRzuL5K/fnKAw9ctm1/U5pQ9SU7bhslHPcaN7el/pe++lsqczif25ns PKnPhk30lNLlTHx4F4cuBvY45GekXCY= X-MC-Unique: 1Q3EqMwkP5yxQ8k2pWoYLg-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Subject: [PULL 8/8] ramfb: fix size calculation Date: Mon, 18 May 2020 17:12:55 +0200 Message-Id: <20200518151255.10785-9-kraxel@redhat.com> In-Reply-To: <20200518151255.10785-1-kraxel@redhat.com> References: <20200518151255.10785-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=205.139.110.120; envelope-from=kraxel@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/17 22:51:00 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Paolo Bonzini , Alex Williamson , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" size calculation isn't correct with guest-supplied stride, the last display line isn't accounted for correctly. For the typical case of stride > linesize (add padding) we error on the safe side (calculated size is larger than actual size). With stride < linesize (scanlines overlap) the calculated size is smaller than the actual size though so our guest memory mapping might end up being too small. While being at it also fix ramfb_create_display_surface to use hwaddr for the parameters. That way all calculation are done with hwaddr type and we can't get funny effects from type castings. Signed-off-by: Gerd Hoffmann Acked-by: Laszlo Ersek Message-id: 20200429115236.28709-7-kraxel@redhat.com --- hw/display/ramfb.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hw/display/ramfb.c b/hw/display/ramfb.c index 52dae78db48f..79b9754a5820 100644 --- a/hw/display/ramfb.c +++ b/hw/display/ramfb.c @@ -44,10 +44,10 @@ static void ramfb_unmap_display_surface(pixman_image_t = *image, void *unused) =20 static DisplaySurface *ramfb_create_display_surface(int width, int height, pixman_format_code_t f= ormat, - int linesize, uint64_t= addr) + hwaddr stride, hwaddr = addr) { DisplaySurface *surface; - hwaddr size; + hwaddr size, mapsize, linesize; void *data; =20 if (width < 16 || width > VBE_DISPI_MAX_XRES || @@ -55,19 +55,20 @@ static DisplaySurface *ramfb_create_display_surface(int= width, int height, format =3D=3D 0 /* unknown format */) return NULL; =20 - if (linesize =3D=3D 0) { - linesize =3D width * PIXMAN_FORMAT_BPP(format) / 8; + linesize =3D width * PIXMAN_FORMAT_BPP(format) / 8; + if (stride =3D=3D 0) { + stride =3D linesize; } =20 - size =3D (hwaddr)linesize * height; - data =3D cpu_physical_memory_map(addr, &size, false); - if (size !=3D (hwaddr)linesize * height) { - cpu_physical_memory_unmap(data, size, 0, 0); + mapsize =3D size =3D stride * (height - 1) + linesize; + data =3D cpu_physical_memory_map(addr, &mapsize, false); + if (size !=3D mapsize) { + cpu_physical_memory_unmap(data, mapsize, 0, 0); return NULL; } =20 surface =3D qemu_create_displaysurface_from(width, height, - format, linesize, data); + format, stride, data); pixman_image_set_destroy_function(surface->image, ramfb_unmap_display_surface, NULL); =20 --=20 2.18.4