From nobody Tue Feb 10 07:40:54 2026 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; dkim=fail; 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 1508200617118993.6061883971257; Mon, 16 Oct 2017 17:36:57 -0700 (PDT) Received: from localhost ([::1]:35839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4FsJ-0008HH-Ej for importer@patchew.org; Mon, 16 Oct 2017 20:36:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e4FWg-0007Uv-Ou for qemu-devel@nongnu.org; Mon, 16 Oct 2017 20:14:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e4FWf-00056x-R8 for qemu-devel@nongnu.org; Mon, 16 Oct 2017 20:14:30 -0400 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]:47582) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e4FWf-00056d-Mx; Mon, 16 Oct 2017 20:14:29 -0400 Received: by mail-qk0-x244.google.com with SMTP id m189so28870qke.4; Mon, 16 Oct 2017 17:14:29 -0700 (PDT) Received: from x1.local ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id r6sm5409043qkh.22.2017.10.16.17.14.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Oct 2017 17:14:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=K7Il9e4gdvfd5CEL77iu9A6C8SdwX5vWI0pDwfAhw3g=; b=Ais4fNr3f7bPeiPdWLQqD3j6ZCJSRHbLdoV70Le5gQKYs8x4myXbR8TgDfDgNjNEz7 nyKYwijn31pUGrD+gnJrzU/22y3/h56m7GSyDQX+QO/nAYfmtXl3smexhcsBglPjE+f+ ylNumLCidoDpP1JglrdDXrAuRdAMPXdKUGa1Iw4c1LWn42vMG//txJEe5tQTm8dsEbyw mfofEBjtBBjwpiSQxohq8gQcbDIRB6vOhx3ATd0ih1eR/ZKKyDl07gkkqsEyDboMrAjf GuDGPxxykbQicsetdMNH+n0uFqpeVT12g/Q1fQDlaj32Z2ap8eLFquPzAFdqLmMQ8i/J EJ8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=K7Il9e4gdvfd5CEL77iu9A6C8SdwX5vWI0pDwfAhw3g=; b=Ks2kRyzqMcGOemicIwL5IXOgp4D/Tnb0gysaXJifXVYZ1d2OPTzOarhf+gkcditSoP vpPgM19aiX0v4wMz5hYNsIGrA2J+CahtZVjlkEm6wEFo03VDUpXvswCpcRa2jp0aZJiZ B5b15Vjn4NH2T4TZo8kpSIySP7ohn2pAvUaxHDBjjHTJoRcXJP8PE1TBF/DutuEE9kbP tjQ5lugStog1lftwzccTkjwKo+UtPPKjORFCOSbpCMbSD4ZyLZlCgMvwx6I1qnxMhtR2 LmnQkEzHbtnaldQlg8hrRL1xXoRwDP00APP/hWMASJKYRg6Dh3bnMzU/U8qX9EkdUXVF iHgA== X-Gm-Message-State: AMCzsaXW+kZhRqiYtfczUGTWV1eNfxAeNbWOhNeiPz6yXCQuEobOfAcn lXwZjcWK8NFztUcCW1+3a00= X-Google-Smtp-Source: ABhQp+TkumlCxOVnd/zjCPfq1UfQEgM0AXblqhpRRoosd2gMcekzkMZJVwU9DdALQsR0oOKmM5NODg== X-Received: by 10.55.127.66 with SMTP id a63mr9641332qkd.90.1508199269088; Mon, 16 Oct 2017 17:14:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , Thomas Huth , Markus Armbruster , Paolo Bonzini , "Michael S. Tsirkin" , Aurelien Jarno , Yongbok Kim , Richard Henderson , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , David Gibson , Alexander Graf , Mark Cave-Ayland , Artyom Tarasenko , Michael Tokarev , Eduardo Otubo , Eduardo Habkost Date: Mon, 16 Oct 2017 21:12:08 -0300 Message-Id: <20171017001209.32276-39-f4bug@amsat.org> X-Mailer: git-send-email 2.15.0.rc0 In-Reply-To: <20171017001209.32276-1-f4bug@amsat.org> References: <20171017001209.32276-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::244 Subject: [Qemu-devel] [PATCH v2 38/39] hw/dma/i82374: avoid multiple creations on the same ISA bus 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: qemu-trivial@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 $ ./ppc64-softmmu/qemu-system-ppc64 -S -machine 40p,accel=3Dtcg -device i82= 374 qemu-system-ppc64: -device i82374: DMA already initialized on ISA bus Reported-by: Eduardo Otubo Suggested-by: Eduardo Habkost Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/i82374.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index 6c0f975df0..280e64f0fa 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -23,6 +23,7 @@ */ =20 #include "qemu/osdep.h" +#include "qapi/error.h" #include "hw/isa/isa.h" =20 #define TYPE_I82374 "i82374" @@ -117,13 +118,19 @@ static const MemoryRegionPortio i82374_portio_list[] = =3D { static void i82374_realize(DeviceState *dev, Error **errp) { I82374State *s =3D I82374(dev); + ISABus *isa_bus =3D isa_bus_from_device(ISA_DEVICE(dev)); + + if (isa_bus->dma[0] || isa_bus->dma[1]) { + error_setg(errp, "DMA already initialized on ISA bus"); + return; + } =20 portio_list_init(&s->port_list, OBJECT(s), i82374_portio_list, s, "i82374"); portio_list_add(&s->port_list, isa_address_space_io(&s->parent_obj), s->iobase); =20 - DMA_init(isa_bus_from_device(ISA_DEVICE(dev)), 1); + DMA_init(isa_bus, 1); memset(s->commands, 0, sizeof(s->commands)); } =20 --=20 2.15.0.rc0