From nobody Tue Nov 26 11:42:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1707824708; cv=none; d=zohomail.com; s=zohoarc; b=d0k4Xku6Rb7hphzKYHt5rcR24k7m1ow+5BU4KpQ8yYp8daRzDmKonVpei+2fidQWmg09g8ohmKpInUA4Aj+CykLjh66oNHNPhKJAPhJ2GWgqHYMcKWeLdM83yNIQD2mQXuKc+2ucwU8IIYxfXIbLNBQT2S7z+T9x1FdB7CiWzOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1707824708; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=G783pUtF6PYcylGtlwwKm9w5JZFbsrO0otjVXSR7Tcw=; b=HfNzLr4IBfjay4r/aTu3lj2lMh9MrjJqcQILJ70vYtHLAvK0niqMBQ4zkdj877gTJWUYRIYVm8DlUdPuBQDt7ibSCzXF8gBLH4GNI5VDYZsx1x93VIhYarjDOlVVEHlLeRn5DzyOXOdJL3JV2cI8uPHydrjXCIngjlCtuksIU9k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1707824708520639.0496506885097; Tue, 13 Feb 2024 03:45:08 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZrDH-0002Wz-9P; Tue, 13 Feb 2024 06:44:35 -0500 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 1rZrDF-0002WQ-MG for qemu-devel@nongnu.org; Tue, 13 Feb 2024 06:44:33 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rZrDD-0005jn-0o for qemu-devel@nongnu.org; Tue, 13 Feb 2024 06:44:33 -0500 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-410ee8ed659so11953675e9.2 for ; Tue, 13 Feb 2024 03:44:30 -0800 (PST) Received: from m1x-phil.lan ([176.176.128.243]) by smtp.gmail.com with ESMTPSA id fs20-20020a05600c3f9400b00410232ffb2csm11538718wmb.25.2024.02.13.03.44.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Feb 2024 03:44:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707824669; x=1708429469; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=G783pUtF6PYcylGtlwwKm9w5JZFbsrO0otjVXSR7Tcw=; b=N4RRqXNfY5drqQupJcFCyuj/kZFjVpLtbjxqr0XnH3h1grQWL+lcdOyPZDZZxrEUoF vWPcthhQvJt98mANevEs+7hvkoBGEliTcw4OU8b0LRNMq/x+cLS2vArHGLKOeX4tM1HM mM0dDvWCySWYffVpGVT4MLM7WU5t7Tj+BAgwEwjhkZFdma3UE0HV2IupXbe4vhgE4ZHy mJ6p8V+MF0tqCK3qDU8jba3bcJ0rXm7WrwQnvzk2bCAgz4lPtvgnX6sN8tOcR6Wyzgjk xaNKnjGwMYdofh7pOyrKLvdkoCgL2iXTOcSKDR7MzPlY8yfBn8kgqegUzNBt7mOpG5lE 6vyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707824669; x=1708429469; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=G783pUtF6PYcylGtlwwKm9w5JZFbsrO0otjVXSR7Tcw=; b=l//qsZJWc7AC+YzObghb/04sTLu+F4dNzKr6gp+xB4Z57i9V9Ld+AfJwjvdei9eG6n aBtcw1r3GYDi7zYKtAtAWumsgY9JAPALDMrMf3F4R7FuusbcqxqT8hP6gPXzGCVs0rId z3PzrfhKtq9ZV0kLmIpbUvN3O7j7RGcqgFpAH5LOo3QRi4wsvJqHbjOpp4zgiSmQKohn NOyzSVqY8Ur1dG3nJvoEexErNQjId1GjYuxda7Z4EEOYuS28bXp2ba4Wr105Y9lOv3V3 V/0YoMf6aYRhxakg2QBaE+QbMZ3BYkbCllODrKgeCKMlMemKlnhOz+k93kMdwiESXWz6 aSNQ== X-Gm-Message-State: AOJu0YzrYKR4f4tWRAaimCwDmoeQu/zPplMWiBPzIDt8qJWqB2FaDna5 ABwNwB3V0eaaUlLot4GSHDsyR0fgGTJ7qrpLt2DFle89mn23aRj/4f/jqkMZFc+oN5vM5WPWy5Y 4 X-Google-Smtp-Source: AGHT+IHs5RqWxEJz/+jl2sbK1985goHPPVnxZL9npjAR2jtrcQ9dFlkQicXKXZKAtN1Hi/3WItxn7g== X-Received: by 2002:a05:600c:a4b:b0:410:6591:3d5d with SMTP id c11-20020a05600c0a4b00b0041065913d5dmr7219075wmq.14.1707824668980; Tue, 13 Feb 2024 03:44:28 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU/T1mhVIRRFGdTce3pcwvCX+fsTmbdvty3gboMDFlX8yLGC+fmUuKZUG7nbFO1KDJGVQb+1PsIdPDtvQ8agOXPjoOKRojVXDtszONFVJlMT7pn1ZxS7E/GW6ICQdoajQe9b2UpUHyRpjTborcw160cuTvSQzAkAhHJ0iiSPb9LtHid8cfz7wW2dBbmB17aRtC7Zd5ZpOGsgglcysWfSq2Yp9rEDNjlb7nRdqDzhutEn2BPHynmu4WtXTgGrfzhhYGeclT99fjaz/jTgGxGz8QW6HKjcj/8dTtvvsbm1PZeemR/xd5cBp8cZX8eVAWJGbz1bI+4KTghxNkGszz9afj9LqIcWZvFhV4SUf7AhY7PqYqnQz8uSvPN3YczOw8uNTOPh2YOQ577Ie6ztzEvBV+Fk/uvPhB1JFEihA+GgycjE9ivjowXbZM= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan , Marcel Apfelbaum , Aleksandar Rikalo , Jiaxun Yang , Aurelien Jarno , Eduardo Habkost , "Michael S. Tsirkin" , Richard Henderson , qemu-ppc@nongnu.org, qemu-trivial@nongnu.org, =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Paolo Bonzini Subject: [PATCH] hw/dma: Pass parent object to i8257_dma_init() Date: Tue, 13 Feb 2024 12:44:25 +0100 Message-ID: <20240213114426.87836-1-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 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=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com 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, 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_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1707824711251100003 Set I8257 instances parent (migration isn't affected). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson --- include/hw/dma/i8257.h | 2 +- hw/dma/i82374.c | 2 +- hw/dma/i8257.c | 4 +++- hw/i386/pc_piix.c | 2 +- hw/isa/lpc_ich9.c | 2 +- hw/isa/piix.c | 2 +- hw/isa/vt82c686.c | 2 +- hw/mips/jazz.c | 2 +- 8 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/hw/dma/i8257.h b/include/hw/dma/i8257.h index f652345d65..4342e4a91e 100644 --- a/include/hw/dma/i8257.h +++ b/include/hw/dma/i8257.h @@ -45,6 +45,6 @@ struct I8257State { PortioList portio_pageh; }; =20 -void i8257_dma_init(ISABus *bus, bool high_page_enable); +void i8257_dma_init(Object *parent, ISABus *bus, bool high_page_enable); =20 #endif diff --git a/hw/dma/i82374.c b/hw/dma/i82374.c index f6ddfc51c5..e72aa2e1ce 100644 --- a/hw/dma/i82374.c +++ b/hw/dma/i82374.c @@ -129,7 +129,7 @@ static void i82374_realize(DeviceState *dev, Error **er= rp) error_setg(errp, "DMA already initialized on ISA bus"); return; } - i8257_dma_init(isa_bus, true); + i8257_dma_init(OBJECT(dev), isa_bus, true); =20 portio_list_init(&s->port_list, OBJECT(s), i82374_portio_list, s, "i82374"); diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c index de1d5b110c..24a54ca272 100644 --- a/hw/dma/i8257.c +++ b/hw/dma/i8257.c @@ -632,12 +632,13 @@ static void i8257_register_types(void) =20 type_init(i8257_register_types) =20 -void i8257_dma_init(ISABus *bus, bool high_page_enable) +void i8257_dma_init(Object *parent, ISABus *bus, bool high_page_enable) { ISADevice *isa1, *isa2; DeviceState *d; =20 isa1 =3D isa_new(TYPE_I8257); + object_property_add_child(parent, "dma[*]", OBJECT(isa1)); d =3D DEVICE(isa1); qdev_prop_set_int32(d, "base", 0x00); qdev_prop_set_int32(d, "page-base", 0x80); @@ -646,6 +647,7 @@ void i8257_dma_init(ISABus *bus, bool high_page_enable) isa_realize_and_unref(isa1, bus, &error_fatal); =20 isa2 =3D isa_new(TYPE_I8257); + object_property_add_child(parent, "dma[*]", OBJECT(isa2)); d =3D DEVICE(isa2); qdev_prop_set_int32(d, "base", 0xc0); qdev_prop_set_int32(d, "page-base", 0x88); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 70d12bb1b5..999b7b806c 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -310,7 +310,7 @@ static void pc_init1(MachineState *machine, qdev_prop_set_int32(DEVICE(rtc_state), "base_year", 2000); isa_realize_and_unref(rtc_state, isa_bus, &error_fatal); =20 - i8257_dma_init(isa_bus, 0); + i8257_dma_init(OBJECT(machine), isa_bus, 0); pcms->hpet_enabled =3D false; idebus[0] =3D NULL; idebus[1] =3D NULL; diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c index 3924eec483..70c6e8a093 100644 --- a/hw/isa/lpc_ich9.c +++ b/hw/isa/lpc_ich9.c @@ -739,7 +739,7 @@ static void ich9_lpc_realize(PCIDevice *d, Error **errp) =20 isa_bus_register_input_irqs(isa_bus, lpc->gsi); =20 - i8257_dma_init(isa_bus, 0); + i8257_dma_init(OBJECT(d), isa_bus, 0); =20 /* RTC */ qdev_prop_set_int32(DEVICE(&lpc->rtc), "base_year", 2000); diff --git a/hw/isa/piix.c b/hw/isa/piix.c index 344bf32e54..2d30711b17 100644 --- a/hw/isa/piix.c +++ b/hw/isa/piix.c @@ -336,7 +336,7 @@ static void pci_piix_realize(PCIDevice *dev, const char= *uhci_type, i8254_pit_init(isa_bus, 0x40, 0, NULL); } =20 - i8257_dma_init(isa_bus, 0); + i8257_dma_init(OBJECT(dev), isa_bus, 0); =20 /* RTC */ qdev_prop_set_int32(DEVICE(&d->rtc), "base_year", 2000); diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index d3e0f6d01f..3622a530d2 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -686,7 +686,7 @@ static void via_isa_realize(PCIDevice *d, Error **errp) s->isa_irqs_in =3D i8259_init(isa_bus, *isa_irq); isa_bus_register_input_irqs(isa_bus, s->isa_irqs_in); i8254_pit_init(isa_bus, 0x40, 0, NULL); - i8257_dma_init(isa_bus, 0); + i8257_dma_init(OBJECT(d), isa_bus, 0); =20 /* RTC */ qdev_prop_set_int32(DEVICE(&s->rtc), "base_year", 2000); diff --git a/hw/mips/jazz.c b/hw/mips/jazz.c index 5bf3e328db..1bc17e69d3 100644 --- a/hw/mips/jazz.c +++ b/hw/mips/jazz.c @@ -289,7 +289,7 @@ static void mips_jazz_init(MachineState *machine, /* ISA devices */ i8259 =3D i8259_init(isa_bus, env->irq[4]); isa_bus_register_input_irqs(isa_bus, i8259); - i8257_dma_init(isa_bus, 0); + i8257_dma_init(OBJECT(rc4030), isa_bus, 0); pit =3D i8254_pit_init(isa_bus, 0x40, 0, NULL); pcspk =3D isa_new(TYPE_PC_SPEAKER); object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), &error_fat= al); --=20 2.41.0