From patchwork Thu Feb 15 17:57:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 772979 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp967288wre; Thu, 15 Feb 2024 10:05:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWisnxM17PAwdPNfZ8aZk7y8SBwIdEDyXo5znChRx53F9OGWVNqxVN4zSt7wxXtRJLJdtXzmF+AEUG9HG4dlGyB X-Google-Smtp-Source: AGHT+IH0BZBIDU7iNBNMpl1+rMadxOKPvOWBBMvzKzrY/N9yDdjSUWd2T59/yIk5/HsQpZrOWbd3 X-Received: by 2002:a05:6870:b50c:b0:21d:ecb8:f736 with SMTP id v12-20020a056870b50c00b0021decb8f736mr3002203oap.53.1708020336602; Thu, 15 Feb 2024 10:05:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708020336; cv=none; d=google.com; s=arc-20160816; b=JVkyoehHg5ikO1N83afiJ+NssYxPSrDbAUm52F7TSYk+d/xzZbNDvi9U9pt1xHhvmH /7ivNT5VFGatlCIexEetNUcxiVRPj9IkQwbCB90BDQ/an/zhf2ve2jpfE96+o/jJ7h5t XtcUMUjinnvjpn1nK0/EbjP2SokXN+MyPJd0YNBX17rVot/e4Evem8K5YWFy4ARvJeHZ OunVJvn/NWMC3ePDNgR9Gjz1YFCR/pasqDE4lKDeg5UqnN+Mj2vFkx/8b/Mpwgq87ec+ bNRvCbAXz8YK4/vChu9AtGjf87D0gO9qSzTY/maB1GzBU4KELElzG2MtAUMbrS6tp9xG txpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+ubSQX0s8XFIX39hOsqAJ21CHgufQEziwezWtT3SVxQ=; fh=YcA2VX68AXMHcMyDit5iEY5OAWPf/DfOFrzFQtRXLAk=; b=aTpuYIZbZnhcsJCzqXEhDi5oKKyUtLvH6ErP+sH7qQGy4EToONfLoS+pN0XY+l2t8R qhBLZz7Euy2r+ql0U5nrhTCzU7P9zu/NqMxth9kLjKTm9vS15BLuGSrZBMVeDyB/jdba ujpkj/8o92RpNzmTShDblafK7Sp+gq7FbNr3urO/ZYtXHT2lGU7Oxc0XouWY2znlINeM TkpdESzosNhEywNNIlCFh6CHMgAZRxfQgJjPFY9IIS5PgoN2ciCF3XwN76+2+0JRpZMI rekEMencJ/4ukKAj5s+3jaMytglkiP4mQKmCxhc7dEVL7LpRMlQJK3bMYC66ljTjLeIp HQIg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NdyP/VV2"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i17-20020a0561023d1100b0046d208aa017si402495vsv.677.2024.02.15.10.05.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 15 Feb 2024 10:05:36 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="NdyP/VV2"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rag2s-0002A6-60; Thu, 15 Feb 2024 13:01:14 -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 1rag2b-0001nM-Ha for qemu-devel@nongnu.org; Thu, 15 Feb 2024 13:00:59 -0500 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rag2U-0002MH-K5 for qemu-devel@nongnu.org; Thu, 15 Feb 2024 13:00:57 -0500 Received: by mail-ed1-x52a.google.com with SMTP id 4fb4d7f45d1cf-55a5e7fa471so1614582a12.1 for ; Thu, 15 Feb 2024 10:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708020048; x=1708624848; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+ubSQX0s8XFIX39hOsqAJ21CHgufQEziwezWtT3SVxQ=; b=NdyP/VV2u7egJYv8FmmbmbmB/X2HN2b4XDxhpCaag+Ng0hsxouIBLxagswdFXToxou 8lkDyt0/VDgzfC2EaUSj0pflzkirbaBG+9HHiP5gtyPvZMdZtuLA62TvR0HidW0/o1CT gEbL7IggrmXab2/mEN7sj6QEx/D8sHOcmRNwnq6SzfxGLOOL9BtTQJdZt5V9PNpD+VCA OkmrgyDqjtFwKiUgjHeuvnyuvy99wfl+JWA2UJ3negeU6PywE8pxlJDZUMPisVDs8klI +3PcH9PrHJNluQgUeJ31IuJgWAJJ/kOauU1m+WRvSpRZPbTOmtqVvIdOkULTwRYz3AeK 3ppQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708020048; x=1708624848; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+ubSQX0s8XFIX39hOsqAJ21CHgufQEziwezWtT3SVxQ=; b=jGmr4hDf8BYgAVUeXgrGNVY6KUsyaRJ2908Lv86dt96vxlpNRk5GTAgjLGfpPn7GpD OqHXgKd3negThsf+3FaKiiNRbc4QBomSj469NeiSSZ1DbuWXDo4TPSOpthUIDRxwFs2i DXHRFiQdUQ5vFjGw2O9eFMYAZPhamDstcPUE97n5lauxuIYaC3YYVhqvEk3V20Ce7RBy Wo8s1OqHObQs7ONhTq4On7rfkmMFtOfgZlzuHDjgjb6Ox5UDvRQQi8WdAawltzeFjZ7Y wEJ5Q6tpp0U+q1TTurtna/E1hJicU+Z7yUO4eHyk/ZFaxLVfQrbBAwwCE/CuKEXieZQl MD6w== X-Gm-Message-State: AOJu0YweE+IPV6UlwQl6SCQjPer/0GE9q4Z0JpzrzB/Ns180xc2sci83 kSg0Vt3W7Ak9Qc8uSM3a7atg5vY7RUPfSOKRNfxjCc8c4WzU8LzJQfhMJCYIyGrvFsiHevBwsfN G2aU= X-Received: by 2002:aa7:d38e:0:b0:562:f25:b125 with SMTP id x14-20020aa7d38e000000b005620f25b125mr1825343edq.36.1708020048674; Thu, 15 Feb 2024 10:00:48 -0800 (PST) Received: from m1x-phil.lan ([176.187.193.50]) by smtp.gmail.com with ESMTPSA id fg8-20020a056402548800b00562ee409ea0sm740914edb.62.2024.02.15.10.00.46 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 15 Feb 2024 10:00:48 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, qemu-arm@nongnu.org, qemu-block@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Richard Henderson , =?utf-8?q?Herv=C3=A9_Pous?= =?utf-8?q?sineau?= , "Michael S. Tsirkin" , Paolo Bonzini , Eduardo Habkost , Marcel Apfelbaum , Aurelien Jarno , BALATON Zoltan , Jiaxun Yang , Aleksandar Rikalo Subject: [PULL 26/56] hw/dma: Pass parent object to i8257_dma_init() Date: Thu, 15 Feb 2024 18:57:20 +0100 Message-ID: <20240215175752.82828-27-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240215175752.82828-1-philmd@linaro.org> References: <20240215175752.82828-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=philmd@linaro.org; helo=mail-ed1-x52a.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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Set I8257 instances parent (migration isn't affected). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240213114426.87836-1-philmd@linaro.org> --- 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; }; -void i8257_dma_init(ISABus *bus, bool high_page_enable); +void i8257_dma_init(Object *parent, ISABus *bus, bool high_page_enable); #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 **errp) error_setg(errp, "DMA already initialized on ISA bus"); return; } - i8257_dma_init(isa_bus, true); + i8257_dma_init(OBJECT(dev), isa_bus, true); 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) type_init(i8257_register_types) -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; isa1 = isa_new(TYPE_I8257); + object_property_add_child(parent, "dma[*]", OBJECT(isa1)); d = 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); isa2 = isa_new(TYPE_I8257); + object_property_add_child(parent, "dma[*]", OBJECT(isa2)); d = 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); - i8257_dma_init(isa_bus, 0); + i8257_dma_init(OBJECT(machine), isa_bus, 0); pcms->hpet_enabled = false; idebus[0] = NULL; idebus[1] = 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) isa_bus_register_input_irqs(isa_bus, lpc->gsi); - i8257_dma_init(isa_bus, 0); + i8257_dma_init(OBJECT(d), isa_bus, 0); /* 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); } - i8257_dma_init(isa_bus, 0); + i8257_dma_init(OBJECT(dev), isa_bus, 0); /* RTC */ qdev_prop_set_int32(DEVICE(&d->rtc), "base_year", 2000); diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c index 0c504de36e..aa91942745 100644 --- a/hw/isa/vt82c686.c +++ b/hw/isa/vt82c686.c @@ -731,7 +731,7 @@ static void via_isa_realize(PCIDevice *d, Error **errp) s->isa_irqs_in = 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); /* 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 = 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 = i8254_pit_init(isa_bus, 0x40, 0, NULL); pcspk = isa_new(TYPE_PC_SPEAKER); object_property_set_link(OBJECT(pcspk), "pit", OBJECT(pit), &error_fatal);