From nobody Fri Nov 14 20:27:39 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=1590663991; cv=none; d=zohomail.com; s=zohoarc; b=XuI7uhskbeXqQU40UFnS1K4jAr69h7Sx5MS65tOahf/QM61DPTZtrELlb9LDYlyQ+OUdbM/NggDf+eXCrH6YhE4pPK6C/ats3WMp+UHWsVl1gY/RyYo8LxBOri6cUlz+Hcme3dp/zgTYg0rYze3m8LFcMiXRccEOKtAxGJkMgOo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590663991; 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=UVcKLeFWj0VSeKdG4aLNUd6u+7CARzd27MuFmScMnPw=; b=kYf+RkzhPjOcKNvdJfpBFViNGc4Mtqs2UPEY2xROYajrbvbbXsKTK9v3G+ATR3qQCHesPSer//gZpBTDaQtXHSBphM7DZ6zTFHbCLS2aJO3ePRt+gxUnlCGGby5XC/6nZQ8DWGVVqtjSeVJn0JTXNpkP6m2CGqI0Fv+CUOmmOuM= 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 15906639911291016.1837832084562; Thu, 28 May 2020 04:06:31 -0700 (PDT) Received: from localhost ([::1]:59730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGMn-0007b5-Pp for importer@patchew.org; Thu, 28 May 2020 07:06:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLF-0005gO-84 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:53 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:55560 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 1jeGLC-0006bx-BO for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:52 -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-432-wc5HpOncM9O1XGX0j_sLaA-1; Thu, 28 May 2020 07:04:47 -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 6B51D107ACCD; Thu, 28 May 2020 11:04:46 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3919019D71; Thu, 28 May 2020 11:04:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id B78C811386A0; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663889; 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=UVcKLeFWj0VSeKdG4aLNUd6u+7CARzd27MuFmScMnPw=; b=f6zcUv/unXJ+QQjuzx5QVlmvtqb96MPqXQwEbwnCsrScb4f7Xh6wO02xZuXXeMA6P8ruSq sNFVuoh9hpRzOuFFEkSdfMidUxrsxJvrJDdjWxQO/R0qhdjlvwVSD6eAY9weDQboM6u/M2 qA/JkS0rkwkdyiudmdmwUv/Sne2n0XE= X-MC-Unique: wc5HpOncM9O1XGX0j_sLaA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 01/24] arm/stm32f405: Fix realization of "stm32f2xx-adc" devices Date: Thu, 28 May 2020 13:04:21 +0200 Message-Id: <20200528110444.20456-2-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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.61; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 06:31:20 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, 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: Peter Maydell , berrange@redhat.com, ehabkost@redhat.com, Alistair Francis , qemu-arm@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" stm32f405_soc_initfn() creates six such devices, but stm32f405_soc_realize() realizes only one. Affects machine netduinoplus2. In theory, a device becomes real only on realize. In practice, the transition from unreal to real is a fuzzy one. The work to make a device real can be spread between realize methods (fine), instance_init methods (wrong), and board code wiring up the device (fine as long as it effectively happens on realize). Depending on what exactly is done where, a device can work even when we neglect to realize it. The five unrealized devices appear to stay unreal: neither MMIO nor IRQ get wired up. Fix stm32f405_soc_realize() to realize and wire up all six. Visible in "info qtree": bus: main-system-bus type System dev: stm32f405-soc, id "" cpu-type =3D "cortex-m4-arm-cpu" dev: stm32f2xx-adc, id "" gpio-out "sysbus-irq" 1 - mmio ffffffffffffffff/00000000000000ff + mmio 0000000040012000/00000000000000ff dev: stm32f2xx-adc, id "" gpio-out "sysbus-irq" 1 - mmio ffffffffffffffff/00000000000000ff + mmio 0000000040012100/00000000000000ff dev: stm32f2xx-adc, id "" gpio-out "sysbus-irq" 1 - mmio ffffffffffffffff/00000000000000ff + mmio 0000000040012200/00000000000000ff dev: stm32f2xx-adc, id "" gpio-out "sysbus-irq" 1 - mmio ffffffffffffffff/00000000000000ff + mmio 0000000040012300/00000000000000ff dev: stm32f2xx-adc, id "" gpio-out "sysbus-irq" 1 - mmio 0000000040012000/00000000000000ff + mmio 0000000040012400/00000000000000ff dev: stm32f2xx-adc, id "" gpio-out "sysbus-irq" 1 - mmio ffffffffffffffff/00000000000000ff + mmio 0000000040012500/00000000000000ff dev: armv7m, id "" Fixes: 529fc5fd3e18ace8f739afd02dc0953354f39442 Cc: Alistair Francis Cc: Peter Maydell Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/stm32f405_soc.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/arm/stm32f405_soc.c b/hw/arm/stm32f405_soc.c index 4f10ce6176..c9a530eecf 100644 --- a/hw/arm/stm32f405_soc.c +++ b/hw/arm/stm32f405_soc.c @@ -37,7 +37,8 @@ static const uint32_t usart_addr[] =3D { 0x40011000, 0x40= 004400, 0x40004800, /* At the moment only Timer 2 to 5 are modelled */ static const uint32_t timer_addr[] =3D { 0x40000000, 0x40000400, 0x40000800, 0x40000C00 }; -#define ADC_ADDR 0x40012000 +static const uint32_t adc_addr[] =3D { 0x40012000, 0x40012100, 0x40012200, + 0x40012300, 0x40012400, 0x40012500 }; static const uint32_t spi_addr[] =3D { 0x40013000, 0x40003800, 0x40003C0= 0, 0x40013400, 0x40015000, 0x40015400 = }; #define EXTI_ADDR 0x40013C00 @@ -185,16 +186,18 @@ static void stm32f405_soc_realize(DeviceState *dev_so= c, Error **errp) qdev_connect_gpio_out(DEVICE(&s->adc_irqs), 0, qdev_get_gpio_in(armv7m, ADC_IRQ)); =20 - dev =3D DEVICE(&(s->adc[i])); - object_property_set_bool(OBJECT(&s->adc[i]), true, "realized", &err); - if (err !=3D NULL) { - error_propagate(errp, err); - return; + for (i =3D 0; i < STM_NUM_ADCS; i++) { + dev =3D DEVICE(&(s->adc[i])); + object_property_set_bool(OBJECT(&s->adc[i]), true, "realized", &er= r); + if (err !=3D NULL) { + error_propagate(errp, err); + return; + } + busdev =3D SYS_BUS_DEVICE(dev); + sysbus_mmio_map(busdev, 0, adc_addr[i]); + sysbus_connect_irq(busdev, 0, + qdev_get_gpio_in(DEVICE(&s->adc_irqs), i)); } - busdev =3D SYS_BUS_DEVICE(dev); - sysbus_mmio_map(busdev, 0, ADC_ADDR); - sysbus_connect_irq(busdev, 0, - qdev_get_gpio_in(DEVICE(&s->adc_irqs), i)); =20 /* SPI devices */ for (i =3D 0; i < STM_NUM_SPIS; i++) { --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590663996; cv=none; d=zohomail.com; s=zohoarc; b=OhyUVi/PS2+O4RrO+9iKtZMh59j+WJjFOaz3RBOmSFcijTC8+X4/gYBi10DmklfvseVaE6zhZcLx+EGRE3sq5So4lijMsz7zo8GoVTQ55ZZU73sW+TqTRX+QctDM1S42YIE+xCv9LbDAatMK4knlz5A+VaZiTLy1eiQGfuQQgEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590663996; 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=pF5xuhSu7N48wGad8zUSYAG+GWm/0fg9fso5kGdrpCg=; b=E/qCcNYJAcSmjon/cMfV0PFdzYgF7wnhDMJfNbncXOgRIkRrVW1Vd8qjA4iP6hC7QVIsLHpon2OUZsbtj1YkhwMhW7/mfmrUnu2m5g7DC1Ycun6btXJFSsKwtVIvR0NX1EyLCDMkqa890s9KB2UPaSajSsCuuaQ7Zcl8KQ8m+jA= 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 1590663996771191.19506960923343; Thu, 28 May 2020 04:06:36 -0700 (PDT) Received: from localhost ([::1]:60490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGMt-0007tI-HX for importer@patchew.org; Thu, 28 May 2020 07:06:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLE-0005fo-LY for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:52 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:28200 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 1jeGLC-0006cA-BN for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:52 -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-167-w1YPp1TZOt2UySDzdCjE_A-1; Thu, 28 May 2020 07:04:48 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AC6AB835B41; Thu, 28 May 2020 11:04:46 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 392AF7A8AA; Thu, 28 May 2020 11:04:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BB61B11386A3; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663889; 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=pF5xuhSu7N48wGad8zUSYAG+GWm/0fg9fso5kGdrpCg=; b=g8gOSdU3gFeHSH/W3byE236MRlX4B29FfkpRRjkFUcNIglr9DIj30pCoEZDV/qfvkyTmHh S887uZpRx9oGqcMFWBNo34dDtSUDHqy3h3S7JAamKyzQ+TeMHkiLzfcVoxLzu2UW/RnxTJ KWUdC7gTQRBVZ8Jh8A6kNfa4UfJcm/Y= X-MC-Unique: w1YPp1TZOt2UySDzdCjE_A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 02/24] display/xlnx_dp: Fix to realize "i2c-ddc" and "aux-to-i2c-bridge" Date: Thu, 28 May 2020 13:04:22 +0200 Message-Id: <20200528110444.20456-3-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 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, 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: "Edgar E . Iglesias" , Peter Maydell , berrange@redhat.com, ehabkost@redhat.com, Alistair Francis , qemu-arm@nongnu.org, Alistair Francis , pbonzini@redhat.com, "Edgar E. Iglesias" , KONRAD Frederic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" xlnx_dp_init() creates these two devices, but they're never realized. Affects machine xlnx-zcu102. In theory, a device becomes real only on realize. In practice, the transition from unreal to real is a fuzzy one. The work to make a device real can be spread between realize methods (fine), instance_init methods (wrong), and board code wiring up the device (fine as long as it effectively happens on realize). Depending on what exactly is done where, a device can work even when we neglect to realize it. These two appear to work. Nevertheless, it's a clear misuse of the interface. Even when it works today (more or less by chance), it can break tomorrow. Fix by realizing them in xlnx_dp_realize(). Fixes: 58ac482a66de09a7590f705e53fc6a3fb8a055e8 Cc: KONRAD Frederic Cc: Alistair Francis Cc: "Edgar E. Iglesias" Cc: Peter Maydell Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Edgar E. Iglesias Reviewed-by: Alistair Francis --- hw/display/xlnx_dp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c index 3e5fb44e06..bdc229a51e 100644 --- a/hw/display/xlnx_dp.c +++ b/hw/display/xlnx_dp.c @@ -1264,9 +1264,13 @@ static void xlnx_dp_realize(DeviceState *dev, Error = **errp) DisplaySurface *surface; struct audsettings as; =20 + qdev_init_nofail(DEVICE(s->aux_bus->bridge)); + qdev_init_nofail(DEVICE(s->dpcd)); aux_map_slave(AUX_SLAVE(s->dpcd), 0x0000); =20 + qdev_init_nofail(DEVICE(s->edid)); + s->console =3D graphic_console_init(dev, 0, &xlnx_dp_gfx_ops, s); surface =3D qemu_console_surface(s->console); xlnx_dpdma_set_host_data_location(s->dpdma, DP_GRAPHIC_DMA_CHANNEL, --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664089; cv=none; d=zohomail.com; s=zohoarc; b=N/jzAOj3c61mmAi/b4WNIRqr+BMMWilUhaTMra68g/Itk5VGpcMXUKEUkLgWHnIP7rkI+JU0AiX9yBOgsoeZUxCUVGFpCXxNVgWE9sYXMG0tDvB178Svrpfpq72PArNun9r3vFoFhvRQtJspMld+ZhUi650iuiUZ3RwYPkzppmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664089; 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=2E4+O8kSZsRLRCJx59FBHd9L5O/+DjWOjDBKmC0wQ4s=; b=NwLbqj1PyAyOJAoTM+TFIquoJkwjLa+046dSzqt7LaNxYkiKHl2v1Ab685QJ0Y0ATekaJCC4NuG4PTK2mT2IvYymczHGADg9lbIQKCSllExCnS72sDaU+UWUTgFtC+4W0DYoAZm8SMcBy08BAKuowpFgA3BHwm8Tr3MDMW69Z1Y= 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 1590664089582501.2113039382907; Thu, 28 May 2020 04:08:09 -0700 (PDT) Received: from localhost ([::1]:40128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGOO-00032h-5v for importer@patchew.org; Thu, 28 May 2020 07:08:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLH-0005lm-MG for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:32490 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 1jeGLE-0006fS-Ai for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:55 -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-434-oUKh0RJsOMic5Oqf_14szA-1; Thu, 28 May 2020 07:04:47 -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 6B42A1005510; Thu, 28 May 2020 11:04:46 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 38E3E5C1B0; Thu, 28 May 2020 11:04:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id BEEE211385E2; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663891; 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=2E4+O8kSZsRLRCJx59FBHd9L5O/+DjWOjDBKmC0wQ4s=; b=brAja61Q9TsH081UD8Je3vinyQltF43t0DBYgRDAOiXEz+lnj6hi4ekgjzDPU5Rb9SweOI MQlX/aAxbqGGkXPUzuoB8lPdJlYjjdDZcnfDey8ZaEkuEjS7MKe8+BRZTOSyme+gr1au9k +ZL/zR0ttV4fCOAXrEGKtGYPXJ3FMZ4= X-MC-Unique: oUKh0RJsOMic5Oqf_14szA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 03/24] sd/pxa2xx_mmci: Fix to realize "pxa2xx-mmci" device Date: Thu, 28 May 2020 13:04:23 +0200 Message-Id: <20200528110444.20456-4-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@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-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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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: Peter Maydell , berrange@redhat.com, ehabkost@redhat.com, qemu-arm@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" pxa2xx_mmci_init() creates a "pxa2xx-mmci" device, but neglects to realize it. Affects machines akita, borzoi, connex, mainstone, spitz, terrier, tosa, verdex, and z2. In theory, a device becomes real only on realize. In practice, the transition from unreal to real is a fuzzy one. The work to make a device real can be spread between realize methods (fine), instance_init methods (wrong), and board code wiring up the device (fine as long as it effectively happens on realize). Depending on what exactly is done where, a device can work even when we neglect to realize it. This one appears to work. Nevertheless, it's a clear misuse of the interface. Even when it works today (more or less by chance), it can break tomorrow. Fix by realizing it right away. Visible in "info qom-tree"; here's the change for akita: /machine (akita-machine) [...] /unattached (container) [...] + /device[5] (pxa2xx-mmci) + /pxa2xx-mmci[0] (qemu:memory-region) + /sd-bus (pxa2xx-mmci-bus) [rest of device[*] renumbered...] Fixes: 7a9468c92517e19037bfe2272f64f5dadaf9db15 Cc: Andrzej Zaborowski Cc: Peter Maydell Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/sd/pxa2xx_mmci.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/sd/pxa2xx_mmci.c b/hw/sd/pxa2xx_mmci.c index f9c50ddda5..c32df1b8f9 100644 --- a/hw/sd/pxa2xx_mmci.c +++ b/hw/sd/pxa2xx_mmci.c @@ -492,6 +492,7 @@ PXA2xxMMCIState *pxa2xx_mmci_init(MemoryRegion *sysmem, sysbus_connect_irq(sbd, 0, irq); qdev_connect_gpio_out_named(dev, "rx-dma", 0, rx_dma); qdev_connect_gpio_out_named(dev, "tx-dma", 0, tx_dma); + qdev_init_nofail(dev); =20 /* Create and plug in the sd card */ carddev =3D qdev_create(qdev_get_child_bus(dev, "sd-bus"), TYPE_SD_CAR= D); --=20 2.21.3 From nobody Fri Nov 14 20:27:39 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590664683; cv=none; d=zohomail.com; s=zohoarc; b=K5GuqL8TXRqIq57o7/RNPe43slEkqFWeWlagZloF2FylHdZo2/ujI6y6p+tvc0LFGb/Aeyrwk9qgp34BZNdnMExoRQDm25wKMXtn7PnUyXWdc4GSWrgiT4JSNLUQ+MntqI+BNqpBjk1w82cX5CPzaPGIElS3+vR9I2sAFWIoD1c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664683; 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=Rj45n46WUCAqRh7Zlf2j8Mdh4o2jliFJ8nTamCOHIks=; b=n1ll4Pfgqv3a0JewVmI0ZFpMj3MgwSD84gkUbRq+bRLZpHTzbsRCBo8SMTy/rTRPjrVFNyjXHS3xLTeqBbdnYyWyp8Vpzol47nGeNbcf6/Rfd13lgNiy+KZDHDMT660qS2R/BJi1drZk0JHYNcDFgu/iySHld+5T+TYPlCzzIJ0= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590664683144492.39683880449127; Thu, 28 May 2020 04:18:03 -0700 (PDT) Received: from localhost ([::1]:59106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGXx-0006kE-RQ for importer@patchew.org; Thu, 28 May 2020 07:18:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLU-0005xI-CL for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:10 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:60751 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 1jeGLG-0006lt-Gu for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:08 -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-187-ZuPaI6YyPnaDxO1tHsRwrA-1; Thu, 28 May 2020 07:04:47 -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 BA9048015D2; Thu, 28 May 2020 11:04:46 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3CE851001268; Thu, 28 May 2020 11:04:46 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C25F61138611; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663893; 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=Rj45n46WUCAqRh7Zlf2j8Mdh4o2jliFJ8nTamCOHIks=; b=baIkFSnRgI1DTLn+HU7ph+TF2EVpM8Dav91qpvWQGT2fu7NCbUQpnzPGu6H94YTEdwA8y+ 1mVcLA+oh95Ey6dcK3KPJACIN4q7pAG3SYcmmKqemnrQnJpbUgrGqNOUMZeg88/gfwjLqm 5nk8Pr8DdEJ0EmkamxZDXmRiWh7vEnk= X-MC-Unique: ZuPaI6YyPnaDxO1tHsRwrA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 04/24] arm/aspeed: Compute the number of CPUs from the SoC definition Date: Thu, 28 May 2020 13:04:24 +0200 Message-Id: <20200528110444.20456-5-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@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=207.211.31.81; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 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, 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: pbonzini@redhat.com, berrange@redhat.com, ehabkost@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: C=C3=A9dric Le Goater Commit ece09beec457 ("aspeed: introduce a configurable number of CPU per machine") was a convient change during bringup but the Aspeed SoCs have a fixed number of CPUs : one for the AST2400 and AST2500, and two for the AST2600. When the number of CPUs configured with -smp is less than the SoC's fixed number, the "unconfigured" CPUs are left unrealized. This can happen for machines ast2600-evb and tacoma-bmc, where the SoC's fixed number is 2. To get virtual hardware that matches the physical hardware, you have to pass -smp cpus=3D2 (or its sugared form -smp 2). We normally reject -smp cpus=3DN when N exceeds the machine's limit. Except we ignore cpus=3D2 (and only cpus=3D2) with a warning for machines ast2500-evb, palmetto-bmc, romulus-bmc, sonorapass-bmc, swift-bmc, and witherspoon-bmc. Remove the "num-cpu" property from the SoC state and use the fixed number of CPUs defined in the SoC class instead. Compute the default, min, max number of CPUs of the machine directly from the SoC class definition. Machines ast2600-evb and tacoma-bmc now always get their second CPU as they should. Visible in "info qom-tree"; here's the change for ast2600-evb: /machine (ast2600-evb-machine) /peripheral (container) /peripheral-anon (container) /soc (ast2600-a1) /a7mpcore (a15mpcore_priv) /a15mp-priv-container[0] (qemu:memory-region) /gic (arm_gic) /gic_cpu[0] (qemu:memory-region) /gic_cpu[1] (qemu:memory-region) + /gic_cpu[2] (qemu:memory-region) /gic_dist[0] (qemu:memory-region) /gic_vcpu[0] (qemu:memory-region) /gic_viface[0] (qemu:memory-region) /gic_viface[1] (qemu:memory-region) + /gic_viface[2] (qemu:memory-region) /unnamed-gpio-in[0] (irq) [...] + /unnamed-gpio-in[160] (irq) [same for 161 to 190...] + /unnamed-gpio-in[191] (irq) Also visible in "info qtree"; here's the change for ast2600-evb: bus: main-system-bus type System dev: a15mpcore_priv, id "" gpio-in "" 128 - gpio-out "sysbus-irq" 5 - num-cpu =3D 1 (0x1) + gpio-out "sysbus-irq" 10 + num-cpu =3D 2 (0x2) num-irq =3D 160 (0xa0) mmio 0000000040460000/0000000000008000 dev: arm_gic, id "" - gpio-in "" 160 - num-cpu =3D 1 (0x1) + gpio-in "" 192 + num-cpu =3D 2 (0x2) num-irq =3D 160 (0xa0) revision =3D 2 (0x2) has-security-extensions =3D true has-virtualization-extensions =3D true num-priority-bits =3D 8 (0x8) mmio ffffffffffffffff/0000000000001000 mmio ffffffffffffffff/0000000000002000 mmio ffffffffffffffff/0000000000001000 mmio ffffffffffffffff/0000000000002000 mmio ffffffffffffffff/0000000000000100 + mmio ffffffffffffffff/0000000000000100 + mmio ffffffffffffffff/0000000000000200 mmio ffffffffffffffff/0000000000000200 The other machines now reject -smp cpus=3D2 just like -smp cpus=3D3 and up. Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20200519091631.1006073-1-clg@kaod.org> Reviewed-by: Markus Armbruster [Commit message expanded] Signed-off-by: Markus Armbruster --- include/hw/arm/aspeed_soc.h | 1 - hw/arm/aspeed.c | 29 ++++++++++++++++++++++++----- hw/arm/aspeed_ast2600.c | 20 +++++++------------- hw/arm/aspeed_soc.c | 9 +-------- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h index 78b9f6ae53..914115f3ef 100644 --- a/include/hw/arm/aspeed_soc.h +++ b/include/hw/arm/aspeed_soc.h @@ -40,7 +40,6 @@ typedef struct AspeedSoCState { =20 /*< public >*/ ARMCPU cpu[ASPEED_CPUS_NUM]; - uint32_t num_cpus; A15MPPrivState a7mpcore; MemoryRegion *dram_mr; MemoryRegion sram; diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index 2c23297edf..fd5cc542a5 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -283,8 +283,6 @@ static void aspeed_machine_init(MachineState *machine) &error_abort); object_property_set_int(OBJECT(&bmc->soc), amc->num_cs, "num-cs", &error_abort); - object_property_set_int(OBJECT(&bmc->soc), machine->smp.cpus, "num-cpu= s", - &error_abort); object_property_set_link(OBJECT(&bmc->soc), OBJECT(&bmc->ram_container= ), "dram", &error_abort); if (machine->kernel_filename) { @@ -337,7 +335,7 @@ static void aspeed_machine_init(MachineState *machine) } } =20 - if (machine->kernel_filename && bmc->soc.num_cpus > 1) { + if (machine->kernel_filename && sc->num_cpus > 1) { /* With no u-boot we must set up a boot stub for the secondary CPU= */ MemoryRegion *smpboot =3D g_new(MemoryRegion, 1); memory_region_init_ram(smpboot, OBJECT(bmc), "aspeed.smpboot", @@ -352,7 +350,7 @@ static void aspeed_machine_init(MachineState *machine) =20 aspeed_board_binfo.ram_size =3D ram_size; aspeed_board_binfo.loader_start =3D sc->memmap[ASPEED_SDRAM]; - aspeed_board_binfo.nb_cpus =3D bmc->soc.num_cpus; + aspeed_board_binfo.nb_cpus =3D sc->num_cpus; =20 if (amc->i2c_init) { amc->i2c_init(bmc); @@ -549,12 +547,17 @@ static void aspeed_machine_class_props_init(ObjectCla= ss *oc) "boot directly from CE0 flash device"); } =20 +static int aspeed_soc_num_cpus(const char *soc_name) +{ + AspeedSoCClass *sc =3D ASPEED_SOC_CLASS(object_class_by_name(soc_name)); + return sc->num_cpus; +} + static void aspeed_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); =20 mc->init =3D aspeed_machine_init; - mc->max_cpus =3D ASPEED_CPUS_NUM; mc->no_floppy =3D 1; mc->no_cdrom =3D 1; mc->no_parallel =3D 1; @@ -576,6 +579,8 @@ static void aspeed_machine_palmetto_class_init(ObjectCl= ass *oc, void *data) amc->num_cs =3D 1; amc->i2c_init =3D palmetto_bmc_i2c_init; mc->default_ram_size =3D 256 * MiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); }; =20 static void aspeed_machine_ast2500_evb_class_init(ObjectClass *oc, void *d= ata) @@ -591,6 +596,8 @@ static void aspeed_machine_ast2500_evb_class_init(Objec= tClass *oc, void *data) amc->num_cs =3D 1; amc->i2c_init =3D ast2500_evb_i2c_init; mc->default_ram_size =3D 512 * MiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); }; =20 static void aspeed_machine_romulus_class_init(ObjectClass *oc, void *data) @@ -606,6 +613,8 @@ static void aspeed_machine_romulus_class_init(ObjectCla= ss *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D romulus_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); }; =20 static void aspeed_machine_sonorapass_class_init(ObjectClass *oc, void *da= ta) @@ -621,6 +630,8 @@ static void aspeed_machine_sonorapass_class_init(Object= Class *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D sonorapass_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); }; =20 static void aspeed_machine_swift_class_init(ObjectClass *oc, void *data) @@ -636,6 +647,8 @@ static void aspeed_machine_swift_class_init(ObjectClass= *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D swift_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); }; =20 static void aspeed_machine_witherspoon_class_init(ObjectClass *oc, void *d= ata) @@ -651,6 +664,8 @@ static void aspeed_machine_witherspoon_class_init(Objec= tClass *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D witherspoon_bmc_i2c_init; mc->default_ram_size =3D 512 * MiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); }; =20 static void aspeed_machine_ast2600_evb_class_init(ObjectClass *oc, void *d= ata) @@ -667,6 +682,8 @@ static void aspeed_machine_ast2600_evb_class_init(Objec= tClass *oc, void *data) amc->num_cs =3D 1; amc->i2c_init =3D ast2600_evb_i2c_init; mc->default_ram_size =3D 1 * GiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); }; =20 static void aspeed_machine_tacoma_class_init(ObjectClass *oc, void *data) @@ -683,6 +700,8 @@ static void aspeed_machine_tacoma_class_init(ObjectClas= s *oc, void *data) amc->num_cs =3D 2; amc->i2c_init =3D witherspoon_bmc_i2c_init; /* Same board layout */ mc->default_ram_size =3D 1 * GiB; + mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D + aspeed_soc_num_cpus(amc->soc_name); }; =20 static const TypeInfo aspeed_machine_types[] =3D { diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index 71a0acfe26..c6821b3322 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -255,17 +255,11 @@ static void aspeed_soc_ast2600_realize(DeviceState *d= ev, Error **errp) create_unimplemented_device("aspeed.video", sc->memmap[ASPEED_VIDEO], 0x1000); =20 - if (s->num_cpus > sc->num_cpus) { - warn_report("%s: invalid number of CPUs %d, using default %d", - sc->name, s->num_cpus, sc->num_cpus); - s->num_cpus =3D sc->num_cpus; - } - /* CPU */ - for (i =3D 0; i < s->num_cpus; i++) { + for (i =3D 0; i < sc->num_cpus; i++) { object_property_set_int(OBJECT(&s->cpu[i]), QEMU_PSCI_CONDUIT_SMC, "psci-conduit", &error_abort); - if (s->num_cpus > 1) { + if (sc->num_cpus > 1) { object_property_set_int(OBJECT(&s->cpu[i]), ASPEED_A7MPCORE_ADDR, "reset-cbar", &error_abort); @@ -289,7 +283,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev= , Error **errp) } =20 /* A7MPCORE */ - object_property_set_int(OBJECT(&s->a7mpcore), s->num_cpus, "num-cpu", + object_property_set_int(OBJECT(&s->a7mpcore), sc->num_cpus, "num-cpu", &error_abort); object_property_set_int(OBJECT(&s->a7mpcore), ASPEED_SOC_AST2600_MAX_IRQ + GIC_INTERNAL, @@ -299,18 +293,18 @@ static void aspeed_soc_ast2600_realize(DeviceState *d= ev, Error **errp) &error_abort); sysbus_mmio_map(SYS_BUS_DEVICE(&s->a7mpcore), 0, ASPEED_A7MPCORE_ADDR); =20 - for (i =3D 0; i < s->num_cpus; i++) { + for (i =3D 0; i < sc->num_cpus; i++) { SysBusDevice *sbd =3D SYS_BUS_DEVICE(&s->a7mpcore); DeviceState *d =3D DEVICE(qemu_get_cpu(i)); =20 irq =3D qdev_get_gpio_in(d, ARM_CPU_IRQ); sysbus_connect_irq(sbd, i, irq); irq =3D qdev_get_gpio_in(d, ARM_CPU_FIQ); - sysbus_connect_irq(sbd, i + s->num_cpus, irq); + sysbus_connect_irq(sbd, i + sc->num_cpus, irq); irq =3D qdev_get_gpio_in(d, ARM_CPU_VIRQ); - sysbus_connect_irq(sbd, i + 2 * s->num_cpus, irq); + sysbus_connect_irq(sbd, i + 2 * sc->num_cpus, irq); irq =3D qdev_get_gpio_in(d, ARM_CPU_VFIQ); - sysbus_connect_irq(sbd, i + 3 * s->num_cpus, irq); + sysbus_connect_irq(sbd, i + 3 * sc->num_cpus, irq); } =20 /* SRAM */ diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c index cf6b6dd116..e6f4b59134 100644 --- a/hw/arm/aspeed_soc.c +++ b/hw/arm/aspeed_soc.c @@ -242,14 +242,8 @@ static void aspeed_soc_realize(DeviceState *dev, Error= **errp) create_unimplemented_device("aspeed.video", sc->memmap[ASPEED_VIDEO], 0x1000); =20 - if (s->num_cpus > sc->num_cpus) { - warn_report("%s: invalid number of CPUs %d, using default %d", - sc->name, s->num_cpus, sc->num_cpus); - s->num_cpus =3D sc->num_cpus; - } - /* CPU */ - for (i =3D 0; i < s->num_cpus; i++) { + for (i =3D 0; i < sc->num_cpus; i++) { object_property_set_bool(OBJECT(&s->cpu[i]), true, "realized", &er= r); if (err) { error_propagate(errp, err); @@ -460,7 +454,6 @@ static void aspeed_soc_realize(DeviceState *dev, Error = **errp) aspeed_soc_get_irq(s, ASPEED_SDHCI)); } static Property aspeed_soc_properties[] =3D { - DEFINE_PROP_UINT32("num-cpus", AspeedSoCState, num_cpus, 0), DEFINE_PROP_LINK("dram", AspeedSoCState, dram_mr, TYPE_MEMORY_REGION, MemoryRegion *), DEFINE_PROP_END_OF_LIST(), --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664310; cv=none; d=zohomail.com; s=zohoarc; b=cRBaPzYWIox/l4WlkQckVvXDxcDiR9cHuX0zvFHBqF1q5Ib3hKwHaV9dZGOR/36lRWnYjyABA/1PknTH8IGkemQ4iVGsqXMykQMBn1Hj3n1vcpLoXB3or+NYlN/2xaBWt4Ru/e51W2LT1xFO6h/6n7JCf1RRFrHEcK+nyvgqPEo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664310; 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=Ym/tzzyYr0Jg0PcxIJ4XbQwSpjBNTm298HFLXDlGoPA=; b=oBSUjjRGwZYZsgOs3sKCGGjUvJHebvOkUZbs/e/5dgmI9KKKAV/pgmy6ogO3uPGxYXOsXKSirUXzGMFj4kKf5DnEc1l1DSb526L03XWpsZZY67wzEos5OvpFAFYpN0XBxQZ+BQSTqBaEU078wfa6DllAF8EDrtwVjCEw1aVWYdc= 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 1590664310415136.83852465963048; Thu, 28 May 2020 04:11:50 -0700 (PDT) Received: from localhost ([::1]:59138 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGRw-0002pR-Uj for importer@patchew.org; Thu, 28 May 2020 07:11:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLO-0005s0-Cv for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:02 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:24487 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 1jeGLG-0006km-26 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:01 -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-321-GRirs89-PmiaxErvaVea8w-1; Thu, 28 May 2020 07:04:49 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CA8A474; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A9BF97A8A6; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C736E113639D; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663893; 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=Ym/tzzyYr0Jg0PcxIJ4XbQwSpjBNTm298HFLXDlGoPA=; b=CAupUln+uFPLXioZGMZvHCygX5wQj9HuiTG9dHHbWjyaRvNiqurwB80VlBJlGfS8tSHiBW a/snSUTT8BHTpDqIKX19l2qJTyq2ibGwhXfsBocorNv+QtNQeAC45R/lMnNiz6kp5zV/tl DVz0VrlLmeKADa2tmjunKDVu21aPQrw= X-MC-Unique: GRirs89-PmiaxErvaVea8w-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 05/24] arm/aspeed: Rework NIC attachment Date: Thu, 28 May 2020 13:04:25 +0200 Message-Id: <20200528110444.20456-6-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11: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, RCVD_IN_MSPIKE_H3=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: Joel Stanley , pbonzini@redhat.com, berrange@redhat.com, ehabkost@redhat.com, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: C=C3=A9dric Le Goater The number of MACs supported by an Aspeed SoC is defined by "macs_num" under the SoC model, that is two for the AST2400 and AST2500 and four for the AST2600. The model initializes the maximum number of supported MACs but the number of realized devices is capped by the number of network device back-ends defined on the command line. This can leave unrealized devices hanging around in the QOM composition tree. To get virtual hardware that matches the physical hardware, you have to pass exactly as many -nic options as there are MACs, and some of them must be -nic none: * Machines ast2500-evb, palmetto-bmc, romulus-bmc, sonorapass-bmc, swift-bmc, and witherspoon-bmc: two -nic, and the second one must be -nic none. * Machine ast2600-evb: four -nic, the first one must be -nic none. * Machine tacoma-bmc: four nic, the first two and the last one must be -nic none. Modify the machine initialization to define which MACs are attached to a network device back-end using a bit-field property "macs-mask" and let the SoC realize all network devices. The default setting of "macs-mask" is "use MAC0" only, which works for all our AST2400 and AST2500 machines. The AST2600 machines have different configurations. The AST2600 EVB machine activates MAC1, MAC2 and MAC3 and the Tacoma BMC machine activates MAC2. Incompatible CLI change: -nic options now apply to *active* MACs: MAC1, MAC2, MAC3 for ast2600-evb, MAC2 for tacoma-bmc, and MAC0 for all the others. The machines now always get all MACs as they should. Visible in "info qom-tree", here's the change for tacoma-bmc: /machine (tacoma-bmc-machine) /peripheral (container) /peripheral-anon (container) /soc (ast2600-a1) [...] /ftgmac100[0] (ftgmac100) /ftgmac100[0] (qemu:memory-region) /ftgmac100[1] (ftgmac100) + /ftgmac100[0] (qemu:memory-region) /ftgmac100[2] (ftgmac100) + /ftgmac100[0] (qemu:memory-region) /ftgmac100[3] (ftgmac100) + /ftgmac100[0] (qemu:memory-region) [...] /mii[0] (aspeed-mmi) /aspeed-mmi[0] (qemu:memory-region) /mii[1] (aspeed-mmi) + /aspeed-mmi[0] (qemu:memory-region) /mii[2] (aspeed-mmi) + /aspeed-mmi[0] (qemu:memory-region) /mii[3] (aspeed-mmi) + /aspeed-mmi[0] (qemu:memory-region) Also visible in "info qtree"; here's the change for tacoma-bmc: dev: ftgmac100, id "" gpio-out "sysbus-irq" 1 aspeed =3D true - mac =3D "52:54:00:12:34:56" - netdev =3D "hub0port0" + mac =3D "52:54:00:12:34:57" + netdev =3D "" mmio 000000001e660000/0000000000002000 dev: ftgmac100, id "" - aspeed =3D false - mac =3D "00:00:00:00:00:00" + gpio-out "sysbus-irq" 1 + aspeed =3D true + mac =3D "52:54:00:12:34:58" netdev =3D "" + mmio 000000001e680000/0000000000002000 dev: ftgmac100, id "" - aspeed =3D false - mac =3D "00:00:00:00:00:00" - netdev =3D "" + gpio-out "sysbus-irq" 1 + aspeed =3D true + mac =3D "52:54:00:12:34:56" + netdev =3D "hub0port0" + mmio 000000001e670000/0000000000002000 dev: ftgmac100, id "" - aspeed =3D false - mac =3D "00:00:00:00:00:00" + gpio-out "sysbus-irq" 1 + aspeed =3D true + mac =3D "52:54:00:12:34:59" netdev =3D "" + mmio 000000001e690000/0000000000002000 [...] dev: aspeed-mmi, id "" mmio 000000001e650000/0000000000000008 dev: aspeed-mmi, id "" + mmio 000000001e650008/0000000000000008 dev: aspeed-mmi, id "" + mmio 000000001e650010/0000000000000008 dev: aspeed-mmi, id "" + mmio 000000001e650018/0000000000000008 Inactive MACs will have no peer and QEMU may warn the user with : qemu-system-arm: warning: nic ftgmac100.0 has no peer qemu-system-arm: warning: nic ftgmac100.1 has no peer qemu-system-arm: warning: nic ftgmac100.3 has no peer Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Markus Armbruster Message-Id: <20200527124406.329503-1-clg@kaod.org> Reviewed-by: Joel Stanley [Commit message expanded] Signed-off-by: Markus Armbruster --- include/hw/arm/aspeed.h | 6 ++++++ hw/arm/aspeed.c | 13 +++++++++++++ hw/arm/aspeed_ast2600.c | 3 +-- hw/arm/aspeed_soc.c | 3 +-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/include/hw/arm/aspeed.h b/include/hw/arm/aspeed.h index 18521484b9..95b4daece8 100644 --- a/include/hw/arm/aspeed.h +++ b/include/hw/arm/aspeed.h @@ -23,6 +23,11 @@ typedef struct AspeedMachine { bool mmio_exec; } AspeedMachine; =20 +#define ASPEED_MAC0_ON (1 << 0) +#define ASPEED_MAC1_ON (1 << 1) +#define ASPEED_MAC2_ON (1 << 2) +#define ASPEED_MAC3_ON (1 << 3) + #define ASPEED_MACHINE_CLASS(klass) \ OBJECT_CLASS_CHECK(AspeedMachineClass, (klass), TYPE_ASPEED_MACHINE) #define ASPEED_MACHINE_GET_CLASS(obj) \ @@ -39,6 +44,7 @@ typedef struct AspeedMachineClass { const char *fmc_model; const char *spi_model; uint32_t num_cs; + uint32_t macs_mask; void (*i2c_init)(AspeedBoardState *bmc); } AspeedMachineClass; =20 diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c index fd5cc542a5..f8f3ef89d3 100644 --- a/hw/arm/aspeed.c +++ b/hw/arm/aspeed.c @@ -258,6 +258,7 @@ static void aspeed_machine_init(MachineState *machine) DriveInfo *drive0 =3D drive_get(IF_MTD, 0, 0); ram_addr_t max_ram_size; int i; + NICInfo *nd =3D &nd_table[0]; =20 bmc =3D g_new0(AspeedBoardState, 1); =20 @@ -277,6 +278,14 @@ static void aspeed_machine_init(MachineState *machine) object_property_set_uint(OBJECT(&bmc->soc), ram_size, "ram-size", &error_fatal); =20 + for (i =3D 0; i < sc->macs_num; i++) { + if ((amc->macs_mask & (1 << i)) && nd->used) { + qemu_check_nic_model(nd, TYPE_FTGMAC100); + qdev_set_nic_properties(DEVICE(&bmc->soc.ftgmac100[i]), nd); + nd++; + } + } + object_property_set_int(OBJECT(&bmc->soc), amc->hw_strap1, "hw-strap1", &error_abort); object_property_set_int(OBJECT(&bmc->soc), amc->hw_strap2, "hw-strap2", @@ -556,12 +565,14 @@ static int aspeed_soc_num_cpus(const char *soc_name) static void aspeed_machine_class_init(ObjectClass *oc, void *data) { MachineClass *mc =3D MACHINE_CLASS(oc); + AspeedMachineClass *amc =3D ASPEED_MACHINE_CLASS(oc); =20 mc->init =3D aspeed_machine_init; mc->no_floppy =3D 1; mc->no_cdrom =3D 1; mc->no_parallel =3D 1; mc->default_ram_id =3D "ram"; + amc->macs_mask =3D ASPEED_MAC0_ON; =20 aspeed_machine_class_props_init(oc); } @@ -680,6 +691,7 @@ static void aspeed_machine_ast2600_evb_class_init(Objec= tClass *oc, void *data) amc->fmc_model =3D "w25q512jv"; amc->spi_model =3D "mx66u51235f"; amc->num_cs =3D 1; + amc->macs_mask =3D ASPEED_MAC1_ON | ASPEED_MAC2_ON | ASPEED_MAC3_ON; amc->i2c_init =3D ast2600_evb_i2c_init; mc->default_ram_size =3D 1 * GiB; mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D @@ -698,6 +710,7 @@ static void aspeed_machine_tacoma_class_init(ObjectClas= s *oc, void *data) amc->fmc_model =3D "mx66l1g45g"; amc->spi_model =3D "mx66l1g45g"; amc->num_cs =3D 2; + amc->macs_mask =3D ASPEED_MAC2_ON; amc->i2c_init =3D witherspoon_bmc_i2c_init; /* Same board layout */ mc->default_ram_size =3D 1 * GiB; mc->default_cpus =3D mc->min_cpus =3D mc->max_cpus =3D diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c index c6821b3322..b912d19f80 100644 --- a/hw/arm/aspeed_ast2600.c +++ b/hw/arm/aspeed_ast2600.c @@ -461,8 +461,7 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev= , Error **errp) } =20 /* Net */ - for (i =3D 0; i < nb_nics && i < sc->macs_num; i++) { - qdev_set_nic_properties(DEVICE(&s->ftgmac100[i]), &nd_table[i]); + for (i =3D 0; i < sc->macs_num; i++) { object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "aspeed", &err); object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "realized= ", diff --git a/hw/arm/aspeed_soc.c b/hw/arm/aspeed_soc.c index e6f4b59134..3ec1257c14 100644 --- a/hw/arm/aspeed_soc.c +++ b/hw/arm/aspeed_soc.c @@ -404,8 +404,7 @@ static void aspeed_soc_realize(DeviceState *dev, Error = **errp) } =20 /* Net */ - for (i =3D 0; i < nb_nics && i < sc->macs_num; i++) { - qdev_set_nic_properties(DEVICE(&s->ftgmac100[i]), &nd_table[i]); + for (i =3D 0; i < sc->macs_num; i++) { object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "aspeed", &err); object_property_set_bool(OBJECT(&s->ftgmac100[i]), true, "realized= ", --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664093; cv=none; d=zohomail.com; s=zohoarc; b=DnwCeGFQk9m/n9exi7Lu2Zs8e13j2IXl5m9pdPIvnEAzmbcLWWyP2LxC6+ItkdKDT2DcByIEoBfVvlctVIY+q7yCZyvGdXUieYrfQwwkkwX+3WAcm7ECKY0HeeHtXWBSMPnG2Udj7iaBTk4sdYAslkhErEW4lVtWAjRAREcPVeI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664093; 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=NToz3l3XRw+n9Z3WCBBOA+fw4xgEX+UBDn67/TKP84Y=; b=j+USkRLQtkireTrYVp5hQInklNWN5Lk/ghCImH/DgBeqvQE+vodEV+DX6ZB1cCVqKlHPNP8dTwCVa+6LCt0VEr2RNNaXhotx+CN/7TORTFRDd17WkGiVHZVVtjsxhzn7lHz8ckYiQPdbnbtrKk91vvUJH9A1uKw07pWUqs/0hsk= 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 1590664093922110.2897531218938; Thu, 28 May 2020 04:08:13 -0700 (PDT) Received: from localhost ([::1]:40654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGOS-0003IU-KO for importer@patchew.org; Thu, 28 May 2020 07:08:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLF-0005h5-OD for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:53 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:52492 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 1jeGLD-0006e0-AU for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:53 -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-470-Etpn7hs_Nui_Pcodpv15WQ-1; Thu, 28 May 2020 07:04:48 -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 D589B1009440; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A29091001B0B; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id C8F7D11358BC; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663890; 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=NToz3l3XRw+n9Z3WCBBOA+fw4xgEX+UBDn67/TKP84Y=; b=X5lHOaTNh8Hxdo3VFow6D8OVI9kjnbzCk7Aqd70trUhdWpilme49i0tVkMwW4D/31xKu05 VmU2Ko3gKvSh3Djm9tO4jaQMuF7reMQcY/d1+Q3susyWHxVpyoWZQH3C6fWHrrtQ15bEJr 1+zI4FoISfDZ2qzWN627vhc8NCU7JOE= X-MC-Unique: Etpn7hs_Nui_Pcodpv15WQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 06/24] armv7m: Delete unused "ARM,bitband-memory" devices Date: Thu, 28 May 2020 13:04:26 +0200 Message-Id: <20200528110444.20456-7-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@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-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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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: pbonzini@redhat.com, qemu-arm@nongnu.org, berrange@redhat.com, ehabkost@redhat.com, Peter Maydell Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" These devices are optional, and enabled by property "enable-bitband". armv7m_instance_init() creates them unconditionally, because the property has not been set then. armv7m_realize() realizes them only when the property is true. Works, although it leaves unrealized devices hanging around in the QOM composition tree. Affects machines microbit, mps2-an505, mps2-an521, musca-a, and musca-b1. Delete the unused devices by making armv7m_realize() unparent them. Visible in "info qom-tree"; here's the change for microbit: /machine (microbit-machine) /microbit.twi (microbit.i2c) /microbit.twi[0] (qemu:memory-region) /nrf51 (nrf51-soc) /armv6m (armv7m) /armv7m-container[0] (qemu:memory-region) - /bitband[0] (ARM,bitband-memory) - /bitband[0] (qemu:memory-region) - /bitband[1] (ARM,bitband-memory) - /bitband[0] (qemu:memory-region) /cpu (cortex-m0-arm-cpu) Cc: Peter Maydell Cc: qemu-arm@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/armv7m.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/arm/armv7m.c b/hw/arm/armv7m.c index 7da57f56d3..f930619f53 100644 --- a/hw/arm/armv7m.c +++ b/hw/arm/armv7m.c @@ -245,8 +245,8 @@ static void armv7m_realize(DeviceState *dev, Error **er= rp) memory_region_add_subregion(&s->container, 0xe000e000, sysbus_mmio_get_region(sbd, 0)); =20 - if (s->enable_bitband) { - for (i =3D 0; i < ARRAY_SIZE(s->bitband); i++) { + for (i =3D 0; i < ARRAY_SIZE(s->bitband); i++) { + if (s->enable_bitband) { Object *obj =3D OBJECT(&s->bitband[i]); SysBusDevice *sbd =3D SYS_BUS_DEVICE(&s->bitband[i]); =20 @@ -265,6 +265,8 @@ static void armv7m_realize(DeviceState *dev, Error **er= rp) =20 memory_region_add_subregion(&s->container, bitband_output_addr= [i], sysbus_mmio_get_region(sbd, 0)); + } else { + object_unparent(OBJECT(&s->bitband[i])); } } } --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664475; cv=none; d=zohomail.com; s=zohoarc; b=njAHH+63ZAkbxEBUP7hlx+1xD/Q525pATXpM0eyp1gKntnjMLeYQ0s/QqN8w8SOwj9r25Tf9Hk5KTtlMeuFMJ1GyTfUr2MaiqBYYu9WvT8zhaCcRO2XBg4y5PHvTSPozHrr/6hvVwPl+Qg3h01S9G/9a4oC8pDQ2DUrZTnOk12o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664475; 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=GMkNHJdv8uoenyRyjqONb1nmw4/fG6Cgt3u8VcNq450=; b=TG2aTbdR7CCXYmL6qsvXXPM0WLDfzAftGsjR3PO8cZxxHtfb9QGwYGLLQYASVrCvqGvpzQroUcv0X0Sd+Of+y66Mvu0tDzdXIWuDkBHZNM4HVyYgQGMVpo/gQrstZ/8ppUax9yIWkYI/CVV9hFGo2eop1DllGxwliOAgKEh2cI8= 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 159066447504492.06089074330248; Thu, 28 May 2020 04:14:35 -0700 (PDT) Received: from localhost ([::1]:43178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGUb-0008S7-O5 for importer@patchew.org; Thu, 28 May 2020 07:14:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLH-0005mI-SL for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:33021 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 1jeGLE-0006fe-Bg for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:55 -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-474-JNrlJHPlMn-wXLWXS05ohA-1; Thu, 28 May 2020 07:04:49 -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 CF6E6107ACF2; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9F6BA5C1B0; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CC3B011358BE; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663891; 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=GMkNHJdv8uoenyRyjqONb1nmw4/fG6Cgt3u8VcNq450=; b=PfYe9m9PNgqpFyZlhvBqUU/0PH8OneF1/4DlfVJU0e0ezgylnaOJ02xDSjiavGuDGOAGd3 XoPwVjXaH+WmNIiiQzbcfPLYzMfjyuhwDe+B+FdFFuPrrzizPWs8+Q5qso075K0ZPrkSeI pt+ttXofWlTZw67fl3eh8vLp/kfRPbo= X-MC-Unique: JNrlJHPlMn-wXLWXS05ohA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 07/24] auxbus: Fix aux-to-i2c-bridge to be a subtype of aux-slave Date: Thu, 28 May 2020 13:04:27 +0200 Message-Id: <20200528110444.20456-8-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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: pbonzini@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , berrange@redhat.com, ehabkost@redhat.com, KONRAD Frederic Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) We plug aux-to-i2c-bridge into the aux-bus, even though its DeviceClass member bus_type is null, not TYPE_AUX_BUS. Fix that by deriving it from TYPE_AUX_SLAVE instead of TYPE_DEVICE. Cc: KONRAD Frederic Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/auxbus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/auxbus.c b/hw/misc/auxbus.c index f8e7b97971..5e4794f0ac 100644 --- a/hw/misc/auxbus.c +++ b/hw/misc/auxbus.c @@ -244,7 +244,7 @@ static inline I2CBus *aux_bridge_get_i2c_bus(AUXTOI2CSt= ate *bridge) =20 static const TypeInfo aux_to_i2c_type_info =3D { .name =3D TYPE_AUXTOI2C, - .parent =3D TYPE_DEVICE, + .parent =3D TYPE_AUX_SLAVE, .class_init =3D aux_bridge_class_init, .instance_size =3D sizeof(AUXTOI2CState), .instance_init =3D aux_bridge_init --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664182; cv=none; d=zohomail.com; s=zohoarc; b=kPqTVc5xlbxZd1e+6HW/gbpTSyTMuJQgoqW3lIKeSCDwSjN9dT8MAk8i6ZqXVW4OjGcQRE3gBXvw9xR2/kHhPKdlGm+9VhA2Rvs14H1J3klrLDPUVt0OfYMLVLxA0ODrzwiVHQcNzYeUWbgbmMMsLLC2jbRtaHAQncv3dQ5z4YI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664182; 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=Mhihtt/hwItgXDrHKkxCDQP31xLPNxyA4bUEalyf91A=; b=mT0eke6qlM8abzFRMm/U/CCqrTxtHlrkf9qd+f07GIXq5sB6kkwFeMggi79Z5ZYNTTu05b8S+sKtxYFCo4cEBtrQIYypBWmwzLoa/zMwlVO2G4fKAakuCyG6SNixlMNDJSYM15UhTJ7uaGGlWZu/4M5Mf/QwMWYWWVwQPK943dc= 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 1590664182870331.7299432558224; Thu, 28 May 2020 04:09:42 -0700 (PDT) Received: from localhost ([::1]:49342 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGPt-00078N-NH for importer@patchew.org; Thu, 28 May 2020 07:09:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49782) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLF-0005hL-T4 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:53 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:23526 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 1jeGLD-0006eC-DZ for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:53 -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-488-FAs_DmoGON-UtigyR8ap_g-1; Thu, 28 May 2020 07:04:49 -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 0FABB8014D4; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D2ED55C1B0; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id CF7A711358BF; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663890; 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=Mhihtt/hwItgXDrHKkxCDQP31xLPNxyA4bUEalyf91A=; b=FAKteTB5WCghntbfus3XDu1dWMsffkbpWPJq3+9e95YfTxgj4gJnMv39WJZZ8LcOFEdaVR sqKF/VVEPqKY0LHfrZtdc0jLVSz8km9fCY1zlbhO/0xvQ6PYGYtTRNGP3GqUFJH9EEAobM /jrE08iKC+2EaXAw2pRPfOVUPI+/V0A= X-MC-Unique: FAs_DmoGON-UtigyR8ap_g-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 08/24] mac_via: Fix to realize "mos6522-q800-via*" devices Date: Thu, 28 May 2020 13:04:28 +0200 Message-Id: <20200528110444.20456-9-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@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-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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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: pbonzini@redhat.com, Mark Cave-Ayland , berrange@redhat.com, ehabkost@redhat.com, Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" mac_via_realize() creates a "mos6522-q800-via1" and a "mos6522-q800-via2" device, but neglects to realize them. Affects machine q800. In theory, a device becomes real only on realize. In practice, the transition from unreal to real is a fuzzy one. The work to make a device real can be spread between realize methods (fine), instance_init methods (wrong), and board code wiring up the device (fine as long as it effectively happens on realize). Depending on what exactly is done where, a device can work even when we neglect to realize it. These two appear to work. Nevertheless, it's a clear misuse of the interface. Even when it works today (more or less by chance), it can break tomorrow. Fix by realizing them right away. Fixes: 6dca62a0000f95e0b7020aa00d0ca9b2c421f341 Cc: Laurent Vivier Signed-off-by: Markus Armbruster Reviewed-by: Mark Cave-Ayland --- hw/misc/mac_via.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index e05623d730..82614c155a 100644 --- a/hw/misc/mac_via.c +++ b/hw/misc/mac_via.c @@ -890,6 +890,11 @@ static void mac_via_realize(DeviceState *dev, Error **= errp) object_property_add_alias(OBJECT(dev), "irq[1]", OBJECT(ms), SYSBUS_DEVICE_GPIO_IRQ "[0]"); =20 + object_property_set_bool(OBJECT(&m->mos6522_via1), true, "realized", + &error_abort); + object_property_set_bool(OBJECT(&m->mos6522_via2), true, "realized", + &error_abort); + /* Pass through mos6522 input IRQs */ qdev_pass_gpios(DEVICE(&m->mos6522_via1), dev, "via1-irq"); qdev_pass_gpios(DEVICE(&m->mos6522_via2), dev, "via2-irq"); --=20 2.21.3 From nobody Fri Nov 14 20:27:39 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590664421; cv=none; d=zohomail.com; s=zohoarc; b=I1aL8fx666R816qWtGhFZsnYL+iLmRj2ZA7Um3txhnwF9QXqd9SBMHWpZu7S+CzpPeLmuhY1j9YKTk6nDtZVdUSKyquyzyVlNOrwzAeemPNgBj0w8vld3WrHlEI1BM1A0uSHz3xlT9RNpDMwq4/l8oP1xkyxwaiugf/V57SbcE0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664421; 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=OYidYnDI2p3H7kKvYlxCHJA+V3LjwOLpkoIpU+UA0lU=; b=kdc4A3QtGOfxrz9TRZReFFlTN6CBkeihYvlXVdVTcX1ReKGDYTbJLy9AWoA9DpABi7VmpDSRkkHfZBm4S4/ynwKPahFD9je1XyaqJztd2OS4Qoaa8nnWT4yzdfkocr2L/GGCocSUo5TmWmI7NNnWR2qWtD3rnAN711jzyMggT3I= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590664421836417.5979579111149; Thu, 28 May 2020 04:13:41 -0700 (PDT) Received: from localhost ([::1]:38676 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGTk-0006fx-JJ for importer@patchew.org; Thu, 28 May 2020 07:13:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLP-0005u0-6c for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:04 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:57698 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 1jeGLG-0006lK-7N for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:02 -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-323-sl6wnlhTMSWaWEUsoNA2Cw-1; Thu, 28 May 2020 07:04:48 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB51D835B42; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A7DD060CD1; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D2B5611358C0; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663893; 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=OYidYnDI2p3H7kKvYlxCHJA+V3LjwOLpkoIpU+UA0lU=; b=CMHV9hVz9di9rsVsDA6Lk2wnBDDszPHXEk83dH/h6iokxF1WcSYUtAu5tabqBi5iIBqVpq PwFFPCoPmiYmnb2+Zi1e7+u9NeTKUaeV2RxPz/sFLCrW60ndAPxfxkuzgwAOqHnTGlFbOO zr3BQdBU+9HMRdLgsWeZfI6NyPWe1k0= X-MC-Unique: sl6wnlhTMSWaWEUsoNA2Cw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 09/24] macio: Fix to realize "mos6522-cuda" and "mos6522-pmu" devices Date: Thu, 28 May 2020 13:04:29 +0200 Message-Id: <20200528110444.20456-10-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 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, 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: pbonzini@redhat.com, berrange@redhat.com, ehabkost@redhat.com, Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" cuda_init() creates a "mos6522-cuda" device, but it's never realized. Affects machines mac99 with via=3Dcuda (default) and g3beige. pmu_init() creates a "mos6522-pmu" device, but it's never realized. Affects machine mac99 with via=3Dpmu and via=3Dpmu-adb, In theory, a device becomes real only on realize. In practice, the transition from unreal to real is a fuzzy one. The work to make a device real can be spread between realize methods (fine), instance_init methods (wrong), and board code wiring up the device (fine as long as it effectively happens on realize). Depending on what exactly is done where, a device can work even when we neglect to realize it. These onetwo appear to work. Nevertheless, it's a clear misuse of the interface. Even when it works today (more or less by chance), it can break tomorrow. Fix by realizing them in cuda_realize() and pmu_realize(), respectively. Fixes: 6dca62a0000f95e0b7020aa00d0ca9b2c421f341 Cc: Laurent Vivier Signed-off-by: Markus Armbruster --- hw/misc/macio/cuda.c | 10 +++++----- hw/misc/macio/pmu.c | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/hw/misc/macio/cuda.c b/hw/misc/macio/cuda.c index e0cc0aac5d..763a785f1a 100644 --- a/hw/misc/macio/cuda.c +++ b/hw/misc/macio/cuda.c @@ -33,6 +33,7 @@ #include "hw/misc/macio/cuda.h" #include "qemu/timer.h" #include "sysemu/runstate.h" +#include "qapi/error.h" #include "qemu/cutils.h" #include "qemu/log.h" #include "qemu/module.h" @@ -523,15 +524,14 @@ static void cuda_realize(DeviceState *dev, Error **er= rp) { CUDAState *s =3D CUDA(dev); SysBusDevice *sbd; - MOS6522State *ms; - DeviceState *d; struct tm tm; =20 + object_property_set_bool(OBJECT(&s->mos6522_cuda), true, "realized", + &error_abort); + /* Pass IRQ from 6522 */ - d =3D DEVICE(&s->mos6522_cuda); - ms =3D MOS6522(d); sbd =3D SYS_BUS_DEVICE(s); - sysbus_pass_irq(sbd, SYS_BUS_DEVICE(ms)); + sysbus_pass_irq(sbd, SYS_BUS_DEVICE(&s->mos6522_cuda)); =20 qemu_get_timedate(&tm, 0); s->tick_offset =3D (uint32_t)mktimegm(&tm) + RTC_OFFSET; diff --git a/hw/misc/macio/pmu.c b/hw/misc/macio/pmu.c index 9a9cd427e1..4264779396 100644 --- a/hw/misc/macio/pmu.c +++ b/hw/misc/macio/pmu.c @@ -40,6 +40,7 @@ #include "hw/misc/macio/pmu.h" #include "qemu/timer.h" #include "sysemu/runstate.h" +#include "qapi/error.h" #include "qemu/cutils.h" #include "qemu/log.h" #include "qemu/module.h" @@ -740,15 +741,14 @@ static void pmu_realize(DeviceState *dev, Error **err= p) { PMUState *s =3D VIA_PMU(dev); SysBusDevice *sbd; - MOS6522State *ms; - DeviceState *d; struct tm tm; =20 + object_property_set_bool(OBJECT(&s->mos6522_pmu), true, "realized", + &error_abort); + /* Pass IRQ from 6522 */ - d =3D DEVICE(&s->mos6522_pmu); - ms =3D MOS6522(d); sbd =3D SYS_BUS_DEVICE(s); - sysbus_pass_irq(sbd, SYS_BUS_DEVICE(ms)); + sysbus_pass_irq(sbd, SYS_BUS_DEVICE(&s->mos6522_pmu)); =20 qemu_get_timedate(&tm, 0); s->tick_offset =3D (uint32_t)mktimegm(&tm) + RTC_OFFSET; --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664524; cv=none; d=zohomail.com; s=zohoarc; b=W/2beSyJIeB7mDe0LFiqRgdheUFJ2P3uMoMWY/Fkk1qHR+Y+7tx3Js2c+Jf/8HaWTsFSAT5q5tRCHDJaDfz2G/pLGUX6E06yj8FReJ/4BAQxOzkyXHu6ebkC5Nx54AnaGg/AgC7Ga2a8umL/yloyX+22lv5K0A8ZTdMKbmJoAEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664524; 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=p+CXXh5pkicxbYmi19dREXQYrShpoktzDD+TxIdSpEA=; b=GPDUb3mzFK5KA3WqBNsNuyplOEYur6zzzubKCqFpzxyLQO06J7Z+NzZ3CMVwHNzmil2GlIKN0bP5N22V47lx5GmnJyDENs1KjjrjZ8XczEFnUkcKGHKBZiluM6WyDarbsyRp1WtpQSxYH7qmaQCUmar20nalta4Y3BI8CmJeS/Y= 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 1590664524238618.7782702843401; Thu, 28 May 2020 04:15:24 -0700 (PDT) Received: from localhost ([::1]:47192 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGVO-0001dG-Ts for importer@patchew.org; Thu, 28 May 2020 07:15:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49882) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLR-0005ug-T7 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:05 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:39547 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 1jeGLF-0006kN-Sq for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:04 -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-321-k269-Bk-NACYrCnRKoiH_A-1; Thu, 28 May 2020 07:04:49 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3824C835B44; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 00F8F60C05; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id D6B0811358C2; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663893; 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=p+CXXh5pkicxbYmi19dREXQYrShpoktzDD+TxIdSpEA=; b=Bex/newZGBvAFyWYcJfOIF6v89cs394EjSEIOFWQ3Ohr9Objrl6gydcrwFSQA5Atu18VLL Q09NoGxYSF0v3cPMJxaaOjDZq4sNnl374jr+m7pqLIuuHGb5gGuLPWkKqvOJj9bDKyaWAU /T6bv+x9H3WhpW7PXDRlgCt00nonpfU= X-MC-Unique: k269-Bk-NACYrCnRKoiH_A-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 10/24] macio: Delete unused "macio-gpio" devices Date: Thu, 28 May 2020 13:04:30 +0200 Message-Id: <20200528110444.20456-11-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 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, 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: berrange@redhat.com, ehabkost@redhat.com, Mark Cave-Ayland , qemu-ppc@nongnu.org, pbonzini@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" These devices go with the "via-pmu" device, which is controlled by property "has-pmu". macio_newworld_init() creates it unconditionally, because the property has not been set then. macio_newworld_realize() realizes it only when the property is true. Works, although it can leave an unrealized device hanging around in the QOM composition tree. Affects machine mac99 with via=3Dcuda (default). Delete the unused device by making macio_newworld_realize() unparent it. Visible in "info qom-tree": /machine (mac99-machine) [...] /unattached (container) /device[9] (macio-newworld) [...] /escc-legacy-port[8] (qemu:memory-region) /escc-legacy-port[9] (qemu:memory-region) /escc-legacy[0] (qemu:memory-region) - /gpio (macio-gpio) - /gpio[0] (qemu:memory-region) /ide[0] (macio-ide) /ide.0 (IDE) /pmac-ide[0] (qemu:memory-region) Cc: Mark Cave-Ayland Cc: David Gibson Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Mark Cave-Ayland --- hw/misc/macio/macio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index 3779865ab2..b3dddf8be7 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -368,6 +368,8 @@ static void macio_newworld_realize(PCIDevice *d, Error = **errp) memory_region_add_subregion(&s->bar, 0x16000, sysbus_mmio_get_region(sysbus_dev, 0)); } else { + object_unparent(OBJECT(&ns->gpio)); + /* CUDA */ object_initialize_child(OBJECT(s), "cuda", &s->cuda, sizeof(s->cud= a), TYPE_CUDA, &error_abort, NULL); --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664230; cv=none; d=zohomail.com; s=zohoarc; b=aWRwjYGnGcTMC+npEswrKSf79vnT9Uq+e8eaVrnK2BbNNw0+R09lmOvt/Y/7N31G5ouiJtLBAGH3nM406TBxtDyGfRriK5/m7GDQ9vqPMtE/b2iLaUZHl2ZpWVklepkFQs1oJQ9FW9NgoQXf7Za53y2HLV/JsDrzrd3Q5SyOnqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664230; 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=791xB3bIhnmA94pE0vzJpWoq5hrHM3MtEJgzlo62QlI=; b=jyMPvAZaJlycgm9EnaVyhtf03qLoQWavCEf8diphqUzTmhlt+OSbrwjBFuZTWvaVYAAMK8ucAEj6VqPyMc36NJk1ZciCoE1yZgufYU2eW2JkxmygsMfg6Gj2ouz+Q8hBAj5idv7pObMiN5iXzjWmrAQ0ofQIVTOeP21xyPkn9gM= 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 1590664230758146.63379287309704; Thu, 28 May 2020 04:10:30 -0700 (PDT) Received: from localhost ([::1]:53456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGQf-0000LL-EK for importer@patchew.org; Thu, 28 May 2020 07:10:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLH-0005kE-71 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:55 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:35817 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 1jeGLE-0006eu-8L for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:54 -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-431-ramdDYJwNvuPkzhJOfuYMg-1; Thu, 28 May 2020 07:04:49 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6011E1855A0E; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2C546768D0; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E052811358C3; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663891; 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=791xB3bIhnmA94pE0vzJpWoq5hrHM3MtEJgzlo62QlI=; b=bBlndOJoUmNHCCyi6qmfb65fcvb00SD5pKdrFC3Il7TRxz0ZxPM4+FkwgFyyvbWJ2jKJsH Gw48h8Ac6opU10U+90vN1QGjXlmRpN/etCQmVpq4isLP3jhfxGxaXpM9TD6qpo9bqUvg9K APb85zqTwdaN6O/WETdDPb3yYs4rxBo= X-MC-Unique: ramdDYJwNvuPkzhJOfuYMg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 11/24] pnv/phb4: Delete unused "pnv-phb4-pec-stack" devices Date: Thu, 28 May 2020 13:04:31 +0200 Message-Id: <20200528110444.20456-12-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11: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, RCVD_IN_MSPIKE_H3=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: berrange@redhat.com, ehabkost@redhat.com, Greg Kurz , qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , pbonzini@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The number of stacks is controlled by property "num-stacks". pnv_pec_instance_init() creates the maximum supported number, because the property has not been set then. pnv_pec_realize() realizes only the wanted number. Works, although it can leave unrealized devices hanging around in the QOM composition tree. Affects machine powernv9. Delete the unused devices by making pnv_pec_realize() unparent them. Visible in "info qom-tree": /machine (powernv9-machine) /chip[0] (power9_v2.0-pnv-chip) [...] /pec[0] (pnv-phb4-pec) /stack[0] (pnv-phb4-pec-stack) [...] - /stack[1] (pnv-phb4-pec-stack) - /phb (pnv-phb4) - /pcie-mmcfg-mmio[0] (qemu:memory-region) - /root (pnv-phb4-root-port) - /source (xive-source) - /stack[2] (pnv-phb4-pec-stack) - /phb (pnv-phb4) - /pcie-mmcfg-mmio[0] (qemu:memory-region) - /root (pnv-phb4-root-port) - /source (xive-source) /xscom-pec-0.0-nest[0] (qemu:memory-region) /xscom-pec-0.0-pci[0] (qemu:memory-region) /pec[1] (pnv-phb4-pec) /stack[0] (pnv-phb4-pec-stack) [...] /stack[1] (pnv-phb4-pec-stack) [...] - /stack[2] (pnv-phb4-pec-stack) - /phb (pnv-phb4) - /pcie-mmcfg-mmio[0] (qemu:memory-region) - /root (pnv-phb4-root-port) - /source (xive-source) /xscom-pec-0.1-nest[0] (qemu:memory-region) /xscom-pec-0.1-pci[0] (qemu:memory-region) /pec[2] (pnv-phb4-pec) /stack[0] (pnv-phb4-pec-stack) [...] /stack[1] (pnv-phb4-pec-stack) [...] /stack[2] (pnv-phb4-pec-stack) [...] Cc: C=C3=A9dric Le Goater Cc: David Gibson Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Greg Kurz Reviewed-by: C=C3=A9dric Le Goater --- hw/pci-host/pnv_phb4_pec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/pci-host/pnv_phb4_pec.c b/hw/pci-host/pnv_phb4_pec.c index 911d147ffd..565345a018 100644 --- a/hw/pci-host/pnv_phb4_pec.c +++ b/hw/pci-host/pnv_phb4_pec.c @@ -397,6 +397,9 @@ static void pnv_pec_realize(DeviceState *dev, Error **e= rrp) return; } } + for (; i < PHB4_PEC_MAX_STACKS; i++) { + object_unparent(OBJECT(&pec->stacks[i])); + } =20 /* Initialize the XSCOM regions for the PEC registers */ snprintf(name, sizeof(name), "xscom-pec-%d.%d-nest", pec->chip_id, --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664142; cv=none; d=zohomail.com; s=zohoarc; b=UIH9yI80gFzy2LjNMBFDXTRKLHbZhxgcFdTLjKhS0RJPSqDQlWC4p3qHERyfwSklCIJYUqMOHYqYRa5if2g5kqRLfOTPqZq6d4+5aBZuEAhHc6O+ZC3a7Ml7VE5I+s9OUmDC8vZMcUlf1pyAUTSBPltX7nj7GvYuxmrhpOqEgc0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664142; 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=AIkdQS9pj4j1ItpXU0icT5OdJ7ajxaVwCX3j8UN49TQ=; b=A2P44/H5BOTtUx7AA16fBUd23Be4+9a1htjSAN7Jc1aywfNwdoFzHJpGLy/mQRaGxNB0UX/0ohJo/c9q33dB6284ceDDrQLfOiW0oZMJWqCrymG8LA1CwGdiR0ThfZfu5DaSGw7vw9f5iRFHMKDjx6/SmnqCh1pSpsRQp8vmYkw= 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 1590664142319571.35378484158; Thu, 28 May 2020 04:09:02 -0700 (PDT) Received: from localhost ([::1]:44870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGPF-0005NH-0s for importer@patchew.org; Thu, 28 May 2020 07:09:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLG-0005ix-Ip for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:38130 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 1jeGLD-0006eS-KQ for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:54 -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-263-VIrYnpmgMCCN0xm6Z5AZEw-1; Thu, 28 May 2020 07:04:49 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 336298014D7; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 00EA77A8B4; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id E710411358C4; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663890; 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=AIkdQS9pj4j1ItpXU0icT5OdJ7ajxaVwCX3j8UN49TQ=; b=Sw4tysi5Be7j1WP4na8lC4H1vrFgluRsnGz+PKG0HUhqCV+abSI3ekq8Q8tSGw/zdIBZQk AI6lJBbmYY6XBJxd7BMwL0KMBGk//FtyUfULu2oTqVZ9tzH45p46f8pZvCKNmB57f+MzNY GntFU0QoFiQbhrDhvP6YQ4mIG6rojb4= X-MC-Unique: VIrYnpmgMCCN0xm6Z5AZEw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 12/24] MAINTAINERS: Make section PowerNV cover pci-host/pnv* as well Date: Thu, 28 May 2020 13:04:32 +0200 Message-Id: <20200528110444.20456-13-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11: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, RCVD_IN_MSPIKE_H3=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: berrange@redhat.com, ehabkost@redhat.com, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , pbonzini@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Cc: C=C3=A9dric Le Goater Cc: David Gibson Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster Acked-by: David Gibson --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3690f313c3..3bd5c613f5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1213,7 +1213,9 @@ S: Maintained F: hw/ppc/pnv* F: hw/intc/pnv* F: hw/intc/xics_pnv.c +F: hw/pci-host/pnv* F: include/hw/ppc/pnv* +F: include/hw/pci-host/pnv* F: pc-bios/skiboot.lid F: tests/qtest/pnv* =20 --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664090; cv=none; d=zohomail.com; s=zohoarc; b=ODdltYITdfBG09iGKNqkishCrqQk/6m4RwTz2IfGw3BgHC6k6PmsnellhyE7rC+cN7UXUNJgz/rtJdoXra0QYdPpkLGxpJ6BrzyYqiUpOCwhIiGhSxAkSH283lQzO7vOY4ayjKxQr0PPQFLphYR0fJ+IWGMEZy+EPkZLecPFeNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664090; 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=bo1ZS8IcNDF+WEs7z9SfDwSdAgJyoDz0rs2Q0gsnYNI=; b=P0ccQqJJcEMmAbEl7+gR57QEaQBVBRgAkBGKGIXbVKTO2Nlvw+GnYlKMjHSXbaE22LSMB4J6NBJ5QlPbzgad/J0zCZRrLzbbpCtBMJHQ5qcSk4FbQT/HF8gel+D0geYafycSFgsPiexcPr/aaPfAiSV3JqaqHMvnl6GptGyd6HM= 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 1590664090714818.7643732933236; Thu, 28 May 2020 04:08:10 -0700 (PDT) Received: from localhost ([::1]:40200 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGOP-00034M-D1 for importer@patchew.org; Thu, 28 May 2020 07:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49794) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLG-0005iX-DB for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:36356 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 1jeGLD-0006eG-Lq for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:54 -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-488-Wjo3PPcDPP-afdBlRJFEpw-1; Thu, 28 May 2020 07:04:49 -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 592ED107ACCD; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 24CAF2B4CF; Thu, 28 May 2020 11:04:47 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id ECFDE11358C6; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663890; 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=bo1ZS8IcNDF+WEs7z9SfDwSdAgJyoDz0rs2Q0gsnYNI=; b=VHtELbemEqUEjSAzAN1ybT5aqdl8E38Yi4iw8uyHtYywTLwAnvcPI9i8xW2qxg4RF51xgy 7WOdhGerQoTNs6++4/PIetVyAIxeZ124VWMSC/AESLaZ0Ka8FBFG5VaGXCJ7hg2RNmRSzk JJm5JPFKjT/swUaj4P7hmGP09kCiaYE= X-MC-Unique: Wjo3PPcDPP-afdBlRJFEpw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 13/24] ppc4xx: Drop redundant device realization Date: Thu, 28 May 2020 13:04:33 +0200 Message-Id: <20200528110444.20456-14-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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 , berrange@redhat.com, ehabkost@redhat.com, pbonzini@redhat.com, =?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) object_property_set_bool(OBJECT(dev), true, "realized", ...) right after qdev_init_nofail(dev) does nothing, because qdev_init_nofail() already realizes. Drop. Cc: BALATON Zoltan Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: BALATON Zoltan Reviewed-by: Thomas Huth --- hw/ppc/ppc440_uc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/ppc/ppc440_uc.c b/hw/ppc/ppc440_uc.c index b30e093cbb..dc318c7aa7 100644 --- a/hw/ppc/ppc440_uc.c +++ b/hw/ppc/ppc440_uc.c @@ -1370,12 +1370,10 @@ void ppc460ex_pcie_init(CPUPPCState *env) dev =3D qdev_create(NULL, TYPE_PPC460EX_PCIE_HOST); qdev_prop_set_int32(dev, "dcrn-base", DCRN_PCIE0_BASE); qdev_init_nofail(dev); - object_property_set_bool(OBJECT(dev), true, "realized", NULL); ppc460ex_pcie_register_dcrs(PPC460EX_PCIE_HOST(dev), env); =20 dev =3D qdev_create(NULL, TYPE_PPC460EX_PCIE_HOST); qdev_prop_set_int32(dev, "dcrn-base", DCRN_PCIE1_BASE); qdev_init_nofail(dev); - object_property_set_bool(OBJECT(dev), true, "realized", NULL); ppc460ex_pcie_register_dcrs(PPC460EX_PCIE_HOST(dev), env); } --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664364; cv=none; d=zohomail.com; s=zohoarc; b=E1Od6bE+nk2vzWXFvqReBDovssjCBlb6bAQq9xkxjwYM+J4bTrsnX0AmfrXNY7cJwcYOQqvIMPnF2UTfM8phVfP90Je1IrC331k82DuNNwMyvtkxUyGN2d1vKItfDLiHutjAoD/ZWRqqsJZKYKlHzzRMNavGo21MpFT8DCAU0Bs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664364; 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=v12BUw10/dQO7KVAmyu8RTfUhGnOFap3qI48nfbmbqw=; b=h7LL6s3AeYuFym1D/Y2MCoWPVPZFN0OFOyC5/V4+4DiJSXg33epRu/1tsw4Nm2PAZt6oAWbi4pg5Y9IOcrr8CHzAVng2gMf3W/sNw/DCi8hRusvyRjSZ2equ79rT/Q5jlnzkioWNkbp9xxrVbyAbBjqYDPXjtw0uaF8snE04zmU= 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 1590664364129318.4194198061625; Thu, 28 May 2020 04:12:44 -0700 (PDT) Received: from localhost ([::1]:33812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGSo-0004bK-T3 for importer@patchew.org; Thu, 28 May 2020 07:12:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLH-0005le-Kv for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:55 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:40640 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 1jeGLE-0006fH-9s for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:55 -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-47k82ui3MjuJ2UOq2ojOdg-1; Thu, 28 May 2020 07:04:49 -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 640268018A3; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 032282B4CE; Thu, 28 May 2020 11:04:48 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id F35A511358C7; Thu, 28 May 2020 13:04:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663891; 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=v12BUw10/dQO7KVAmyu8RTfUhGnOFap3qI48nfbmbqw=; b=RkMN0iJDwL2n5oYWObL8A06LXynQ3NX7h3KtzNzQPe9Fi2lgNy9PVYVf4twty23q6/adVR FoLP2KEvjOpNLDr+5xUHY9j/1tLUrAiI0yyrGUkFKG0deJ+v55E6iOPulO8lKXRPTi/aKj MCf4SmXyV4HDOfwVomUf842IN+oD6w0= X-MC-Unique: 47k82ui3MjuJ2UOq2ojOdg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 14/24] macio: Put "macio-nvram" device on the macio bus Date: Thu, 28 May 2020 13:04:34 +0200 Message-Id: <20200528110444.20456-15-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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.61; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 06:31:20 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, 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: berrange@redhat.com, ehabkost@redhat.com, Mark Cave-Ayland , qemu-ppc@nongnu.org, pbonzini@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" macio_oldworld_init() creates a "macio-nvram", sysbus device, but neglects to but it on a bus. Put it on the macio bus. Affects machine g3beige. Visible in "info qtree": bus: macio.0 type macio-bus [...] + dev: macio-nvram, id "" + size =3D 8192 (0x2000) + it_shift =3D 4 (0x4) This also makes it a QOM child of macio-oldworld. Visible in "info qom-tree": /machine (g3beige-machine) [...] /unattached (container) [...] /device[6] (macio-oldworld) [...] - /device[7] (macio-nvram) - /macio-nvram[0] (qemu:memory-region) + /nvram (macio-nvram) + /macio-nvram[0] (qemu:memory-region) [rest of device[*] renumbered...] Cc: Mark Cave-Ayland Cc: David Gibson Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/macio/macio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index b3dddf8be7..ebc96cc8f6 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -245,7 +245,8 @@ static void macio_oldworld_init(Object *obj) =20 macio_init_child_obj(s, "cuda", &s->cuda, sizeof(s->cuda), TYPE_CUDA); =20 - object_initialize(&os->nvram, sizeof(os->nvram), TYPE_MACIO_NVRAM); + macio_init_child_obj(s, "nvram", &os->nvram, sizeof(os->nvram), + TYPE_MACIO_NVRAM); dev =3D DEVICE(&os->nvram); qdev_prop_set_uint32(dev, "size", 0x2000); qdev_prop_set_uint32(dev, "it_shift", 4); --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664317; cv=none; d=zohomail.com; s=zohoarc; b=bhF2dtM2GSUH9plmq9MKIZSCgZSLdvV481Q7+9lbeBlUGEaqqJaHmc9rr/AGpZ6AL+A79HukfUJ7wnBw8zQJonRvbHc/GhzQzoanuAdhiITIJxG4Ze+z8XYfk4LqHtld5+xXv7JId7thtQ/bd4xK+QfvvSfKsow+Riqu/6sMkyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664317; 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=2UWKt2Q0E141d17U5/8Viy0coRDs6dzYX7vQSjZZSt4=; b=lv06GTHAfBqc4c5uR5SA3W/Vgpj4q+lR8bKIv70EW1egcbKVTtRHSvl7HzJK4DdT07n6kU378v2tACJX/8VAums1cxGckmg+w2KnDAaKKV1JQo5dn8o4Lco8+/9gsMPIdO6KdWBTtkQDtuPd5k1HPmm/bYHwztvm0HU193mNC6c= 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 1590664317125965.1180723510458; Thu, 28 May 2020 04:11:57 -0700 (PDT) Received: from localhost ([::1]:59698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGS1-00039o-NP for importer@patchew.org; Thu, 28 May 2020 07:11:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLL-0005oT-E7 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:59 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:56064 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 1jeGLE-0006hG-Vk for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:59 -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-113-Airm7c_-OAW6oXWfbrGdcg-1; Thu, 28 May 2020 07:04:50 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 53878107ACF4; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 207FC7A8A6; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 059F511358CA; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663892; 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=2UWKt2Q0E141d17U5/8Viy0coRDs6dzYX7vQSjZZSt4=; b=RMHeX/WSLHhwjHTWZy4eWlUavmCxZifcY63YM0DWTUlvsYVoO1eOgCidBRvf4k0i2C+T7T pKYeg+UFJyfM8ybvzqHcyGsTfMogdQih1/UdGnm9KULPXz6tITMAHr/cy/YmJTLK+K2LWR t8D21beQF9FB+xzDgEyL6bVBEaTK4XQ= X-MC-Unique: Airm7c_-OAW6oXWfbrGdcg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 15/24] macio: Fix macio-bus to be a subtype of System bus Date: Thu, 28 May 2020 13:04:35 +0200 Message-Id: <20200528110444.20456-16-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 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, 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: berrange@redhat.com, ehabkost@redhat.com, Mark Cave-Ayland , qemu-ppc@nongnu.org, pbonzini@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The devices we plug into the macio-bus are all sysbus devices (DeviceClass member bus_type is TYPE_SYSTEM_BUS), but macio-bus does not derive from TYPE_SYSTEM_BUS. Fix that. "info qtree" now shows the devices' mmio ranges, as it should Cc: Mark Cave-Ayland Cc: David Gibson Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/misc/macio/macio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/misc/macio/macio.c b/hw/misc/macio/macio.c index ebc96cc8f6..53a9fd5696 100644 --- a/hw/misc/macio/macio.c +++ b/hw/misc/macio/macio.c @@ -492,7 +492,7 @@ static void macio_class_init(ObjectClass *klass, void *= data) =20 static const TypeInfo macio_bus_info =3D { .name =3D TYPE_MACIO_BUS, - .parent =3D TYPE_BUS, + .parent =3D TYPE_SYSTEM_BUS, .instance_size =3D sizeof(MacIOBusState), }; =20 --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664184; cv=none; d=zohomail.com; s=zohoarc; b=libh7XUqx0buVa+zc7X1uYWxLTCKBisOvOUuoFepcNNOyT5EGNfpWzIiMlO7UHLLW3QE7jFfZKPlmylGPLtBNomfJsiXJcZvJKFP8QQW6J1m/Z36O6Bbko88bsbrB3dIpKYmuP6EOPQcKfIbUVbG18HMUvLatx06Nrv3FPyVDKI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664184; 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=Bfy+Oh8nlUt028pTCxJbbHy0rLw3m3T63uQUxAuRSvM=; b=H/D5feo9/wex7qEah4CujG2iQECqu3rWF98qKFF7cZ6M3Cv6KqdfpbpqwxHblbAcJI0fluLsx1kz7eia2N5me/QWkGHcs9dIuS8D0k0PT2nYMrgmbwi9NbDEO3pc3xlS5gOAb1qXxVHCdAT+Z3Yvp1HDkJB3sd8FjWjGY01I4C4= 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 159066418475848.11447523247671; Thu, 28 May 2020 04:09:44 -0700 (PDT) Received: from localhost ([::1]:49624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGPv-0007FI-I6 for importer@patchew.org; Thu, 28 May 2020 07:09:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLJ-0005nx-S2 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:59 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:21756 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 1jeGLE-0006hC-Og for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:57 -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-113-ra6mxHWPO3qs9n-Rjisggg-1; Thu, 28 May 2020 07:04:50 -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 571051005512; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 259C35D9EF; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 0B85B11358CB; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663892; 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=Bfy+Oh8nlUt028pTCxJbbHy0rLw3m3T63uQUxAuRSvM=; b=hMSlqtQvpM3h6knP+FYDmFBpQ55GlVr2l5O1wyajgh8pJ4NSNI3Aq6yjoBaA94LYqtvQgM 2ex8j7EIIBNwfjW5EJ/Xzoo0tZAudmLxjJR3YTua4nRgEA0Ew4/MwYA9g35dlUJW357Kjy Byo1129h/t+hbicWEVWtwqVLQVvmNno= X-MC-Unique: ra6mxHWPO3qs9n-Rjisggg-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 16/24] ppc/pnv: Put "*-pnv-chip" and "pnv-xive" on the main system bus Date: Thu, 28 May 2020 13:04:36 +0200 Message-Id: <20200528110444.20456-17-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11: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, RCVD_IN_MSPIKE_H3=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: berrange@redhat.com, ehabkost@redhat.com, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , pbonzini@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) pnv_init() creates "power10_v1.0-pnv-chip", "power8_v2.0-pnv-chip", "power8e_v2.1-pnv-chip", "power8nvl_v1.0-pnv-chip", or "power9_v2.0-pnv-chip" sysbus devices in a way that leaves them unplugged. pnv_chip_power9_instance_init() creates a "pnv-xive" sysbus device in a way that leaves it unplugged. Create them the common way that puts them into the main system bus. Affects machines powernv8, powernv9, and powernv10. Visible in "info qtree". Here's the change for powernv9: bus: main-system-bus type System + dev: power9_v2.0-pnv-chip, id "" + chip-id =3D 0 (0x0) + ram-start =3D 0 (0x0) + ram-size =3D 1879048192 (0x70000000) + nr-cores =3D 1 (0x1) + cores-mask =3D 72057594037927935 (0xffffffffffffff) + nr-threads =3D 1 (0x1) + num-phbs =3D 6 (0x6) + mmio 000603fc00000000/0000000400000000 [...] + dev: pnv-xive, id "" + ic-bar =3D 1692157036462080 (0x6030203100000) + vc-bar =3D 1689949371891712 (0x6010000000000) + pc-bar =3D 1690499127705600 (0x6018000000000) + tm-bar =3D 1692157036986368 (0x6030203180000) Cc: "C=C3=A9dric Le Goater" Cc: David Gibson Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: C=C3=A9dric Le Goater --- hw/ppc/pnv.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index da637822f9..8d4fc8109a 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -818,7 +818,7 @@ static void pnv_init(MachineState *machine) pnv->chips =3D g_new0(PnvChip *, pnv->num_chips); for (i =3D 0; i < pnv->num_chips; i++) { char chip_name[32]; - Object *chip =3D object_new(chip_typename); + Object *chip =3D OBJECT(qdev_create(NULL, chip_typename)); =20 pnv->chips[i] =3D PNV_CHIP(chip); =20 @@ -1317,8 +1317,8 @@ static void pnv_chip_power9_instance_init(Object *obj) PnvChipClass *pcc =3D PNV_CHIP_GET_CLASS(obj); int i; =20 - object_initialize_child(obj, "xive", &chip9->xive, sizeof(chip9->xive), - TYPE_PNV_XIVE, &error_abort, NULL); + sysbus_init_child_obj(obj, "xive", &chip9->xive, sizeof(chip9->xive), + TYPE_PNV_XIVE); object_property_add_alias(obj, "xive-fabric", OBJECT(&chip9->xive), "xive-fabric"); =20 --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664462; cv=none; d=zohomail.com; s=zohoarc; b=ZSvwFqwPqBzdgKhPQLtEKEXgTj8iunaV6SKdYu70JlZuLMIFeDyzMxxF90u0Q1x83NMhLTfxDxg1pKYBQchs/uPRMC+DotauWF09gerco85WVzKg3seAJ6iAg+fv8Q4MlsGY8rpJkLSPaTcyg99BEGwyQfbxhR9VhA3mp9mXHbw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664462; 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=H83OaysL/sZWH5evVwMxpINm9CXFIom9c+q8wa7qfx4=; b=RLWKop3EhaMqXSlwz9mV4YhTHwN8/XHtrT76e2c4kEwEtZvOjzsbtjpGslN56zmG0uXMGu/pZIQIBEB/sVkt0e7KsKk64ikszmhuEQcLkOx4MFwK3+aUyr/gJ2+Qb56SLVAJI/MHVqrNBAhLK3J7aeTtYcSD4w3FlBv4Dz51QpA= 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 1590664462096948.8970520144744; Thu, 28 May 2020 04:14:22 -0700 (PDT) Received: from localhost ([::1]:41724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGUO-0007sV-R6 for importer@patchew.org; Thu, 28 May 2020 07:14:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLP-0005u1-I2 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:04 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:51655 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 1jeGLF-0006jo-LT for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:03 -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-281-bHgttIUHMSuqd-nfiH2rYA-1; Thu, 28 May 2020 07:04:50 -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 59CAC835B45; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 27A3B19D71; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 117AE11358CF; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663892; 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=H83OaysL/sZWH5evVwMxpINm9CXFIom9c+q8wa7qfx4=; b=ahrnakuhGtmGwyK8+KVG3083XSiSui7y98apr4n2+XXTpCRJi/mTaff0tWOQXURiDIwkWd 3hhLocz8Q9iDUr2oXb4RzK0dau6owORC0LijzLrY3C+F2xEeSWocwzYXtFCNQj1oIfdbJ7 NVH1FYiO1fXvB8i59fHNil0j+iGtFNs= X-MC-Unique: bHgttIUHMSuqd-nfiH2rYA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 17/24] pnv/psi: Correct the pnv-psi* devices not to be sysbus devices Date: Thu, 28 May 2020 13:04:37 +0200 Message-Id: <20200528110444.20456-18-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 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, 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: berrange@redhat.com, ehabkost@redhat.com, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , pbonzini@redhat.com, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) pnv_chip_power8_instance_init() creates a "pnv-psi-POWER8" sysbus device in a way that leaves it unplugged. pnv_chip_power9_instance_init() and pnv_chip_power10_instance_init() do the same for "pnv-psi-POWER9" and "pnv-psi-POWER10", respectively. These devices aren't actually sysbus devices. Correct that. Cc: "C=C3=A9dric Le Goater" Cc: David Gibson Cc: qemu-ppc@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: C=C3=A9dric Le Goater --- include/hw/ppc/pnv_psi.h | 2 +- hw/ppc/pnv_psi.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/ppc/pnv_psi.h b/include/hw/ppc/pnv_psi.h index f0f5b55197..979fc59f33 100644 --- a/include/hw/ppc/pnv_psi.h +++ b/include/hw/ppc/pnv_psi.h @@ -31,7 +31,7 @@ #define PSIHB_XSCOM_MAX 0x20 =20 typedef struct PnvPsi { - SysBusDevice parent; + DeviceState parent; =20 MemoryRegion regs_mr; uint64_t bar; diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index cfd5b7bc25..82f0769465 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -943,7 +943,7 @@ static void pnv_psi_class_init(ObjectClass *klass, void= *data) =20 static const TypeInfo pnv_psi_info =3D { .name =3D TYPE_PNV_PSI, - .parent =3D TYPE_SYS_BUS_DEVICE, + .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(PnvPsi), .class_init =3D pnv_psi_class_init, .class_size =3D sizeof(PnvPsiClass), --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664185; cv=none; d=zohomail.com; s=zohoarc; b=ggSyFsjE0CQ0wcegx4spk9mA4PQQPOZUMDEFW/trR9FG51946xUQubqXiUJc99pnUZ+I4p4Xn1kh+LhVnbG72Arn+M1GB4SNkHZ18kbXEdF0kki1iAniaZ7tSCrU85nKSxC3XETdnJsKfSw3DajQyNocYHgX3X+k5++pa4SVox0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664185; 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=OK+DIJ+nBK50yEZJWn7zCUr/RDhXkLTJsn2cPyz+Rw0=; b=cqBUIWOcHDL2z4wSZCnafredZyhsp4mV2FVKtFG6s8nnMUUXZBZNYmZiBsT6IDVqkhXM/8MOgW+JohNlWKNnuU/9dbC/1u1zHM8Kbd2DS/tHv+gzLqoEmxfw0oHQ0WIXQRQVHOLRp4UC2TJHQWbesaIxufhskZlawkkjbWKm6+E= 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 1590664185892792.025719173734; Thu, 28 May 2020 04:09:45 -0700 (PDT) Received: from localhost ([::1]:49704 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGPw-0007HN-MF for importer@patchew.org; Thu, 28 May 2020 07:09:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLM-0005qJ-5m for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:01 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:54416 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 1jeGLF-0006j3-BC for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:59 -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-301-JPcN9XU3MkqlxQPohX-tkA-1; Thu, 28 May 2020 07:04:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 61249150D; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2D2C5579A5; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1771C11358D0; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663892; 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=OK+DIJ+nBK50yEZJWn7zCUr/RDhXkLTJsn2cPyz+Rw0=; b=UNJui1lCh13kDqqaUOyxxTZZzZbGWZWHV7BRd5CUOT4Qh35tU/Tmqm1feY16xPz59EENyw R7EVBI6y/Od4plsFPwsJ/a2Y6/zCvAazLdT2W3jZqn/ajPqPpgkeV58mZy4PhZX50Aa1Ju J3PYhrKa/U61DpoKf/jKyuqBH/NsMfw= X-MC-Unique: JPcN9XU3MkqlxQPohX-tkA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 18/24] display/sm501 display/ati: Fix to realize "i2c-ddc" Date: Thu, 28 May 2020 13:04:38 +0200 Message-Id: <20200528110444.20456-19-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.120; envelope-from=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 03:11: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, RCVD_IN_MSPIKE_H3=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: berrange@redhat.com, ehabkost@redhat.com, Magnus Damm , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Aleksandar Markovic , qemu-ppc@nongnu.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) sm501_init() and ati_vga_realize() create an "i2c-ddc" device, but neglect to realize it. Affects machines sam460ex, shix, r2d, and fulong2e. In theory, a device becomes real only on realize. In practice, the transition from unreal to real is a fuzzy one. The work to make a device real can be spread between realize methods (fine), instance_init methods (wrong), and board code wiring up the device (fine as long as it effectively happens on realize). Depending on what exactly is done where, a device can work even when we neglect to realize it. This one appears to work. Nevertheless, it's a clear misuse of the interface. Even when it works today (more or less by chance), it can break tomorrow. Fix by realizing it right away. Visible in "info qom-tree"; here's the change for sam460ex: /machine (sam460ex-machine) [...] /unattached (container) [...] - /device[14] (sii3112) + /device[14] (i2c-ddc) + /device[15] (sii3112) [rest of device[*] renumbered...] Fixes: 4a1f253adb45ac6019971193d5077c4d5d55886a Fixes: c82c7336de58876862e6b4dccbda29e9240fd388 Cc: BALATON Zoltan Cc: qemu-ppc@nongnu.org Cc: Magnus Damm Cc: Philippe Mathieu-Daud=C3=A9 Cc: Aleksandar Markovic Signed-off-by: Markus Armbruster Tested-by: BALATON Zoltan Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/display/ati.c | 2 ++ hw/display/sm501.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/hw/display/ati.c b/hw/display/ati.c index 065f197678..5c71e5f295 100644 --- a/hw/display/ati.c +++ b/hw/display/ati.c @@ -929,6 +929,8 @@ static void ati_vga_realize(PCIDevice *dev, Error **err= p) bitbang_i2c_init(&s->bbi2c, i2cbus); I2CSlave *i2cddc =3D I2C_SLAVE(qdev_create(BUS(i2cbus), TYPE_I2CDDC)); i2c_set_slave_address(i2cddc, 0x50); + object_property_set_bool(OBJECT(i2cddc), true, "realized", + &error_abort); =20 /* mmio register space */ memory_region_init_io(&s->mm, OBJECT(s), &ati_mm_ops, s, diff --git a/hw/display/sm501.c b/hw/display/sm501.c index acc692531a..fbedc56715 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1816,6 +1816,8 @@ static void sm501_init(SM501State *s, DeviceState *de= v, /* ddc */ I2CDDCState *ddc =3D I2CDDC(qdev_create(BUS(s->i2c_bus), TYPE_I2CDDC)); i2c_set_slave_address(I2C_SLAVE(ddc), 0x50); + object_property_set_bool(OBJECT(ddc), true, "realized", + &error_abort); =20 /* mmio */ memory_region_init(&s->mmio_region, OBJECT(dev), "sm501.mmio", MMIO_SI= ZE); --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664626; cv=none; d=zohomail.com; s=zohoarc; b=HGMef//kUo72+Ft5JWAKjKt6+4rHVk8JZz8xDu61MJZTj8CEyqpJQR13CKR5erbK17EfSaGBgRgHbrDer+nlEKf1Q/9wcCavZMiC25KHywxJd2igdjszq2jnZy+znXTB3IcuvcU//0MVK3M7i3CF1kacZp2GM9mPbmm0NuUfM0k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664626; 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=L//IVDXLIRjMfn0cHcrOfivCgO41+dzR/XIeCVVH65g=; b=BM+q+soYHj8WUaDGmdavZpS3IcQyVOAf2MKVCLjGe3PIPneuYmffTSJLK5EbbFqnNzZQ4uHOe8ESo6iYb5f961AJQbXG4ZbYQ/ASoWLnagGekZfHl5XIuBkhD3V4QuCg9AcC0PLUWZEaU35/kmpEFgIdOxpltZ9UysWT/2gtb2o= 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 1590664626830259.34101968234825; Thu, 28 May 2020 04:17:06 -0700 (PDT) Received: from localhost ([::1]:55096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGX3-00053h-F9 for importer@patchew.org; Thu, 28 May 2020 07:17:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLS-0005vu-Gh for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:48145 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 1jeGLH-0006pK-LX for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:06 -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-50-JoNcjOr7P5edMry9zmjZLQ-1; Thu, 28 May 2020 07:04:51 -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 DDA6B107ACF7; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C4FF5D9F5; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 1D8BB11358D2; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663894; 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=L//IVDXLIRjMfn0cHcrOfivCgO41+dzR/XIeCVVH65g=; b=CY/2Kyg2QyB67Y8ew5o1pXpUv2g2HOu13mZ6S+n1gXWQhbGtj8dVpbH9JTFcQiNb7DRqT+ jFsy8BhZJKiBFUCroOsG//77kK1jy3lPsiQsSgGTlN4idiydcGwHDZ2goeuopDFo5PI8+5 2eySc85OZQI0xbXz5UZO/aCHfv1KKvA= X-MC-Unique: JoNcjOr7P5edMry9zmjZLQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 19/24] riscv: Fix to put "riscv.hart_array" devices on sysbus Date: Thu, 28 May 2020 13:04:39 +0200 Message-Id: <20200528110444.20456-20-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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: berrange@redhat.com, ehabkost@redhat.com, Sagar Karandikar , Bastian Koppelmann , Alistair Francis , qemu-riscv@nongnu.org, pbonzini@redhat.com, Palmer Dabbelt Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" riscv_sifive_e_soc_init(), riscv_sifive_u_soc_init(), spike_board_init(), spike_v1_10_0_board_init(), spike_v1_09_1_board_init(), and riscv_virt_board_init() create "riscv-hart_array" sysbus devices in a way that leaves them unplugged. Create them the common way that puts them into the main system bus. Affects machines sifive_e, sifive_u, spike, spike_v1.10, spike_v1.9.1, and virt. Visible in "info qtree", here's the change for sifive_e: bus: main-system-bus type System + dev: riscv.hart_array, id "" + num-harts =3D 1 (0x1) + hartid-base =3D 0 (0x0) + cpu-type =3D "sifive-e31-riscv-cpu" dev: sifive_soc.gpio, id "" Cc: Palmer Dabbelt Cc: Alistair Francis Cc: Sagar Karandikar Cc: Bastian Koppelmann Cc: qemu-riscv@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Alistair Francis --- hw/riscv/sifive_e.c | 5 ++--- hw/riscv/sifive_u.c | 14 ++++++-------- hw/riscv/spike.c | 12 ++++++------ hw/riscv/virt.c | 4 ++-- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/hw/riscv/sifive_e.c b/hw/riscv/sifive_e.c index b53109521e..8831e6728e 100644 --- a/hw/riscv/sifive_e.c +++ b/hw/riscv/sifive_e.c @@ -120,9 +120,8 @@ static void riscv_sifive_e_soc_init(Object *obj) MachineState *ms =3D MACHINE(qdev_get_machine()); SiFiveESoCState *s =3D RISCV_E_SOC(obj); =20 - object_initialize_child(obj, "cpus", &s->cpus, - sizeof(s->cpus), TYPE_RISCV_HART_ARRAY, - &error_abort, NULL); + sysbus_init_child_obj(obj, "cpus", &s->cpus, + sizeof(s->cpus), TYPE_RISCV_HART_ARRAY); object_property_set_int(OBJECT(&s->cpus), ms->smp.cpus, "num-harts", &error_abort); sysbus_init_child_obj(obj, "riscv.sifive.e.gpio0", diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index 4299bdf480..bb69fd8e48 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -491,10 +491,9 @@ static void riscv_sifive_u_soc_init(Object *obj) &error_abort, NULL); qdev_prop_set_uint32(DEVICE(&s->e_cluster), "cluster-id", 0); =20 - object_initialize_child(OBJECT(&s->e_cluster), "e-cpus", - &s->e_cpus, sizeof(s->e_cpus), - TYPE_RISCV_HART_ARRAY, &error_abort, - NULL); + sysbus_init_child_obj(OBJECT(&s->e_cluster), "e-cpus", + &s->e_cpus, sizeof(s->e_cpus), + TYPE_RISCV_HART_ARRAY); qdev_prop_set_uint32(DEVICE(&s->e_cpus), "num-harts", 1); qdev_prop_set_uint32(DEVICE(&s->e_cpus), "hartid-base", 0); qdev_prop_set_string(DEVICE(&s->e_cpus), "cpu-type", SIFIVE_E_CPU); @@ -504,10 +503,9 @@ static void riscv_sifive_u_soc_init(Object *obj) &error_abort, NULL); qdev_prop_set_uint32(DEVICE(&s->u_cluster), "cluster-id", 1); =20 - object_initialize_child(OBJECT(&s->u_cluster), "u-cpus", - &s->u_cpus, sizeof(s->u_cpus), - TYPE_RISCV_HART_ARRAY, &error_abort, - NULL); + sysbus_init_child_obj(OBJECT(&s->u_cluster), "u-cpus", + &s->u_cpus, sizeof(s->u_cpus), + TYPE_RISCV_HART_ARRAY); qdev_prop_set_uint32(DEVICE(&s->u_cpus), "num-harts", ms->smp.cpus - 1= ); qdev_prop_set_uint32(DEVICE(&s->u_cpus), "hartid-base", 1); qdev_prop_set_string(DEVICE(&s->u_cpus), "cpu-type", SIFIVE_U_CPU); diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c index d0c4843712..01d52e758e 100644 --- a/hw/riscv/spike.c +++ b/hw/riscv/spike.c @@ -169,8 +169,8 @@ static void spike_board_init(MachineState *machine) unsigned int smp_cpus =3D machine->smp.cpus; =20 /* Initialize SOC */ - object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc= ), - TYPE_RISCV_HART_ARRAY, &error_abort, NULL); + sysbus_init_child_obj(OBJECT(machine), "soc", &s->soc, sizeof(s->soc), + TYPE_RISCV_HART_ARRAY); object_property_set_str(OBJECT(&s->soc), machine->cpu_type, "cpu-type", &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts", @@ -275,8 +275,8 @@ static void spike_v1_10_0_board_init(MachineState *mach= ine) } =20 /* Initialize SOC */ - object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc= ), - TYPE_RISCV_HART_ARRAY, &error_abort, NULL); + sysbus_init_child_obj(OBJECT(machine), "soc", &s->soc, sizeof(s->soc), + TYPE_RISCV_HART_ARRAY); object_property_set_str(OBJECT(&s->soc), SPIKE_V1_10_0_CPU, "cpu-type", &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts", @@ -365,8 +365,8 @@ static void spike_v1_09_1_board_init(MachineState *mach= ine) } =20 /* Initialize SOC */ - object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc= ), - TYPE_RISCV_HART_ARRAY, &error_abort, NULL); + sysbus_init_child_obj(OBJECT(machine), "soc", &s->soc, sizeof(s->soc), + TYPE_RISCV_HART_ARRAY); object_property_set_str(OBJECT(&s->soc), SPIKE_V1_09_1_CPU, "cpu-type", &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts", diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c index 7ce28895bc..0c5bcdc37f 100644 --- a/hw/riscv/virt.c +++ b/hw/riscv/virt.c @@ -485,8 +485,8 @@ static void riscv_virt_board_init(MachineState *machine) unsigned int smp_cpus =3D machine->smp.cpus; =20 /* Initialize SOC */ - object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc= ), - TYPE_RISCV_HART_ARRAY, &error_abort, NULL); + sysbus_init_child_obj(OBJECT(machine), "soc", &s->soc, sizeof(s->soc), + TYPE_RISCV_HART_ARRAY); object_property_set_str(OBJECT(&s->soc), machine->cpu_type, "cpu-type", &error_abort); object_property_set_int(OBJECT(&s->soc), smp_cpus, "num-harts", --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664588; cv=none; d=zohomail.com; s=zohoarc; b=ia5zL6935y4JzsYb2Fv27+8TAxGe/MViwuNCzcZ7A44k7oMvP75g/NoipsaUdtJ/sjX0Me8BKco7o+siQF82AUZE8gs+iKXAgyhWImf671Vzo3Ka62E5M+7kiSZzCBQZM1hQ+MWZQA8BTp5YPb2jVDt27JyB/PPOpc1vcEP7joM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664588; 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=OUI5M0cu30wMn9LtbAX0PTAgj0WQN78NeYD3SapUd1A=; b=BczXZ1iPSPyXQ9BPFC0d9GO4yKuDN+HdUjg72dRoyPv4QO5iSrbtZTbhnymcDG/ufod3nX5P4V0zZGSEP+buezLZZOD0v1coM6RYZbMsmTWRAxNKaqmpK4wv0iND7L8N0+hmxxMvEnlTfpj2A3esNcHaAGXBIKrN9KEfGYaXKe8= 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 1590664588209915.0421988644754; Thu, 28 May 2020 04:16:28 -0700 (PDT) Received: from localhost ([::1]:52446 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGWQ-00040x-U7 for importer@patchew.org; Thu, 28 May 2020 07:16:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLS-0005vh-Dx for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:07 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:60421 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 1jeGLH-0006oV-AZ for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:05 -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-20-sxq_QsZxPOq1IWgtLFB3Ag-1; Thu, 28 May 2020 07:04:51 -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 BD070107ACF5; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C4B75D9F3; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 241FE11358D3; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663894; 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=OUI5M0cu30wMn9LtbAX0PTAgj0WQN78NeYD3SapUd1A=; b=KyyCLEy0WgkHiQaJtdTxMm+0rVJ/yhwB10Pfc7CdiQ3akbaIl8sev9+orKVr8dbSEY0G5m JeGHGUZZukuNSdozLfvWuiuC2hnHhUM3xPbEhrbQJKubMZhLBQXfvVxanz9bcNMMzrzgQF 476XSmhQAEnnw7dBVSF1y+gOa5EaIf8= X-MC-Unique: sxq_QsZxPOq1IWgtLFB3Ag-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 20/24] riscv: Fix type of SiFive[EU]SocState, member parent_obj Date: Thu, 28 May 2020 13:04:40 +0200 Message-Id: <20200528110444.20456-21-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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: berrange@redhat.com, ehabkost@redhat.com, Sagar Karandikar , Bastian Koppelmann , Alistair Francis , qemu-riscv@nongnu.org, pbonzini@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Palmer Dabbelt Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Device "riscv.sifive.e.soc" is a direct subtype of TYPE_DEVICE, but its instance struct SiFiveESoCState's member @parent_obj is SysBusDevice instead of DeviceState. Correct that. Same for "riscv.sifive.u.soc"'s instance struct SiFiveUSoCState. Cc: Palmer Dabbelt Cc: Alistair Francis Cc: Sagar Karandikar Cc: Bastian Koppelmann Cc: qemu-riscv@nongnu.org Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Alistair Francis --- include/hw/riscv/sifive_e.h | 2 +- include/hw/riscv/sifive_u.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/hw/riscv/sifive_e.h b/include/hw/riscv/sifive_e.h index 25ce7aa9d5..f05644df7c 100644 --- a/include/hw/riscv/sifive_e.h +++ b/include/hw/riscv/sifive_e.h @@ -29,7 +29,7 @@ =20 typedef struct SiFiveESoCState { /*< private >*/ - SysBusDevice parent_obj; + DeviceState parent_obj; =20 /*< public >*/ RISCVHartArrayState cpus; diff --git a/include/hw/riscv/sifive_u.h b/include/hw/riscv/sifive_u.h index 16c297ec5f..5f62cf5f85 100644 --- a/include/hw/riscv/sifive_u.h +++ b/include/hw/riscv/sifive_u.h @@ -31,7 +31,7 @@ =20 typedef struct SiFiveUSoCState { /*< private >*/ - SysBusDevice parent_obj; + DeviceState parent_obj; =20 /*< public >*/ CPUClusterState e_cluster; --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590664752; cv=none; d=zohomail.com; s=zohoarc; b=irBjorUTzjSMin5HjnPdejApKsuiyXq9+soexZvVEsH4ujqXM5HR0cVqVY3byCuJpJaB/W5AtuZBO8LFTIIujGlzh2x6NfFssCfWufSYwEeuqkX6buWdYitlMaF52Mses16IvpBYv0SUw2QwvjBfCyzX4uLblVDwHz96pl1L6p4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664752; 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=C4A42VZrvhks9hEexhTsNXied8TgdkW0Qb1x2XypbtU=; b=YpSR82wKdUX2iEzK/pxDvX1HuO1SUXm6MmdvDhjfchD+2wu3dxaTJAU/mqJMCkcQMoFAZSEXK4a4qF6DEZxt0UweFQUEDBwuDmQKOknxaWlNbk8+cJXS6v6Hqfw4k3Qk+F4FwnRMc2SFzteDU/Kb+ikzHYYMv+zZNhhka+b6nkc= 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 1590664752599208.18563671096047; Thu, 28 May 2020 04:19:12 -0700 (PDT) Received: from localhost ([::1]:34580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGZ5-0000O2-Ai for importer@patchew.org; Thu, 28 May 2020 07:19:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49884) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLR-0005uh-UK for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:05 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:52820 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 1jeGLH-0006pB-F6 for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:05 -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-413-ywa2xU4qPzmIc0qp4qWctw-1; Thu, 28 May 2020 07:04:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C6313107ACF6; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9418DA09AD; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2A16811358D4; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663894; 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=C4A42VZrvhks9hEexhTsNXied8TgdkW0Qb1x2XypbtU=; b=WJdlOfYWxqahOw4nG+tMx210aIiE67MOjCEkn8XfdXjqo1lzMKgQKz/r0BaBaM06NKDTVj MQ39/KBHRPcyhrql/dxMSr29vRKq6uzIrvREXt+DvgBfrcSM4KsC4TeQ+IdU9+VpPnmHdE puJMO1IiUgeDslDxkQ8pGVV3y8XBKH4= X-MC-Unique: ywa2xU4qPzmIc0qp4qWctw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 21/24] sparc/leon3: Fix to put grlib,* devices on sysbus Date: Thu, 28 May 2020 13:04:41 +0200 Message-Id: <20200528110444.20456-22-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 02:50:32 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, 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: berrange@redhat.com, ehabkost@redhat.com, Mark Cave-Ayland , Fabien Chouteau , KONRAD Frederic , pbonzini@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Artyom Tarasenko Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) leon3_generic_hw_init() creates a "grlib,ahbpnp" and a "grlib,apbpnp" sysbus device in a way that leaves them unplugged. Create them the common way that puts them into the main system bus. Affects machine leon3_generic. Visible in "info qtree": bus: main-system-bus type System + dev: grlib,ahbpnp, id "" + mmio 00000000fffff000/0000000000001000 + dev: grlib,apbpnp, id "" + mmio 00000000800ff000/0000000000001000 dev: grlib,irqmp, id "" Cc: Fabien Chouteau Cc: KONRAD Frederic Cc: Mark Cave-Ayland Cc: Artyom Tarasenko Signed-off-by: Markus Armbruster Reviewed-by: KONRAD Frederic Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/sparc/leon3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sparc/leon3.c b/hw/sparc/leon3.c index 8f024dab7b..3facb8c2ae 100644 --- a/hw/sparc/leon3.c +++ b/hw/sparc/leon3.c @@ -213,14 +213,14 @@ static void leon3_generic_hw_init(MachineState *machi= ne) reset_info->sp =3D LEON3_RAM_OFFSET + ram_size; qemu_register_reset(main_cpu_reset, reset_info); =20 - ahb_pnp =3D GRLIB_AHB_PNP(object_new(TYPE_GRLIB_AHB_PNP)); + ahb_pnp =3D GRLIB_AHB_PNP(qdev_create(NULL, TYPE_GRLIB_AHB_PNP)); object_property_set_bool(OBJECT(ahb_pnp), true, "realized", &error_fat= al); sysbus_mmio_map(SYS_BUS_DEVICE(ahb_pnp), 0, LEON3_AHB_PNP_OFFSET); grlib_ahb_pnp_add_entry(ahb_pnp, 0, 0, GRLIB_VENDOR_GAISLER, GRLIB_LEON3_DEV, GRLIB_AHB_MASTER, GRLIB_CPU_AREA); =20 - apb_pnp =3D GRLIB_APB_PNP(object_new(TYPE_GRLIB_APB_PNP)); + apb_pnp =3D GRLIB_APB_PNP(qdev_create(NULL, TYPE_GRLIB_APB_PNP)); object_property_set_bool(OBJECT(apb_pnp), true, "realized", &error_fat= al); sysbus_mmio_map(SYS_BUS_DEVICE(apb_pnp), 0, LEON3_APB_PNP_OFFSET); grlib_ahb_pnp_add_entry(ahb_pnp, LEON3_APB_PNP_OFFSET, 0xFFF, --=20 2.21.3 From nobody Fri Nov 14 20:27:39 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=1590663992; cv=none; d=zohomail.com; s=zohoarc; b=JwEsCg1R9grVr+GMqfFViPJOjwRMJAXpHvqDpZ3g587QYPTfPK3yWBMzZn+zLgHNSh64wtMllGNGGJ0ibpwCk9Tb1VYa+U1rP1Cxt/y3qQEZtUYdy4CPDPcgrErc8UgRpQATFImKOEROpQps42bUtSC/ZALGUcaCWZZLbo9as+c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590663992; 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=cM2KcMTrD5F95rLiMUatA7icdyVLlbFC7tN4WzWCJXY=; b=CxCV7KsGxU43SgZEXzekyn31wHo2WyEHwhCDN2I3Nb5YPxAhSHMpt3mf4A1v20T6TYR9sT2kiJvARXFvBQsWUOPE2Q54fs2Puljbv+o0mbPoOq4DqDkGBinqilT1N81b0yMcvg5yoqTHpD3RJpe6i72gFI0AMEnd2x+mTiiVnwM= 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 1590663992065162.47142314803762; Thu, 28 May 2020 04:06:32 -0700 (PDT) Received: from localhost ([::1]:59860 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGMo-0007eB-DP for importer@patchew.org; Thu, 28 May 2020 07:06:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLI-0005nA-4b for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:57 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31965 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 1jeGLE-0006gf-LK for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:55 -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-38-cl5BDPCMNp-aawKKygrlnw-1; Thu, 28 May 2020 07:04:50 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 87AA38018A4; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 56A4260C05; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 2FDE211358D5; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663892; 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=cM2KcMTrD5F95rLiMUatA7icdyVLlbFC7tN4WzWCJXY=; b=LvfMTewUIoE1mM2PchMMnxDm9dcQ1a7UdhW9JpD+7fazRyRTJJYcRiwu7U+9woKerRqb03 OHbG0Ui4DUua6/0xIhOxdzauPOJoG1QzUSS+8qXIXL7DzuLrpA35r++jPLm2EXKcstX/7H uVt3DbT+ePSVjnUo7BHLzzHPkWWJXFM= X-MC-Unique: cl5BDPCMNp-aawKKygrlnw-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 22/24] qdev: Assert devices are plugged into a bus that can take them Date: Thu, 28 May 2020 13:04:42 +0200 Message-Id: <20200528110444.20456-23-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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: pbonzini@redhat.com, Mark Cave-Ayland , berrange@redhat.com, ehabkost@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" This would have caught some of the bugs I just fixed. Signed-off-by: Markus Armbruster Reviewed-by: Mark Cave-Ayland --- hw/core/qdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 9e5538aeae..b5b42b2616 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -97,6 +97,9 @@ static void bus_add_child(BusState *bus, DeviceState *chi= ld) void qdev_set_parent_bus(DeviceState *dev, BusState *bus) { BusState *old_parent_bus =3D dev->parent_bus; + DeviceClass *dc =3D DEVICE_GET_CLASS(dev); + + assert(dc->bus_type && object_dynamic_cast(OBJECT(bus), dc->bus_type)); =20 if (old_parent_bus) { trace_qdev_update_parent_bus(dev, object_get_typename(OBJECT(dev)), --=20 2.21.3 From nobody Fri Nov 14 20:27:39 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590664432; cv=none; d=zohomail.com; s=zohoarc; b=D3PQPSGgKFFrUE7NxP1rwGiwYBatxTo+f24Qqhalgnk/JCFvv51gDBE0649a6BzynzoN1GUqipgizcU/JswV0vgwADdsvG6ndQn8i+Wh/0KBx6f+E6LLS09+2tt9mwe6E4KJmaqtP6nvPF92Ej//j4XLJOjluf4okFrrpTwBgo8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664432; 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=rvgscpl/ug0EhOZFSapnCmqCdDrH7i6DVH0Hl3rM9oE=; b=gKQ9WyWUJiyA3Fii6SNSrbcIZ8zA890p3soy4NCPZfhPIJSzuKRmcZiA10WLf0ELV+kzfRZY5nwxUpYxRin+mvrFuXXPR+mMBj3z7t39pDIdu7Esqo4u525pvfzF8G9kfz7j1UGqQHo7ELZ5af5Ckr0e379O0Smw7eyREsRYXd8= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159066443278869.23109465810171; Thu, 28 May 2020 04:13:52 -0700 (PDT) Received: from localhost ([::1]:39742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGTv-00075V-Ch for importer@patchew.org; Thu, 28 May 2020 07:13:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49894) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLU-0005wh-3u for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:57535 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 1jeGLJ-0006qG-Fl for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:07 -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-268-mwtVeu1dP-mYa0lJeoRnyA-1; Thu, 28 May 2020 07:04:50 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C99601009441 for ; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 71D83768B0; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3666C11358D6; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663895; 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=rvgscpl/ug0EhOZFSapnCmqCdDrH7i6DVH0Hl3rM9oE=; b=J4rZm87NsHmUXElq46RfNEr4yspPUm/B1mx2AuOX8FxX7IN5F22YkB7pqKg8Igs0XJ5XuE hkgCyCo+Vqo+/Oe9GXRCAr9VXwUph8Ks6j+2tmq23Zucj5D4eOmY+0R6j6k7GrqBE38xWu UICC80sjhu0x6pzLUJWMmu5yrGaJZuk= X-MC-Unique: mwtVeu1dP-mYa0lJeoRnyA-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 23/24] sd: Hide the qdev-but-not-quite thing created by sd_init() Date: Thu, 28 May 2020 13:04:43 +0200 Message-Id: <20200528110444.20456-24-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 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=armbru@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 01:51:20 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, 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: pbonzini@redhat.com, berrange@redhat.com, ehabkost@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Commit 260bc9d8aa "hw/sd/sd.c: QOMify" QOMified only the device itself, not its users. It kept sd_init() around for non-QOMified users. More than four years later, three such users remain: omap1 (machines cheetah, sx1, sx1-v1) and omap2 (machines n800, n810) are not QOMified, and pl181 (machines integratorcp, realview-eb, realview-eb-mpcore, realview-pb-a8 realview-pbx-a9, versatileab, versatilepb, vexpress-a15, vexpress-a9) is not QOMified properly. The issue I presently have with this: an "sd-card" device should plug into an "sd-bus" (its DeviceClass member bus_type says so), but sd_init() leaves it unplugged. This is normally a bug (I just fixed some instances), and I'd like to assert proper pluggedness to prevent regressions. However, the qdev-but-not-quite thing returned by sd_init() would fail the assertion. Meh. Make sd_init() hide it from QOM/qdev. Visible in "info qom-tree", here's the change for cheetah: /machine (cheetah-machine) [...] /unattached (container) [...] /device[5] (serial-mm) /serial (serial) /serial[0] (qemu:memory-region) - /device[6] (sd-card) - /device[7] (omap-gpio) + /device[6] (omap-gpio) [rest of device[*] renumbered...] Cc: "Philippe Mathieu-Daud=C3=A9" Signed-off-by: Markus Armbruster --- hw/sd/sd.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/hw/sd/sd.c b/hw/sd/sd.c index 3c06a0ac6d..7070a116ea 100644 --- a/hw/sd/sd.c +++ b/hw/sd/sd.c @@ -83,6 +83,10 @@ enum SDCardStates { struct SDState { DeviceState parent_obj; =20 + /* If true, created by sd_init() for a non-qdevified caller */ + /* TODO purge them with fire */ + bool me_no_qdev_me_kill_mammoth_with_rocks; + /* SD Memory Card Registers */ uint32_t ocr; uint8_t scr[8]; @@ -129,6 +133,8 @@ struct SDState { bool cmd_line; }; =20 +static void sd_realize(DeviceState *dev, Error **errp); + static const char *sd_state_name(enum SDCardStates state) { static const char *state_name[] =3D { @@ -590,7 +596,7 @@ static void sd_cardchange(void *opaque, bool load, Erro= r **errp) { SDState *sd =3D opaque; DeviceState *dev =3D DEVICE(sd); - SDBus *sdbus =3D SD_BUS(qdev_get_parent_bus(dev)); + SDBus *sdbus; bool inserted =3D sd_get_inserted(sd); bool readonly =3D sd_get_readonly(sd); =20 @@ -601,19 +607,17 @@ static void sd_cardchange(void *opaque, bool load, Er= ror **errp) trace_sdcard_ejected(); } =20 - /* The IRQ notification is for legacy non-QOM SD controller devices; - * QOMified controllers use the SDBus APIs. - */ - if (sdbus) { - sdbus_set_inserted(sdbus, inserted); - if (inserted) { - sdbus_set_readonly(sdbus, readonly); - } - } else { + if (sd->me_no_qdev_me_kill_mammoth_with_rocks) { qemu_set_irq(sd->inserted_cb, inserted); if (inserted) { qemu_set_irq(sd->readonly_cb, readonly); } + } else { + sdbus =3D SD_BUS(qdev_get_parent_bus(dev)); + sdbus_set_inserted(sdbus, inserted); + if (inserted) { + sdbus_set_readonly(sdbus, readonly); + } } } =20 @@ -697,6 +701,7 @@ SDState *sd_init(BlockBackend *blk, bool is_spi) { Object *obj; DeviceState *dev; + SDState *sd; Error *err =3D NULL; =20 obj =3D object_new(TYPE_SD_CARD); @@ -707,13 +712,24 @@ SDState *sd_init(BlockBackend *blk, bool is_spi) return NULL; } qdev_prop_set_bit(dev, "spi", is_spi); - object_property_set_bool(obj, true, "realized", &err); + + /* + * Realizing the device properly would put it into the QOM + * composition tree even though it is not plugged into an + * appropriate bus. That's a no-no. Hide the device from + * QOM/qdev, and call its qdev realize callback directly. + */ + object_ref(obj); + object_unparent(obj); + sd_realize(dev, &err); if (err) { error_reportf_err(err, "sd_init failed: "); return NULL; } =20 - return SD_CARD(dev); + sd =3D SD_CARD(dev); + sd->me_no_qdev_me_kill_mammoth_with_rocks =3D true; + return sd; } =20 void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert) --=20 2.21.3 From nobody Fri Nov 14 20:27:39 2025 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=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1590664301; cv=none; d=zohomail.com; s=zohoarc; b=WHPy94PY8tRkIWmTd6sZY3SfSMsns8tv1l64opLD6Ixb3bhLmMr5bwvG90iuK6Ai6UtmJwIxNyfwH7vAIw0AEwC2o7151Vw60jNcJUE7CRFuEmJNLc24JaZsx/pk6BYYgy+P/9fJuah2MGb5F9WVvfZOIIqWn2EG2RDjdoTjC8o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1590664301; 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=cwI+O0cYfVh+so8ExwmOxnZygZQD/xxNhKBaz7k8SZw=; b=CZyCdZREhLWLC8js3FMys1PHkmvKCT6aFvN+IPsGPm7SrvOjeXQJMH34QGWvTsRKpijmo1hQS4RpFYkvYPZUjatMlZLB/zvlLnwg+2PCqqP8kQm4pwZbgPCEpJZDUNnRD68OJ+xUB6fO0ZbApOZu5XOUohKUzmL+bmyTp+tcjqo= 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) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1590664301844929.1199720965642; Thu, 28 May 2020 04:11:41 -0700 (PDT) Received: from localhost ([::1]:58288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeGRn-0002QO-V2 for importer@patchew.org; Thu, 28 May 2020 07:11:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49854) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeGLM-0005qR-7e for qemu-devel@nongnu.org; Thu, 28 May 2020 07:05:01 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:34535 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 1jeGLF-0006i1-7k for qemu-devel@nongnu.org; Thu, 28 May 2020 07:04:59 -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-80-AG2OaiSAPLmRk-RGvejYTQ-1; Thu, 28 May 2020 07:04:50 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A508B464 for ; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: from blackfin.pond.sub.org (ovpn-112-32.ams2.redhat.com [10.36.112.32]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 72723A09A5; Thu, 28 May 2020 11:04:49 +0000 (UTC) Received: by blackfin.pond.sub.org (Postfix, from userid 1000) id 3C3E011358D8; Thu, 28 May 2020 13:04:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1590663892; 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=cwI+O0cYfVh+so8ExwmOxnZygZQD/xxNhKBaz7k8SZw=; b=hQBlaKbBNAkTNTvJYEYlFTWyjiK8rew3R5x3HGo+GrUB/6L1lXtijvPxa2SOjX98Pgdw5C Pbv242cMefBL4naFaW2FzZSh9k9p1LyLrmChTVRs1m/kHKrb4bDpptfXKCN1tnQdtVhzzP hEnpaVzgEfKqj/B1MDBzJRaZtlSuLX0= X-MC-Unique: AG2OaiSAPLmRk-RGvejYTQ-1 From: Markus Armbruster To: qemu-devel@nongnu.org Subject: [PATCH v2 24/24] qdev: Assert onboard devices all get realized properly Date: Thu, 28 May 2020 13:04:44 +0200 Message-Id: <20200528110444.20456-25-armbru@redhat.com> In-Reply-To: <20200528110444.20456-1-armbru@redhat.com> References: <20200528110444.20456-1-armbru@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.61; envelope-from=armbru@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 06:31:20 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, RCVD_IN_MSPIKE_H2=-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: pbonzini@redhat.com, berrange@redhat.com, ehabkost@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) This would have caught some of the bugs I just fixed. Signed-off-by: Markus Armbruster Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/core/qdev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index b5b42b2616..a68ba674db 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -427,6 +427,19 @@ void qdev_init_nofail(DeviceState *dev) object_unref(OBJECT(dev)); } =20 +static int qdev_assert_realized_properly(Object *obj, void *opaque) +{ + DeviceState *dev =3D DEVICE(object_dynamic_cast(obj, TYPE_DEVICE)); + DeviceClass *dc; + + if (dev) { + dc =3D DEVICE_GET_CLASS(dev); + assert(dev->realized); + assert(dev->parent_bus || !dc->bus_type); + } + return 0; +} + void qdev_machine_creation_done(void) { /* @@ -434,6 +447,9 @@ void qdev_machine_creation_done(void) * only create hotpluggable devices */ qdev_hotplug =3D true; + + object_child_foreach_recursive(object_get_root(), + qdev_assert_realized_properly, NULL); } =20 bool qdev_machine_modified(void) --=20 2.21.3