From nobody Sat Oct 25 21:45:33 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 1521194174537203.71747109889702; Fri, 16 Mar 2018 02:56:14 -0700 (PDT) Received: from localhost ([::1]:55824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewm5t-0001Ln-Nn for importer@patchew.org; Fri, 16 Mar 2018 05:56:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ewm1g-0006YU-L7 for qemu-devel@nongnu.org; Fri, 16 Mar 2018 05:51:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ewm1d-00049m-Iq for qemu-devel@nongnu.org; Fri, 16 Mar 2018 05:51:52 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:59854 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ewm1d-000499-E5 for qemu-devel@nongnu.org; Fri, 16 Mar 2018 05:51:49 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E028040201A3; Fri, 16 Mar 2018 09:51:45 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0EC8C1234; Fri, 16 Mar 2018 09:51:44 +0000 (UTC) From: Thomas Huth To: qemu-devel@nongnu.org Date: Fri, 16 Mar 2018 10:51:30 +0100 Message-Id: <1521193892-15552-3-git-send-email-thuth@redhat.com> In-Reply-To: <1521193892-15552-1-git-send-email-thuth@redhat.com> References: <1521193892-15552-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 16 Mar 2018 09:51:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Fri, 16 Mar 2018 09:51:45 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PATCH 2/4] fdc: Exit if ISA controller does not support DMA 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: Eduardo Habkost , Alexey Kardashevskiy , Jason Wang , Gerd Hoffmann , Paolo Bonzini , John Snow , Pavel Pisa Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexey Kardashevskiy A "powernv" machine type defines an ISA bus but it does not add any DMA controller to it so it is possible to hit assert(fdctrl->dma) by adding "-machine powernv -device isa-fdc". This replaces assert() with an error message. Signed-off-by: Alexey Kardashevskiy [thuth: Slightly adjusted error message and updated scripts/device-crash-te= st] Signed-off-by: Thomas Huth --- hw/block/fdc.c | 5 ++++- scripts/device-crash-test | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 7b7dd41..cd29e27 100644 --- a/hw/block/fdc.c +++ b/hw/block/fdc.c @@ -2695,7 +2695,10 @@ static void isabus_fdc_realize(DeviceState *dev, Err= or **errp) fdctrl->dma_chann =3D isa->dma; if (fdctrl->dma_chann !=3D -1) { fdctrl->dma =3D isa_get_dma(isa_bus_from_device(isadev), isa->dma); - assert(fdctrl->dma); + if (!fdctrl->dma) { + error_setg(errp, "ISA controller does not support DMA"); + return; + } } =20 qdev_set_legacy_instance_id(dev, isa->iobase, 2); diff --git a/scripts/device-crash-test b/scripts/device-crash-test index 7ff351d..99d20cb 100755 --- a/scripts/device-crash-test +++ b/scripts/device-crash-test @@ -217,7 +217,6 @@ ERROR_WHITELIST =3D [ {'exitcode':-6, 'log':r"Object .* is not an instance of type generic-p= c-machine", 'loglevel':logging.ERROR}, {'exitcode':-6, 'log':r"Object .* is not an instance of type e500-ccsr= ", 'loglevel':logging.ERROR}, {'exitcode':-6, 'log':r"vmstate_register_with_alias_id: Assertion `!se= ->compat \|\| se->instance_id =3D=3D 0' failed", 'loglevel':logging.ERROR}, - {'exitcode':-6, 'device':'isa-fdc', 'loglevel':logging.ERROR, 'expecte= d':True}, {'exitcode':-11, 'device':'gus', 'loglevel':logging.ERROR, 'expected':= True}, {'exitcode':-11, 'device':'isa-serial', 'loglevel':logging.ERROR, 'exp= ected':True}, {'exitcode':-11, 'device':'sb16', 'loglevel':logging.ERROR, 'expected'= :True}, --=20 1.8.3.1