From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436300; cv=none; d=zohomail.com; s=zohoarc; b=Tp1rU8ceTJGRUfg7w3iBupE4ibiEbxOb/sMl3wHOj91/ahavW/KstPi1Eb3kVdNv7Dz85Ar49PCoXASckO+krjJ0NiXVfsBudAeTTht4wxiCceeRrhLGt5U7gwDDHxRhFoRV+8u7cUVF9vdMourSbpvREsKLiHaPblphpE5zGzQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436300; 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=+umTNh0pbiZOqriKf5LBKbWjyWBQDWdA/pzjCDYec3I=; b=JrRcRPnVG7FktkiGTvl9tO4K8309oqJBbUeM/4j9vIfwxAx+teC+MnsdktnrKcQ4x1jx6vMlO6U5KS6bz5+PkcFOxxoOj3tYDyW2+VR0hKuHT2TXltAHHl8VFx42eSGbXqsIAOKTObU5YE72C5L4A/di5XE10Ov+sC53p8uKBuE= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436300416676.1872871547812; Fri, 3 Feb 2023 06:58:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxTg-0001lU-B7; Fri, 03 Feb 2023 09:55:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxTe-0001gS-8B for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:55:46 -0500 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxTc-0005qu-Ct for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:55:45 -0500 Received: by mail-wr1-x429.google.com with SMTP id h16so4856423wrz.12 for ; Fri, 03 Feb 2023 06:55:43 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t10-20020a5d690a000000b002bbedd60a9asm2175645wru.77.2023.02.03.06.55.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:55:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+umTNh0pbiZOqriKf5LBKbWjyWBQDWdA/pzjCDYec3I=; b=lPgZ9n5K6CrRTxxEvSmCqY3ghiogDX+rg/hCCPZOkska+sJM5KTqot5rIAqQeeMbEQ 9CYZPKlEaD1JEVEF+kffMJtFgVlO8oOgwhEfEfHmCk07Afv/GiyZrYS2/Zm3O1T7lm7B RB1tQMNLC8i1ObzebgXpBUa85iEhQvn5OKyH1oSAkAmo2R1nQfojrEj4k8KgL9HUbApg o0DMjNiDWI5mbBsEn6fLg6qwfmi8U8Gdgc9YaCwJnzO1v30khNF6OZZgmRXFcRoLp7Gh YPLJ2hHcAiiwQT6kw2GT+eag7pUW8LUb9B1kMXe2x+1eBVRweY4Jn51ExYzsFyvWpEKH 1OhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+umTNh0pbiZOqriKf5LBKbWjyWBQDWdA/pzjCDYec3I=; b=XqPh7eDHbbQ3nF8oDcV2pzgF6xUU5knIarf5RVo6EDmY9CiwH7at+rpGAzB8GhPnqy qcENPfUL8opoVtGJoDB/6cBablw61vo2fkn+6MPJ5+kskS+7gEPGvUst1mnssoUqMenv qcCDIuakVLpd1nssZcws5G10Y4Ccm1gesTEpgDrBniQWt+l9c7FbADg5ErKQBNb5E7XG CNzCu2AIuCjsDk8vnQGBX9lB7/3Ak7dWdVYUWD8K0ZoW4E6bMNhfQRPkuMbxSqpK2u4D hclANCRbWhUod7fIIi4gIdWyEvX2jOyI+tnk9CzNS3WGDC1MOv5RZWI0HBBrVvMvJxXe jfbA== X-Gm-Message-State: AO0yUKUr5+57YTVx73B3rLAI9DlqVFkuvfVqEcYQW8+bUL1K2dD8mtkZ qBNghMMqw0JxwyRngWfY4DFMqj6Mx0E4e5kn X-Google-Smtp-Source: AK7set/o5jDjbwYDFHfq3iuwRB+/VIgrYxfU6k0h0zYsbwGWfFzkZLPTtGE020K19LPOqntG4GD8wQ== X-Received: by 2002:adf:a102:0:b0:2bf:942b:ddc with SMTP id o2-20020adfa102000000b002bf942b0ddcmr8142730wro.55.1675436143513; Fri, 03 Feb 2023 06:55:43 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v2 01/15] hw/pci/pcie_sriov: Replace fprintf(error_pretty) -> warn_reportf_err() Date: Fri, 3 Feb 2023 15:55:22 +0100 Message-Id: <20230203145536.17585-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::429; envelope-from=philmd@linaro.org; helo=mail-wr1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436301252100005 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci/pcie_sriov.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index f0bd72e069..93b0624599 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -196,19 +196,17 @@ static void register_vfs(PCIDevice *dev) =20 static void unregister_vfs(PCIDevice *dev) { - Error *local_err =3D NULL; uint16_t num_vfs =3D dev->exp.sriov_pf.num_vfs; uint16_t i; =20 trace_sriov_unregister_vfs(dev->name, PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn), num_vfs); for (i =3D 0; i < num_vfs; i++) { + Error *errp =3D NULL; PCIDevice *vf =3D dev->exp.sriov_pf.vf[i]; - object_property_set_bool(OBJECT(vf), "realized", false, &local_err= ); - if (local_err) { - fprintf(stderr, "Failed to unplug: %s\n", - error_get_pretty(local_err)); - error_free(local_err); + object_property_set_bool(OBJECT(vf), "realized", false, &errp); + if (errp) { + warn_reportf_err(errp, "Failed to unplug: "); } object_unparent(OBJECT(vf)); } --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436207; cv=none; d=zohomail.com; s=zohoarc; b=giiGCmG++Ou4tj4La6WwC4cWIdtb4GcJ8FiPFgwfj8fDQMyzucXYUgJeNUjX2NJ1vQ//VCXNGtPPZPTErUShOTh8L5nZG6uqgc36FzQGfosQYyV6bPlou4ANHSe5iCv9WkwpZ91ZItQ/LHpSs7m3NWL8mmO8MBv5JlVfWSSbgjQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436207; 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=VmSnSD01/Tl/o5f4h6yNnxoegZSIU5/24i6LDQ+aBqo=; b=GllWut0nHsrAlxvwykggEK5iLIll7pWpcDfjGWnCJdp5ttkIzHx/OJMtSsuYlvkJAIwzaUq/DYeCCeXIdBiyhVVXzxj6R2FEaIUJNDhTzo+cItF89KvI2OlOAckXrFBRuazyWUEY13YJvgCK7DSQ1SHW/7kkHLDmH2JFowShjW8= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16754362071744.052865667099468; Fri, 3 Feb 2023 06:56:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxTl-0001pt-AJ; Fri, 03 Feb 2023 09:55:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxTj-0001ow-QX for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:55:51 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxTi-0005sq-77 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:55:51 -0500 Received: by mail-wm1-x32e.google.com with SMTP id q8so4058175wmo.5 for ; Fri, 03 Feb 2023 06:55:49 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id o14-20020a05600c4fce00b003dc1a525f22sm3048705wmq.25.2023.02.03.06.55.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:55:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VmSnSD01/Tl/o5f4h6yNnxoegZSIU5/24i6LDQ+aBqo=; b=UuQ+7F8JTJaNCBvK0caVlsRKIND5qixPlQemm3ezQnSLNOpw7t/kIWpRuXEj8WMylX V7U9BE8cvioEF9ts4AMNpt4WKvrejRAtdYNTIVdbMxkSCyX4e6NKxmeoBbTiPjI8nmky R8dOsTs4eQo4EWFoadIq0IwOn7122cgHPvUqEZ5TGAm8vLUit9LyutoHwwm44D79uHfr lXmWeSgioW8kiZ4JnELMHXN5jIfbd9JtimYbkf524wr0zPE/+LIBW+ufNzJ+QVhV+8Yt Hj/oQGQ59trO3czVUbc1PCE/l6A7AkROapbtKOCm4NMHx4s/kYmiUEMGGu+Y0Bv4LizY SKfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VmSnSD01/Tl/o5f4h6yNnxoegZSIU5/24i6LDQ+aBqo=; b=AGJ7kT5JTIxl+FOl2qPZwgvI2Z0ytwsUgh6H/+EpfqLFLqe6+AkSfdHuPCHWeCTvOf HBSf2av/umEn2SAOGVMiT4DsrbSJ07KhA2O2ug14FxZBZ/IghUFs/tUtD9+6Qjq94MSC OsPwlYdicY7dNiJuUxq8PZlwaZWgi9OikBWWtOmL4KWxlTTZrWjLN/ym/DXV3L3Ybw/h k/6hLrDI50HQ4pLLtUHRthpnkiDxadoDgNKqm/4SjshvZAdFtNCwwYpOUOi8s1f4NEMq ua/C5dM3GKenZiz4F0p61l9ClznAVGkpZ3dggmZ+Vgby4nXe79DY49+WSxdjs2zr0Shp tbIQ== X-Gm-Message-State: AO0yUKVzJDJIJZC3bX+7qYjmZVKENv6pHPy1axUljSSbc8yo0iXenCfC LuE1pAr9YqLTGSHyTYpZy9qsjNMo6U8z5MYk X-Google-Smtp-Source: AK7set9fTxCd4HfK5wxLgC07ypDQlX0V4/QYz7FW2xuFn04uJ2TPW18RpLRLQen7dB2cGAInsZ0xTQ== X-Received: by 2002:a05:600c:3d9a:b0:3df:e8c3:c612 with SMTP id bi26-20020a05600c3d9a00b003dfe8c3c612mr2213485wmb.7.1675436148715; Fri, 03 Feb 2023 06:55:48 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 02/15] hw/qdev: Introduce qdev_unrealize_and_unref() Date: Fri, 3 Feb 2023 15:55:23 +0100 Message-Id: <20230203145536.17585-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436208640100001 Inspired-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster --- hw/core/qdev.c | 9 +++++++++ include/hw/qdev-core.h | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index d759c4602c..b9ef793d51 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -306,6 +306,15 @@ void qdev_unrealize(DeviceState *dev) object_property_set_bool(OBJECT(dev), "realized", false, &error_abort); } =20 +bool qdev_unrealize_and_unref(DeviceState *dev, Error **errp) +{ + bool ret; + + ret =3D object_property_set_bool(OBJECT(dev), "realized", false, errp); + object_unref(OBJECT(dev)); + return ret; +} + static int qdev_assert_realized_properly_cb(Object *obj, void *opaque) { DeviceState *dev =3D DEVICE(object_dynamic_cast(obj, TYPE_DEVICE)); diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index fd11e9a82f..20b9220023 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -374,6 +374,8 @@ bool qdev_realize(DeviceState *dev, BusState *bus, Erro= r **errp); * for the only reference to the child device to be held by the parent * via the child<> property, and so the reference-count-drop done here * would be incorrect. For that use case you want qdev_realize(). + * + * Returns %true on success or %false if an error occured. */ bool qdev_realize_and_unref(DeviceState *dev, BusState *bus, Error **errp); =20 @@ -397,6 +399,24 @@ bool qdev_realize_and_unref(DeviceState *dev, BusState= *bus, Error **errp); * the life of the simulation and should not be unrealized and freed. */ void qdev_unrealize(DeviceState *dev); + +/** + * qdev_unrealize_and_unref: Unrealize a device and drop a reference + * @dev: device to unrealize + * @errp: pointer to error object + * + * Unrealize @dev and drop a reference. + * This is like qdev_unrealize(), except the caller must hold a + * (private) reference, which is dropped on return regardless of + * success or failure. + * + * Warning: most devices in QEMU do not expect to be unrealized. Only + * devices which are hot-unpluggable should be unrealized (as part of + * the unplugging process); all other devices are expected to last for + * the life of the simulation and should not be unrealized and freed. + */ +bool qdev_unrealize_and_unref(DeviceState *dev, Error **errp); + void qdev_set_legacy_instance_id(DeviceState *dev, int alias_id, int required_for_version); HotplugHandler *qdev_get_bus_hotplug_handler(DeviceState *dev); --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436257; cv=none; d=zohomail.com; s=zohoarc; b=I3TAeAaGgONTELIX66e12UnB56qDIGondKrcUGszM3DY+YCM4gmsp6nIvWyVfaKoTWw2IuvNYSv6EdAc1aWDdUu1/fEVxLRDfM8DZwg3eCeQ/E+4bNxvQ4oCkKngj0wb/TqT34KShM/kZ7oibvAfhyv68BvEtuWIgwFmZO3PRFU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436257; 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=tZif2it4bxphJIlcF0dFkRLHSBXoWvT693QwJQjGzNo=; b=NDurenqhktEyfiiCOCdzrwHw/UW2lgreltfSqqBxd+/JdNZmQkFNNFmqPwVu0hUQ7mIjM1FAa36HwiZdW/5I93n68bn2Z3tcmEbXLUPNjFszhe4j45Qvs4TeQWKUs+c2DIZmd+rIE4xfpb1wd/Rf/HnRovSrcm3LYi2ZJI3u5PU= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436257719501.5724344494964; Fri, 3 Feb 2023 06:57:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxTx-0001tF-6G; Fri, 03 Feb 2023 09:56:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxTo-0001sT-UY for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:55:57 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxTn-0005tV-Bw for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:55:56 -0500 Received: by mail-wm1-x336.google.com with SMTP id c4-20020a1c3504000000b003d9e2f72093so6206658wma.1 for ; Fri, 03 Feb 2023 06:55:54 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id y3-20020adfd083000000b002bfbda53b98sm2162717wrh.35.2023.02.03.06.55.52 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:55:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tZif2it4bxphJIlcF0dFkRLHSBXoWvT693QwJQjGzNo=; b=e65UkPC5QmpQDXpDZHki8/zuv9g086olkHcGAS66BX1U36sGP9oqOQf4gfvLXbmgWM ist1JU9OllFI7yZCBz6tNz6Ha/Ggei4zZSLQlDvRC+oetWcabyhOVeDcHTKcfE/DeOXT UlGqCAdz7du7/qgnw12RyoKAAetuy1z94c84H3hjNjLeW+PcZ5U7DVDaMLJ7lxhPexoJ 7jWJoIXNxbYR1XVgjE4nrS34K2iwKa+Fty3/Y9CwuYFmLH5RIrznYxJNDAPD8lsJEfUP P3jb9eGztYmj2MmzbdXCcLIFEU/loAdFWayXAa0CLBy7FJIdV3Cx8dFVHr8zwUYJFjJ3 r1fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tZif2it4bxphJIlcF0dFkRLHSBXoWvT693QwJQjGzNo=; b=mnaKCuqcNvVOgfbiinkkqR1XH6YB49E3VmsvAlI4Gv4vCzEjTt+T+rrZ7xgv7ouU8B Yl4sDGDxRHMskJofr1hNbnBA7GrnR1TWDkUxG1DhTw9+DVNqzhd9ARmuEqfmzCNAhTqj T1IR0103VIqM9jK44lXzQ28zblSZ6h/X9T2IR1w9ugANznbrwL8kxewSK1PA8hHuzdND n7n4zax26ueq4wyy2/Z2QNvQBX/x6FZxFv+Pm0cVj9B9efMqDyZVzF+aOwstMJxt7Hzd WiSOWa1jWWygqaShc5Wbp8ggFgJLSEAFhmZ/lvkHrkYq3ypJdG0lV1NYSohkFTtcDS0D 9R8A== X-Gm-Message-State: AO0yUKXiPMkMcf4557MGpmt3ddxwbwu551D+dzbNqA0PI27r3WC/bMiD CP1UIPeJDz3kIJZl8yCpLxZKE+BTCeLyjpaR X-Google-Smtp-Source: AK7set9blUJXFTFwonzntANn6BA7jPJxh/f4xqrWpo/W0C/r+bbJ6zSRo0JaeEAURLj7oGV8HqFe7w== X-Received: by 2002:a05:600c:3491:b0:3db:fc4:d018 with SMTP id a17-20020a05600c349100b003db0fc4d018mr10875768wmq.40.1675436153732; Fri, 03 Feb 2023 06:55:53 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier Subject: [PATCH v2 03/15] linux-user/syscall: Do not open-code qdev_unrealize_and_unref() Date: Fri, 3 Feb 2023 15:55:24 +0100 Message-Id: <20230203145536.17585-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436258831100001 (See commits dc3edf8d8a "Convert to qdev_unrealize() manually" and 981c3dcd94 "Convert to qdev_unrealize() with Coccinelle"). Reported-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster --- linux-user/syscall.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1f8c10f8ef..9299f71126 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -8642,8 +8642,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, in= t num, abi_long arg1, if (CPU_NEXT(first_cpu)) { TaskState *ts =3D cpu->opaque; =20 - object_property_set_bool(OBJECT(cpu), "realized", false, NULL); - object_unref(OBJECT(cpu)); + qdev_unrealize_and_unref(DEVICE(cpu), NULL); /* * At this point the CPU should be unrealized and removed * from cpu lists. We can clean-up the rest of the thread --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436192; cv=none; d=zohomail.com; s=zohoarc; b=W63TtYzWydYexGvRxe5/nsP7BBAqNZWuVyU9por0nvLMiumLrIG8dF5vSc1Ngddsc0iQnxJ39oU6LFBt5b6hfwNi4jSK9J11BBoolLvpS21WSZ5O1IHYk/o+B7/ml9FGuqBprAPyaFfT2QG4UsEU2xe3GhZMYUtbHupv7dfKy6Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436192; 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=b1jZnXzDBv6AIc7zb/xF5HP075z2PTTEUA4j1SOMKA0=; b=JX8pOeKHDkjAeFpvFO5HT4qzbRAB/rl8/rbKtAhtYwtZ2JeoT/7wqGk5+tyIrKuAsKnMzsduA7haTxF1Bc7tpIBEmaTfXMOJI+31ucS87mYSW6f2qi1m5438A8TjwlXpqpWlRdY/nMlmUwCQK65ppHHyOTBT9AJwu0jJETxORg8= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167543619290736.976862641786056; Fri, 3 Feb 2023 06:56:32 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxTy-0001zP-Qm; Fri, 03 Feb 2023 09:56:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxTv-0001vF-Ue for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:04 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxTt-0005qt-OG for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:03 -0500 Received: by mail-wr1-x432.google.com with SMTP id q5so4929998wrv.0 for ; Fri, 03 Feb 2023 06:55:59 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id v1-20020adf8b41000000b002be505ab59asm2248695wra.97.2023.02.03.06.55.57 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:55:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=b1jZnXzDBv6AIc7zb/xF5HP075z2PTTEUA4j1SOMKA0=; b=migsbNglUZNbUMbZsnqOnYplVzxov4rWnz/3LbovPpI3xN/b+/3PAfZCyXKzrPcsEg NTdiQmEITsLr5bClFauNa5rEOY+oQ+oh0KnKFOWliMz/iyNJSCIceYPYU6QWmn7jOCgn lfrvAEJT4rD20uEijSwWtS/0vsjwZCG1jSl8hbwu6oIn2LF4yq2dBqcjoYBAZX59z6DO nDyUV3COuPPq2Dw9S3hTYSX2PvUpgMVb6y4CvQKAtfTimWA6rwQNQuMsocGZZeZYZK+4 RVlXiwjSA0PlAIpsSCBABwChj+1ybm01+ozYJUOe2++kKF9WyddpVBUefIXZLLgneQnA hW4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=b1jZnXzDBv6AIc7zb/xF5HP075z2PTTEUA4j1SOMKA0=; b=AVNL/W9nkDt1F90hj2zN1KZz1eoqAo2Wy4JI1RGXzrjmKn1CqSuXsK93dj3YAE90E8 TKcxR6TWzLTzd/LF4F/Z6RPBNVjYbz56tnwzw5+m6dWC5aENXBp3cbM05Qz8VYckqmlw ukJljVB3CCB9ZR2VLFQphP9kVzX0qlAU4DhnPqIGoTjGljZ5EF7Fql71/GJ13JKmEeU+ QR6AqjusDuTE/sF132w3wxjTBtaWbq1U2T5yCsIvUAaTBV+weUD0AxcatlWQgYIVLE8M CPCago1VL6zpWcTPVp9F5ky08t+9kzVvRsIggpw8EhDOL6GlNQHA9eDYzva4mzVJPxpB lPZg== X-Gm-Message-State: AO0yUKVU8lCqxk8cqCYwxS0aMhGIZfXP8nclDsAZrE3gPitZyGj7sgYN kXyyXAriBt9ybHjV284oiaQyPjEjnyqRC5Wc X-Google-Smtp-Source: AK7set81V4JsTk3hDaKcd7btY3p6hXdEw5odlJaAUf6EDWsTXD6nYxLHtu4+YFfaFhC8AdAYBYUd4Q== X-Received: by 2002:a05:6000:1005:b0:2bf:b35d:2797 with SMTP id a5-20020a056000100500b002bfb35d2797mr8819725wrx.11.1675436158914; Fri, 03 Feb 2023 06:55:58 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum Subject: [PATCH v2 04/15] hw/pci/pcie_sriov: Do not open-code qdev_unrealize_and_unref() Date: Fri, 3 Feb 2023 15:55:25 +0100 Message-Id: <20230203145536.17585-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436194596100001 (See commits dc3edf8d8a "Convert to qdev_unrealize() manually" and 981c3dcd94 "Convert to qdev_unrealize() with Coccinelle"). Reported-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci/pcie_sriov.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c index 93b0624599..0b6101302b 100644 --- a/hw/pci/pcie_sriov.c +++ b/hw/pci/pcie_sriov.c @@ -204,11 +204,10 @@ static void unregister_vfs(PCIDevice *dev) for (i =3D 0; i < num_vfs; i++) { Error *errp =3D NULL; PCIDevice *vf =3D dev->exp.sriov_pf.vf[i]; - object_property_set_bool(OBJECT(vf), "realized", false, &errp); - if (errp) { + + if (!qdev_unrealize_and_unref(DEVICE(vf), &errp)) { warn_reportf_err(errp, "Failed to unplug: "); } - object_unparent(OBJECT(vf)); } g_free(dev->exp.sriov_pf.vf); dev->exp.sriov_pf.vf =3D NULL; --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436314; cv=none; d=zohomail.com; s=zohoarc; b=Wo8gvnIzBaLawx4txi5kHQnKVABR7JcMTKAF33n0xkiHpJqphOsnqe0l+3wvwA/dN/ycU3qH1pnzmlp0alzSU9uQAemi+K5rUYQeBeDD/O7w7EmaYsIGYma12hQgs9tkmd8YDWRRJQql/iBJT2D8tg6rMyg2SE8sl391mV6wrIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436314; 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=WDUR7TYjLSIvLofe5Yaai1+QKInBgxE2ASTflQgOO30=; b=ezQqI/FgAtTgUYZeBibC58a2e79FJ2yYH0/CjgJXFZpdIuAKXAa5RazIdYWm5BdWVtW9MknXu4MY578B5lLq+aB0SBnUS+DN356523SaZ9GpfyIrYMvwPf/s/qeHxR31H8Md125e7QgDM6j9smbjvHv9kiS4VgUTa7+v54C/LLY= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436314426602.160934739213; Fri, 3 Feb 2023 06:58:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxU0-00021l-Qv; Fri, 03 Feb 2023 09:56:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxTz-0001zW-7Y for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:07 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxTx-0005v2-Gd for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:06 -0500 Received: by mail-wm1-x336.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so2571313wms.0 for ; Fri, 03 Feb 2023 06:56:04 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k24-20020a05600c0b5800b003cfa622a18asm8009272wmr.3.2023.02.03.06.56.02 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WDUR7TYjLSIvLofe5Yaai1+QKInBgxE2ASTflQgOO30=; b=co6U3GbsDJJFY4pVZU4kiCaVdgc5JoqCG/yoosYneWzeGuAXKp52S85umVEABW6VC/ vG5zZI++4sVTwNag+e7zvu/jX/Z9H1HuEXOIHUk7P+LOmkUAxpXCp/MzN/PuY/xYL8AS UId+mN9Np3xWCJbdz01CchkAaBWuNy36A2+Ptadp8y/A7BY7ydDKdArSqODvsaxYDR17 DfOHxEdc6zLChVvg3POqKO0xxojy3T0FvQY7ECXspXMLFdkPATsO5vL+FFHk9vS4NvBF 2+d2Q6Lp4joe+MOeQBJQkgME4A8r9jX7IP6jeqJWH281VzLu8X1RFPnGbOFbTirxpfqf ADpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WDUR7TYjLSIvLofe5Yaai1+QKInBgxE2ASTflQgOO30=; b=jQk4Xei8jTTah31LcILdAkYSDhm/U8IANq7l/kv6fUZZ+fTgcn93/ClYXc8vysrhhV sKF+olNQm2jHd6uRW/gSdfOpKtpfwI12THfhE270ID81vb7NxwQRsZ5vIUrf3TDYYdXR QiFSHo2Uquxs2PNg1g/epexppk8B6+huJjQPTL6kfDy1LI7UoNmYa6D2ES4Es7i+6tw/ LXB+5ElULo2KpVwEJEx//L2dUCVAoou90b+zuOquyEWOA/OMi32xmQZpZOQsdKBxKn7M JlN1+CEnxCQiW49dkDypNhZQNJrkmFaDGHywRfkwiyqLdLPN/V1mAKXw7gCjfY70bTGk ivwA== X-Gm-Message-State: AO0yUKV2UQZIwH4heE2Roaa/8qLPzyy8amFSxC3Rs9BKcUGDNp6PPwtF tzEFFBmwttoIYb4W9Glm7UNL7qQG3GgVtO20 X-Google-Smtp-Source: AK7set8UtkLrFxuNkRCr1JP7oWXiyRusxQYVDdzQhbZnhISmHMNyK2878BM7eQNPaC/1Yh0CiW1q1g== X-Received: by 2002:a05:600c:54c5:b0:3dc:9ecc:22a with SMTP id iw5-20020a05600c54c500b003dc9ecc022amr10169316wmb.8.1675436163969; Fri, 03 Feb 2023 06:56:03 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson Subject: [PATCH v2 05/15] hw/i386/sgx: Do not open-code qdev_realize_and_unref() Date: Fri, 3 Feb 2023 15:55:26 +0100 Message-Id: <20230203145536.17585-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436315278100003 Reviewed-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/sgx.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/i386/sgx.c b/hw/i386/sgx.c index db004d17a6..6a729bff94 100644 --- a/hw/i386/sgx.c +++ b/hw/i386/sgx.c @@ -285,7 +285,6 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) SGXEPCState *sgx_epc =3D &pcms->sgx_epc; X86MachineState *x86ms =3D X86_MACHINE(pcms); SgxEPCList *list =3D NULL; - Object *obj; =20 memset(sgx_epc, 0, sizeof(SGXEPCState)); if (!x86ms->sgx_epc_list) { @@ -299,16 +298,15 @@ void pc_machine_init_sgx_epc(PCMachineState *pcms) &sgx_epc->mr); =20 for (list =3D x86ms->sgx_epc_list; list; list =3D list->next) { - obj =3D object_new("sgx-epc"); + DeviceState *dev =3D qdev_new(TYPE_SGX_EPC); =20 /* set the memdev link with memory backend */ - object_property_parse(obj, SGX_EPC_MEMDEV_PROP, list->value->memde= v, - &error_fatal); + object_property_parse(OBJECT(dev), SGX_EPC_MEMDEV_PROP, + list->value->memdev, &error_fatal); /* set the numa node property for sgx epc object */ - object_property_set_uint(obj, SGX_EPC_NUMA_NODE_PROP, list->value-= >node, - &error_fatal); - object_property_set_bool(obj, "realized", true, &error_fatal); - object_unref(obj); + object_property_set_uint(OBJECT(dev), SGX_EPC_NUMA_NODE_PROP, + list->value->node, &error_fatal); + qdev_realize_and_unref(dev, NULL, &error_fatal); } =20 if ((sgx_epc->base + sgx_epc->size) < sgx_epc->base) { --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436328; cv=none; d=zohomail.com; s=zohoarc; b=JfqwyyVH2IwW2vdR345G23HXjLeant4WoVIaT6gVhDOQox/rA5cykrI7F3S1mw50PU0DlWVMX4guSZSftuBlnP/Gdhjjyog/V4MxRUR8H0Ok6tntqjCjTjpV3eHgHGGn4nw1yfU/KwrOrfhsyCyKu14laoW2t/XI2jPSoCJhI6g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436328; 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=B9zIETZDw8AzAYdvOUdcE4GWKCA1zFcGWd3/PyGieuU=; b=MEoinGN3vlcmC6DNJ08FVdJlXPsqNlOtlZV51RR1x6bUlLv7XlDXijcThS1+PcHwY07IWSvqiIJywLoNNesyL+MOEqNTTJZk7KOMKUK+/40XAuGA/PC1blY6/BVpVEvYsZ7d9ABcxVxItmh7gwUKmMhvr18KdOkR1MLM7hjMf/k= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 167543632814865.29040345750741; Fri, 3 Feb 2023 06:58:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxU6-0002Ik-E3; Fri, 03 Feb 2023 09:56:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxU4-0002Dc-IH for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:12 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxU2-0005wG-Ld for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:12 -0500 Received: by mail-wm1-x334.google.com with SMTP id k16so4070687wms.2 for ; Fri, 03 Feb 2023 06:56:10 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t6-20020a05600c450600b003dc433bb5e1sm3251692wmo.9.2023.02.03.06.56.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B9zIETZDw8AzAYdvOUdcE4GWKCA1zFcGWd3/PyGieuU=; b=pTmP2R7B+z3eAJyd3o7EP53hEHnMbEhT84NZtKZwHlAz9ttqI/z/DmEyUTgurqhh2V zGBMtS0GEt0auuCAQL0m8tP0Lp4Qk8+4vJzHmNwWSWWpdYqXXHZkGmXZlDvvewCzyujF DWUHfZ0w7ZprzF7Ux9bA9IvTR4RgYvKCl/gtJWQauqPb1d9pyWMXUIrCTOWzl4lL41RY wUHyyXN8DnHGFHUFOdqBEGGS3h3lbridfsAwaG3NaHzxfH0UxoagYe0o1SWznXFo2cni D0XXC6sSNc+zQetYEMVAFet7mzYDeJvDLt6VEH3ml3zhfvW/dFslzqE3ODRAiprAVa8k 1XJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B9zIETZDw8AzAYdvOUdcE4GWKCA1zFcGWd3/PyGieuU=; b=Ufd3oTOVEuwYEB+oV9e/L1AiV2WXPko6chMu4fdxalgfDKMPWWmHkaDXxYaShLwZAc eMgCuRCp0PpCzNNPgykFvmHcI4mK2JzHUGCNlPIHEZcZFM6wpeCtbQRdXpj+wcfqr8VI 9CcJdK+rszUc9iyXmJT93PkiL1nq87F2jec5UBXp0GLA+Nc2Sw+eIjlsyLlpjng+XA+1 srgdRxdaxEMwI/vc8jqJjOvWGZbYGBiYaIyiJ7PdmgNItaoQN9uJvx794zi8YpqD826Q sS94KSD4SHXSHTksFtgkabIQWjCB7MwTRnbGrBWOLemGCq+CSqrnlMmPIUv26LhdRfLb kykA== X-Gm-Message-State: AO0yUKVJ57sXemrf5PkMrXwnQwx8pIXLJGBNMgf8bju5etit3ZWDbkKD SqcXdWeaQWGyrvzouz/7a3fpydBRwdlXPjQ0 X-Google-Smtp-Source: AK7set/NWAfcASQblO/2Mf/pJtQFTI0hy716MZhLsa4SPlKoKs8gf/YUlwABvctia7W75oPASGA76g== X-Received: by 2002:a05:600c:46ce:b0:3df:e1d1:e14c with SMTP id q14-20020a05600c46ce00b003dfe1d1e14cmr6897203wmo.20.1675436169010; Fri, 03 Feb 2023 06:56:09 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan Subject: [PATCH v2 06/15] hw/ppc/sam460ex: Correctly set MAL properties Date: Fri, 3 Feb 2023 15:55:27 +0100 Message-Id: <20230203145536.17585-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436329354100007 MAL properties are declared as uint8_t: static Property ppc4xx_mal_properties[] =3D { DEFINE_PROP_UINT8("txc-num", Ppc4xxMalState, txcnum, 0), DEFINE_PROP_UINT8("rxc-num", Ppc4xxMalState, rxcnum, 0), DEFINE_PROP_END_OF_LIST(), }; Correct the API use by setting the property using qdev_prop_set_uint8(). No behavioral change. Fixes: da116a8aab ("ppc/ppc405: QOM'ify MAL") Reviewed-by: BALATON Zoltan Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/sam460ex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 4a22ce3761..cf065aae0e 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -389,8 +389,8 @@ static void sam460ex_init(MachineState *machine) =20 /* MAL */ dev =3D qdev_new(TYPE_PPC4xx_MAL); - qdev_prop_set_uint32(dev, "txc-num", 4); - qdev_prop_set_uint32(dev, "rxc-num", 16); + qdev_prop_set_uint8(dev, "txc-num", 4); + qdev_prop_set_uint8(dev, "rxc-num", 16); ppc4xx_dcr_realize(PPC4xx_DCR_DEVICE(dev), cpu, &error_fatal); object_unref(OBJECT(dev)); sbdev =3D SYS_BUS_DEVICE(dev); --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436266; cv=none; d=zohomail.com; s=zohoarc; b=kg4FUkHSPAgKjXmFEZk9RFvR55ORXUJ90lFgo3+qyIrojDYkX7U03C5eaOAt2ghi2N+z3ejWyTp3lxGyc76BB1MrKNNPyOG6qLCSuAicGm1HatbcbH4jeqVL7YE5XFPqppccSOJYuIJenr4ZF6Y51uAFdcC/7iQpV4G+ebzEgDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436266; 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=T7gfeI3mnZ+Wy6rurWRcclNKo/AI2l33cgu5mda3V+c=; b=kR4WbPe/tYkRpI0LeEj5LIXH+prhOEaPI7juZBCXtlq4OQ9sUOboNpRP9j+iYEtOQj79ayp0MaCsD5YJkyRW/NTEzlDNlIgB5tlIBASQHlgEm1oEgXNe+mGpcRhQr2m7wQt1FSB7pwmMokx69W62uo/33g1aCO5YhOlDUFkqA+0= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436266861594.1946621887647; Fri, 3 Feb 2023 06:57:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUB-0002WO-Tk; Fri, 03 Feb 2023 09:56:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUA-0002Uz-EM for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:18 -0500 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxU7-0005xE-V4 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:18 -0500 Received: by mail-wm1-x330.google.com with SMTP id k8-20020a05600c1c8800b003dc57ea0dfeso6214958wms.0 for ; Fri, 03 Feb 2023 06:56:15 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id r16-20020a05600c459000b003da28dfdedcsm3332092wmo.5.2023.02.03.06.56.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=T7gfeI3mnZ+Wy6rurWRcclNKo/AI2l33cgu5mda3V+c=; b=zfE1tKdxzx0uKfjd8INXMPrMnB30oF7VsFg/WfIThH1WKj6dF5HDFNGOi1gnr7j8bv hHklH0PQrZ6CYOWT4Z6k4p3HUixcEmoLOI945v9q1D+eIQSdHwPX9iWqTYeGQ2goS5Kz qc6H3N5zdlQJLlue2g/+8PMOkG55OYiyl0oLLS6EzWqMgC4stLNsS9v7heAASRzz4j+K uCPPwTeNLi8a1VscZhIvUk93GFdsTlkR5cJnQ9BwNbUdLXj+7O9vr6JBZctYtrFMe2By aN3jnnZnvST1aYx52mQUEwI85pCD6s0oNCGgfITT4RbTT1D8KLZWsSx6glEjX61r0hFR MLrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=T7gfeI3mnZ+Wy6rurWRcclNKo/AI2l33cgu5mda3V+c=; b=Ppnn/UCf6jGJliO8MyFvof3VDvOsjSx2HoBgYoHvSRbI67nmxVrx6Rwh/RJn1dmL2m SIhXF++Nq7U5Fj7jR+3UHF1ew6mz+OY5ZNq+HjglN0t/zExLfu/Uy/DlRbcpW6Pm0Eoz urM2/ZYNT/UNOyYylwOd3cuZMWO+Fx8AKJDMbIhHvXQeUlfWPjNgPHw4qlyJUNiVX6CS LMjkxg6vTMigAN9Kjc9IGyybq6tu1HkOzezchl06/sxW64uJYnYVzY/GGlisW3N3fIZs ByJ0QeepFZBjXi0TIobWo9Gk71xbgYstLDeKLXRrc4uZyXH9EgiaK6fcX4ruxTac/pTV 3ORw== X-Gm-Message-State: AO0yUKV5LgJOmHeTllmJPB2Zc2WL/ixMSYFs3fkbMSIiWugYNR5EhGFt 55svd4bTrUmJCximrFWaXSgGlQfb+hk4/Mnm X-Google-Smtp-Source: AK7set8/10zYS/FESlC3R/DkI0eVPpwLqq1SbGQyGKU3SkNJt1rji5e/lArZ2nrao2qh1f7jM//q9A== X-Received: by 2002:a05:600c:314a:b0:3df:ee43:860b with SMTP id h10-20020a05600c314a00b003dfee43860bmr812324wmo.23.1675436174176; Fri, 03 Feb 2023 06:56:14 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Joel Stanley , Peter Maydell Subject: [PATCH v2 07/15] hw/arm/nrf51: Alias 'flash-size' QOM property in SoC object Date: Fri, 3 Feb 2023 15:55:28 +0100 Message-Id: <20230203145536.17585-8-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::330; envelope-from=philmd@linaro.org; helo=mail-wm1-x330.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436268867100001 No need to use an intermediate 'flash-size' property in the SoC object. Alias the property, so when the machine (here microbit) sets the value on the SoC, it is propagated to the flash object. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/microbit.c | 5 ++++- hw/arm/nrf51_soc.c | 10 +--------- hw/nvram/nrf51_nvm.c | 6 +++++- include/hw/arm/nrf51_soc.h | 1 - 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/hw/arm/microbit.c b/hw/arm/microbit.c index 50df362088..79b5574884 100644 --- a/hw/arm/microbit.c +++ b/hw/arm/microbit.c @@ -36,6 +36,7 @@ static void microbit_init(MachineState *machine) MicrobitMachineState *s =3D MICROBIT_MACHINE(machine); MemoryRegion *system_memory =3D get_system_memory(); MemoryRegion *mr; + int64_t flash_size; =20 object_initialize_child(OBJECT(machine), "nrf51", &s->nrf51, TYPE_NRF51_SOC); @@ -43,6 +44,8 @@ static void microbit_init(MachineState *machine) object_property_set_link(OBJECT(&s->nrf51), "memory", OBJECT(system_memory), &error_fatal); sysbus_realize(SYS_BUS_DEVICE(&s->nrf51), &error_fatal); + flash_size =3D object_property_get_int(OBJECT(&s->nrf51), + "flash-size", &error_abort); =20 /* * Overlap the TWI stub device into the SoC. This is a microbit-speci= fic @@ -57,7 +60,7 @@ static void microbit_init(MachineState *machine) mr, -1); =20 armv7m_load_kernel(ARM_CPU(first_cpu), machine->kernel_filename, - 0, s->nrf51.flash_size); + 0, flash_size); } =20 static void microbit_machine_class_init(ObjectClass *oc, void *data) diff --git a/hw/arm/nrf51_soc.c b/hw/arm/nrf51_soc.c index 34da0d62f0..cc4a636c51 100644 --- a/hw/arm/nrf51_soc.c +++ b/hw/arm/nrf51_soc.c @@ -24,9 +24,7 @@ * are supported in the future, add a sub-class of NRF51SoC for * the specific variants */ -#define NRF51822_FLASH_PAGES 256 #define NRF51822_SRAM_PAGES 16 -#define NRF51822_FLASH_SIZE (NRF51822_FLASH_PAGES * NRF51_PAGE_SIZE) #define NRF51822_SRAM_SIZE (NRF51822_SRAM_PAGES * NRF51_PAGE_SIZE) =20 #define BASE_TO_IRQ(base) ((base >> 12) & 0x1F) @@ -122,11 +120,6 @@ static void nrf51_soc_realize(DeviceState *dev_soc, Er= ror **errp) BASE_TO_IRQ(NRF51_RNG_BASE))); =20 /* UICR, FICR, NVMC, FLASH */ - if (!object_property_set_uint(OBJECT(&s->nvm), "flash-size", - s->flash_size, errp)) { - return; - } - if (!sysbus_realize(SYS_BUS_DEVICE(&s->nvm), errp)) { return; } @@ -199,6 +192,7 @@ static void nrf51_soc_init(Object *obj) object_initialize_child(obj, "rng", &s->rng, TYPE_NRF51_RNG); =20 object_initialize_child(obj, "nvm", &s->nvm, TYPE_NRF51_NVM); + object_property_add_alias(obj, "flash-size", OBJECT(&s->nvm), "flash-s= ize"); =20 object_initialize_child(obj, "gpio", &s->gpio, TYPE_NRF51_GPIO); =20 @@ -215,8 +209,6 @@ static Property nrf51_soc_properties[] =3D { DEFINE_PROP_LINK("memory", NRF51State, board_memory, TYPE_MEMORY_REGIO= N, MemoryRegion *), DEFINE_PROP_UINT32("sram-size", NRF51State, sram_size, NRF51822_SRAM_S= IZE), - DEFINE_PROP_UINT32("flash-size", NRF51State, flash_size, - NRF51822_FLASH_SIZE), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/nvram/nrf51_nvm.c b/hw/nvram/nrf51_nvm.c index 7f1db8c423..bfae028fcd 100644 --- a/hw/nvram/nrf51_nvm.c +++ b/hw/nvram/nrf51_nvm.c @@ -26,6 +26,9 @@ #include "hw/qdev-properties.h" #include "migration/vmstate.h" =20 +#define NRF51822_FLASH_PAGES 256 +#define NRF51822_FLASH_SIZE (NRF51822_FLASH_PAGES * NRF51_PAGE_SIZE) + /* * FICR Registers Assignments * CODEPAGESIZE 0x010 @@ -358,7 +361,8 @@ static void nrf51_nvm_reset(DeviceState *dev) } =20 static Property nrf51_nvm_properties[] =3D { - DEFINE_PROP_UINT32("flash-size", NRF51NVMState, flash_size, 0x40000), + DEFINE_PROP_UINT32("flash-size", NRF51NVMState, + flash_size, NRF51822_FLASH_SIZE), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/arm/nrf51_soc.h b/include/hw/arm/nrf51_soc.h index e52a56e75e..8cf0c21614 100644 --- a/include/hw/arm/nrf51_soc.h +++ b/include/hw/arm/nrf51_soc.h @@ -45,7 +45,6 @@ struct NRF51State { MemoryRegion twi; =20 uint32_t sram_size; - uint32_t flash_size; =20 MemoryRegion *board_memory; =20 --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436200; cv=none; d=zohomail.com; s=zohoarc; b=cpwLA1VHvH9nwf+DF5qnr10FIjRb+pGTbhrYt7TZ5f3Ex4guKJvGWqcvWZwx6B1i0g+gBjigGefzvrzzwk3ilbPGNYkyAcBPvTQlWgeHA62cT91tmrHzAu0QGe+Da6bSGvtcrdWK0SKEJoiw94RnVU+NjWtgQVCBDfx913IxdeQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436200; 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=f2kBLJKaVnGetSSqtxpfAhCXISkwd1yaz8QImmDemGM=; b=YCLFDjQFy0D3jGM2eub2mZ4En9MITNOkht96k7RHKCPfSJsunqtfCG8nVcdz99qiIeiFJi+wmdw0krmXJEAJyomLjG1p5N+a0wmmPr+CXocTIrQ6fKsI/G1H4q/CY3t8HfklxO53PEu9tXJ53F6PlVLegxN0hxg+hDqcI5PcG6g= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436200475899.6005587332912; Fri, 3 Feb 2023 06:56:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUG-0002jD-Lu; Fri, 03 Feb 2023 09:56:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUF-0002ap-A0 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:23 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxUC-0005v2-Bf for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:23 -0500 Received: by mail-wm1-x336.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so2571888wms.0 for ; Fri, 03 Feb 2023 06:56:19 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t6-20020a05600c198600b003dc492e4430sm3022855wmq.28.2023.02.03.06.56.18 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f2kBLJKaVnGetSSqtxpfAhCXISkwd1yaz8QImmDemGM=; b=KpY9LpkQkdmGdSECIUV03ptdpIF11O/6yKWpyzgdtyfnGMbcnM3z5Vxqexi6R4/TgB e+e+JhjV8ztHekJdrXiHPRztONz0hemLJEvBGr60OSxZjiIYXELaR+3NRO2AOfmM49tK pR6kFvrNO31fokNf4r9Iue3yONWo8OFso/G3agt4FuH7CDLaEZa0GwNiLxd0XP1SubTp 2oJU8HsL0L5OPvmKc/AM144hHOWjozKQurWbIc6O5c8BSftV9J7VIa5qvAXvrincUfQK QIOc/L86kAc0Q8cqxbk7dlgn4EoTRjsvKznly6tebyrditFVyuOtoTP0rNOd03Xlw4xU sGUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f2kBLJKaVnGetSSqtxpfAhCXISkwd1yaz8QImmDemGM=; b=3y6DlRizZHIUKiA/A0yzS8bcdi2++5KnNyrnsJKW/YVOEJEepDF8TbRpsQ3UA224kU OdwsH8/Arg6GDoQM8x32S5aHpdU7McH+wAQFP7VEgqYSz++n9eBYm7gCARbvgYVP1sE5 +BF9qvYgCzN+8XAqnlOPWBKRS4yE0tkcwq3LwXBc0QcXQRzw4fRTbN+ciZJfE42hSSzF Sd3iahmVSFJloKsoY4lT2fKaGwZx0jAyeNcujxRjx35Vllde+WjsPaLNHVMM7ncENrbL KsCnvA/o4UtcgNTMfexKVWZGi+5X2c8XQspZmBfzPJ9odihABUyjNnf501mXKv6zOj0o J3kQ== X-Gm-Message-State: AO0yUKWPv8F9mgea/tf9NfJQ7gOM+tMriMKaXEy6uBMlgVnlyMNKUH1o lOiD+9z76YfjzCyNSBzsQ6MminFojjLbrsPS X-Google-Smtp-Source: AK7set+Zj5dbaEL0QrM7w7RdtmsTV88Fholm3LZ7zCfLgNDfiea5TXfBTso/4TUgbXOYQ9KmhH5B6g== X-Received: by 2002:a05:600c:1d13:b0:3dc:5abb:2f50 with SMTP id l19-20020a05600c1d1300b003dc5abb2f50mr9505073wms.19.1675436179316; Fri, 03 Feb 2023 06:56:19 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Jean-Christophe Dubois , Andrey Smirnov Subject: [PATCH v2 08/15] hw/arm/fsl-imx: Alias 'phy-num' QOM property in SoC object Date: Fri, 3 Feb 2023 15:55:29 +0100 Message-Id: <20230203145536.17585-9-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436202633100003 No need to use intermediate 'fec-phy-num' properties in the SoC object. Alias the properties, so when the machines set the value on the SoC, it is propagated to the network device object. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/fsl-imx25.c | 3 +-- hw/arm/fsl-imx6.c | 3 +-- hw/arm/fsl-imx6ul.c | 8 ++++---- hw/arm/fsl-imx7.c | 12 ++++++------ include/hw/arm/fsl-imx25.h | 1 - include/hw/arm/fsl-imx6.h | 1 - include/hw/arm/fsl-imx6ul.h | 2 -- include/hw/arm/fsl-imx7.h | 1 - 8 files changed, 12 insertions(+), 19 deletions(-) diff --git a/hw/arm/fsl-imx25.c b/hw/arm/fsl-imx25.c index 24c4374590..eff58e1f7a 100644 --- a/hw/arm/fsl-imx25.c +++ b/hw/arm/fsl-imx25.c @@ -55,6 +55,7 @@ static void fsl_imx25_init(Object *obj) } =20 object_initialize_child(obj, "fec", &s->fec, TYPE_IMX_FEC); + object_property_add_alias(obj, "fec-phy-num", OBJECT(&s->fec), "phy-nu= m"); =20 object_initialize_child(obj, "rngc", &s->rngc, TYPE_IMX_RNGC); =20 @@ -169,7 +170,6 @@ static void fsl_imx25_realize(DeviceState *dev, Error *= *errp) epit_table[i].irq)); } =20 - object_property_set_uint(OBJECT(&s->fec), "phy-num", s->phy_num, &err); qdev_set_nic_properties(DEVICE(&s->fec), &nd_table[0]); =20 if (!sysbus_realize(SYS_BUS_DEVICE(&s->fec), errp)) { @@ -315,7 +315,6 @@ static void fsl_imx25_realize(DeviceState *dev, Error *= *errp) } =20 static Property fsl_imx25_properties[] =3D { - DEFINE_PROP_UINT32("fec-phy-num", FslIMX25State, phy_num, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/arm/fsl-imx6.c b/hw/arm/fsl-imx6.c index 00dafe3f62..4f870c928c 100644 --- a/hw/arm/fsl-imx6.c +++ b/hw/arm/fsl-imx6.c @@ -100,6 +100,7 @@ static void fsl_imx6_init(Object *obj) =20 =20 object_initialize_child(obj, "eth", &s->eth, TYPE_IMX_ENET); + object_property_add_alias(obj, "fec-phy-num", OBJECT(&s->eth), "phy-nu= m"); } =20 static void fsl_imx6_realize(DeviceState *dev, Error **errp) @@ -377,7 +378,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **= errp) spi_table[i].irq)); } =20 - object_property_set_uint(OBJECT(&s->eth), "phy-num", s->phy_num, &err); qdev_set_nic_properties(DEVICE(&s->eth), &nd_table[0]); if (!sysbus_realize(SYS_BUS_DEVICE(&s->eth), errp)) { return; @@ -451,7 +451,6 @@ static void fsl_imx6_realize(DeviceState *dev, Error **= errp) } =20 static Property fsl_imx6_properties[] =3D { - DEFINE_PROP_UINT32("fec-phy-num", FslIMX6State, phy_num, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/arm/fsl-imx6ul.c b/hw/arm/fsl-imx6ul.c index d88d6cc1c5..8b3939e8c5 100644 --- a/hw/arm/fsl-imx6ul.c +++ b/hw/arm/fsl-imx6ul.c @@ -120,8 +120,12 @@ static void fsl_imx6ul_init(Object *obj) * Ethernet */ for (i =3D 0; i < FSL_IMX6UL_NUM_ETHS; i++) { + g_autofree gchar *propname =3D g_strdup_printf("fec%d-phy-num", i = + 1); snprintf(name, NAME_SIZE, "eth%d", i); object_initialize_child(obj, name, &s->eth[i], TYPE_IMX_ENET); + qdev_prop_set_uint32(DEVICE(&s->eth[i]), "phy-num", i); + object_property_add_alias(obj, propname, + OBJECT(&s->eth[i]), "phy-num"); } =20 /* USB */ @@ -424,8 +428,6 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error = **errp) FSL_IMX6UL_ENET2_TIMER_IRQ, }; =20 - object_property_set_uint(OBJECT(&s->eth[i]), "phy-num", - s->phy_num[i], &error_abort); object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num", FSL_IMX6UL_ETH_NUM_TX_RINGS, &error_abort= ); qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]); @@ -618,8 +620,6 @@ static void fsl_imx6ul_realize(DeviceState *dev, Error = **errp) } =20 static Property fsl_imx6ul_properties[] =3D { - DEFINE_PROP_UINT32("fec1-phy-num", FslIMX6ULState, phy_num[0], 0), - DEFINE_PROP_UINT32("fec2-phy-num", FslIMX6ULState, phy_num[1], 1), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/arm/fsl-imx7.c b/hw/arm/fsl-imx7.c index afc7480799..df035c9314 100644 --- a/hw/arm/fsl-imx7.c +++ b/hw/arm/fsl-imx7.c @@ -102,8 +102,12 @@ static void fsl_imx7_init(Object *obj) * Ethernet */ for (i =3D 0; i < FSL_IMX7_NUM_ETHS; i++) { - snprintf(name, NAME_SIZE, "eth%d", i); - object_initialize_child(obj, name, &s->eth[i], TYPE_IMX_ENET); + g_autofree gchar *propname =3D g_strdup_printf("fec%d-phy-num", i = + 1); + snprintf(name, NAME_SIZE, "eth%d", i); + object_initialize_child(obj, name, &s->eth[i], TYPE_IMX_ENET); + qdev_prop_set_uint32(DEVICE(&s->eth[i]), "phy-num", i); + object_property_add_alias(obj, propname, + OBJECT(&s->eth[i]), "phy-num"); } =20 /* @@ -402,8 +406,6 @@ static void fsl_imx7_realize(DeviceState *dev, Error **= errp) FSL_IMX7_ENET2_ADDR, }; =20 - object_property_set_uint(OBJECT(&s->eth[i]), "phy-num", - s->phy_num[i], &error_abort); object_property_set_uint(OBJECT(&s->eth[i]), "tx-ring-num", FSL_IMX7_ETH_NUM_TX_RINGS, &error_abort); qdev_set_nic_properties(DEVICE(&s->eth[i]), &nd_table[i]); @@ -599,8 +601,6 @@ static void fsl_imx7_realize(DeviceState *dev, Error **= errp) } =20 static Property fsl_imx7_properties[] =3D { - DEFINE_PROP_UINT32("fec1-phy-num", FslIMX7State, phy_num[0], 0), - DEFINE_PROP_UINT32("fec2-phy-num", FslIMX7State, phy_num[1], 1), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/arm/fsl-imx25.h b/include/hw/arm/fsl-imx25.h index 1b1086e945..e377f8e79a 100644 --- a/include/hw/arm/fsl-imx25.h +++ b/include/hw/arm/fsl-imx25.h @@ -66,7 +66,6 @@ struct FslIMX25State { MemoryRegion rom[2]; MemoryRegion iram; MemoryRegion iram_alias; - uint32_t phy_num; }; =20 /** diff --git a/include/hw/arm/fsl-imx6.h b/include/hw/arm/fsl-imx6.h index 83291457cf..f7d1a94640 100644 --- a/include/hw/arm/fsl-imx6.h +++ b/include/hw/arm/fsl-imx6.h @@ -74,7 +74,6 @@ struct FslIMX6State { MemoryRegion caam; MemoryRegion ocram; MemoryRegion ocram_alias; - uint32_t phy_num; }; =20 =20 diff --git a/include/hw/arm/fsl-imx6ul.h b/include/hw/arm/fsl-imx6ul.h index 7812e516a5..5217eeb8ff 100644 --- a/include/hw/arm/fsl-imx6ul.h +++ b/include/hw/arm/fsl-imx6ul.h @@ -88,8 +88,6 @@ struct FslIMX6ULState { MemoryRegion caam; MemoryRegion ocram; MemoryRegion ocram_alias; - - uint32_t phy_num[FSL_IMX6UL_NUM_ETHS]; }; =20 enum FslIMX6ULMemoryMap { diff --git a/include/hw/arm/fsl-imx7.h b/include/hw/arm/fsl-imx7.h index 4e5e071864..16c68a4937 100644 --- a/include/hw/arm/fsl-imx7.h +++ b/include/hw/arm/fsl-imx7.h @@ -82,7 +82,6 @@ struct FslIMX7State { IMX7GPRState gpr; ChipideaState usb[FSL_IMX7_NUM_USBS]; DesignwarePCIEHost pcie; - uint32_t phy_num[FSL_IMX7_NUM_ETHS]; }; =20 enum FslIMX7MemoryMap { --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436295; cv=none; d=zohomail.com; s=zohoarc; b=Tf1KiBLrJcuH3tBXmazWFNqn2SnAfiazMz2PNeSgwQhDsGgKqVc1qfaTN+kYN9DTXeS7UPcKliVrhxfji3G4tHxWTQBiKsbbxz4osJxSPislEZHVv4h+E1hgynOZsTf+Et+kpmCBIRVNGprUFmA/b/DzMhBu0z5t0GrEkOqv8wM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436295; 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=Tt1uD8O6Jt66Hf82NoAJiGFntdTbEbmQb2viJlepOPw=; b=UYZd/x+2lswBZuJNwQnYtsYLSuAloDyPfNRwzoICLA66xirA6lErSU+/S869qQocvVs0jVQamL/p2oJAv+RzfNRBngrH0B/yJJHTzrkzt0twwiyz6OIJdBbXWQpHVVeLc6ZmYvLAkRgEWQmxFQ+ZSnOzmloWfFwLxSgwrvLY3p0= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436295965395.3363043454027; Fri, 3 Feb 2023 06:58:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUK-0002zy-Jx; Fri, 03 Feb 2023 09:56:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUJ-0002tM-0X for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:27 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxUH-0005v2-GZ for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:26 -0500 Received: by mail-wm1-x336.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so2572075wms.0 for ; Fri, 03 Feb 2023 06:56:24 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l20-20020a05600c1d1400b003dfe8c4c497sm1995876wms.39.2023.02.03.06.56.23 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tt1uD8O6Jt66Hf82NoAJiGFntdTbEbmQb2viJlepOPw=; b=kgPcfaIRM1Z0jwoP9KgR3Gps5Yb0WSkoc3jGN/Wq7MS0k2g3zoGLbP2bbL6kxEseNI eKYee2vG7kVadu96kswhvzz3FoY0JTDxHVjPNxSC2KFmc4jyAK8EtujmILOqnUFkyBbg yWBQOFkudUIr2lxT24987h34X4X7YzfO/Js1ujK1WqKePq0kbJFHlZYe3mZHrzRkxtxz Q4paVYSefBUQjYKfYe/5c0QIcx0BAM/WJHWX4LUZY9g5AeFG2g2iXBgrBvE3RMrkepyM njpgmTmgeX7rPXRI8F7Xbuh2c5/mdbCZ2sSKxjlFTvVtJucvIWUbCRbuWnd2F261lBXi IEjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tt1uD8O6Jt66Hf82NoAJiGFntdTbEbmQb2viJlepOPw=; b=T+Zl3bEtUY+lIz0sFnoTwi3HsK/A2u+mPsmBk66L8TGg2JuhOf3P1Cmxl2VeOw0iJL 4YckgvZ3cfFhqMwVsxo9yu3Y9rSJBeVfoY5rY25wa4gftohg5rLBMCc55ZJOyyGgEC9W jeUlZRx9EPOTsWb3v2lYBpQu9tgVdH5xZVIuz+Hl21r742fGpVsDz7QwFsqEhbB5DEA7 /9V6iWrQPU2930HQtP/Im6kZac2gGFwhAZeHCbXaI1qgMj3gYXPi8mRzBufL9Bsa9HXh /sj3G5hBTbwPks+KXSsJZDvUw3I3+ClsMkQmCV4qtJ0MLDnfsgAimd/ECA/LJPMJ4Fns 97jQ== X-Gm-Message-State: AO0yUKU64WKqKFo6clsLxZAJr7kHwJ6Aj4Wn/JfXOf13a3aEV9+Zozdq 7JnNPYLlVe6XqX6378Ut60687hiUrxnDjBID X-Google-Smtp-Source: AK7set9xi1FfhrLR0xju1AV4DdUrdok6FgSKsjoZ2Vb+fsZJeKXbTlfpvJuXQuOMNNQD2/DfYeV4pQ== X-Received: by 2002:a05:600c:16c4:b0:3dc:16d2:ae5e with SMTP id l4-20020a05600c16c400b003dc16d2ae5emr9981488wmn.32.1675436184316; Fri, 03 Feb 2023 06:56:24 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH v2 09/15] hw/usb/hcd-ohci: Include missing 'sysbus.h' header Date: Fri, 3 Feb 2023 15:55:30 +0100 Message-Id: <20230203145536.17585-10-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436297219100003 Avoid when including "hw/usb/hcd-ohci.h": hw/usb/hcd-ohci.h:100:5: error: unknown type name 'SysBusDevice' SysBusDevice parent_obj; ^ Reviewed-by: Markus Armbruster Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/usb/hcd-ohci.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h index 11ac57058d..e5e6b434fd 100644 --- a/hw/usb/hcd-ohci.h +++ b/hw/usb/hcd-ohci.h @@ -21,6 +21,7 @@ #ifndef HCD_OHCI_H #define HCD_OHCI_H =20 +#include "hw/sysbus.h" #include "sysemu/dma.h" #include "hw/usb.h" #include "qom/object.h" --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436299; cv=none; d=zohomail.com; s=zohoarc; b=Cr19AYToWeax45Cs1JY70EPCF+I4oNGbygz9mFBlQkOYDwM1z1kU0lo5jVtQlNHUoDO0pUFv+X8E8Y+6Y7OME+YpvILbivlzKtpw37toytdE+C6e9ExYipRERvPSgHrRYg7OijBMkFHwvg3LCSv3Em+376XeK0e/A1rh79MzYGs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436299; 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=vGKludMgGFMX+UQNF2Pkwb7HGkjwWKhIN+mg23C0/DM=; b=jvQY5uNJK+3sjmhepH63lcQj2PH3/HVKH7sMzx5rTj7k7pYgPWLrwuO76gTJcJiqT0OLLkb0yDoQqfrvU8INL9SGXAic6W7NfJkmpC48tJiakkfwgysa+osL9i8NgXAAPO+jeBEZdcXcm1so0j14Y2O2Et00bUIlTGZXCe5uq7M= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436299292152.43428131544465; Fri, 3 Feb 2023 06:58:19 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUR-0003H8-By; Fri, 03 Feb 2023 09:56:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUP-0003EB-PU for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:33 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxUN-00062R-1b for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:33 -0500 Received: by mail-wr1-x432.google.com with SMTP id o18so4896176wrj.3 for ; Fri, 03 Feb 2023 06:56:30 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c13-20020a056000104d00b002bfebe2d67esm2250622wrx.9.2023.02.03.06.56.28 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vGKludMgGFMX+UQNF2Pkwb7HGkjwWKhIN+mg23C0/DM=; b=KPlkqMN9UHD8cpD/1lkqfCv6X7xEWggTCXYblmuXhu0/GZULwqVshuOWxS8tF3D2KI Lobpv+HAUSeiYJJwlZUJxKCHOr1+dBSffcrufnvd9rZU488lWvA11rWspas/rnXIJDIq fPII+bsuAgKyRK8pQXdxqg1mwA9UmWk0Tup080PpNiLluV1s0XY1wqZklyt3oBgRkGJG hGYPc4838Qlo7+cxll6M+OYtdMXXFVHRjA77EYdvr23Aimq+ZrYbjnh3DPBuR725iIn0 vnT13uh0hV0b6j6jIocQVw9YA75wcyWi+2COIKllTJCcMEFT5dPcAW5Crmuv47WEEn9O PJOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vGKludMgGFMX+UQNF2Pkwb7HGkjwWKhIN+mg23C0/DM=; b=aXhho8ZnBUJX9CszcEWp3HNn2zUVeUeCuy6kqulIJ8naEVv0XRp37k1kbWol/j609a 3xOytB8TieqvFo9WiuF44I8JfFGGo7b/YNhSluCeQ2kc+qDVdT83zHOqzVE/KgKGxvqB 41ENNAqFFPFXEzI0N4OmVwZDkHTr/RAwmhhYyY4HJWb0Ma9yzNPoOnizMpsKssH+wQw+ fqVFVBkWSP4vU9LYKcqy5XNwlzF54SxQyF6o1DEEcHbemcilqetq62j1YapvbiGAwb5n M0XuqwKhEu5u9azrvzMpDhXM6mboewIiuO4g6kyzshIy8YM7s+UexIRdQnUB7igq7x2a fJzw== X-Gm-Message-State: AO0yUKUCU3Krmq0s5HRkDuUu5NDOLuTYqcVkhA+cDUcTUU0uTOjoY25u p7FFlaFilOdzJ7dxx9jA9HN7Tlxp4aOdI0Ja X-Google-Smtp-Source: AK7set8dAwQgnzawxIVp3FZcF+QYEurC1LYYDnYpDxOdOJVORAvBqWjQIWfizdLrLVi6lnY59ZpHkQ== X-Received: by 2002:a5d:50c8:0:b0:2c3:db98:3e9c with SMTP id f8-20020a5d50c8000000b002c3db983e9cmr36525wrt.24.1675436189559; Fri, 03 Feb 2023 06:56:29 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan Subject: [PATCH v2 10/15] hw/display/sm501: Embed OHCI QOM child in chipset Date: Fri, 3 Feb 2023 15:55:31 +0100 Message-Id: <20230203145536.17585-11-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=philmd@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436301235100003 Note this device doesn't implement unrealize(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: BALATON Zoltan --- hw/display/sm501.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 52e42585af..0f7e09d7e2 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -28,6 +28,7 @@ #include "qapi/error.h" #include "qemu/log.h" #include "qemu/module.h" +#include "hw/usb/hcd-ohci.h" #include "hw/char/serial.h" #include "ui/console.h" #include "hw/sysbus.h" @@ -1944,13 +1945,13 @@ struct SM501SysBusState { uint32_t vram_size; uint32_t base; SerialMM serial; + OHCISysBusState ohci; }; =20 static void sm501_realize_sysbus(DeviceState *dev, Error **errp) { SM501SysBusState *s =3D SYSBUS_SM501(dev); SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); - DeviceState *usb_dev; MemoryRegion *mr; =20 sm501_init(&s->state, dev, s->vram_size); @@ -1963,13 +1964,11 @@ static void sm501_realize_sysbus(DeviceState *dev, = Error **errp) sysbus_init_mmio(sbd, &s->state.mmio_region); =20 /* bridge to usb host emulation module */ - usb_dev =3D qdev_new("sysbus-ohci"); - qdev_prop_set_uint32(usb_dev, "num-ports", 2); - qdev_prop_set_uint64(usb_dev, "dma-offset", s->base); - sysbus_realize_and_unref(SYS_BUS_DEVICE(usb_dev), &error_fatal); + qdev_prop_set_uint64(DEVICE(&s->ohci), "dma-offset", s->base); + sysbus_realize_and_unref(SYS_BUS_DEVICE(&s->ohci), &error_fatal); memory_region_add_subregion(&s->state.mmio_region, SM501_USB_HOST, - sysbus_mmio_get_region(SYS_BUS_DEVICE(usb_dev), 0)); - sysbus_pass_irq(sbd, SYS_BUS_DEVICE(usb_dev)); + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->ohci), 0)= ); + sysbus_pass_irq(sbd, SYS_BUS_DEVICE(&s->ohci)); =20 /* bridge to serial emulation module */ sysbus_realize(SYS_BUS_DEVICE(&s->serial), &error_fatal); @@ -2016,8 +2015,12 @@ static void sm501_sysbus_class_init(ObjectClass *kla= ss, void *data) static void sm501_sysbus_init(Object *o) { SM501SysBusState *sm501 =3D SYSBUS_SM501(o); + OHCISysBusState *ohci =3D &sm501->ohci; SerialMM *smm =3D &sm501->serial; =20 + object_initialize_child(o, "ohci", ohci, TYPE_SYSBUS_OHCI); + qdev_prop_set_uint32(DEVICE(ohci), "num-ports", 2); + object_initialize_child(o, "serial", smm, TYPE_SERIAL_MM); qdev_set_legacy_instance_id(DEVICE(smm), SM501_UART0, 2); qdev_prop_set_uint8(DEVICE(smm), "regshift", 2); --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436327; cv=none; d=zohomail.com; s=zohoarc; b=Fs/2XGjiX3joc/n8P35MHUmyFYyCu088s8VfxgSIXo5YRMR9XNbN3Sz01H33OCPHOLEyKR8KWGGAEG7q08EBMi4uGtJm6irDVujLUcWAtbtsWdEft2qySFjVFA9OReqOIQ4IWa3veSMVxIgICVH3Rh+SyTnpXWvdMuJ4KvQ0WW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436327; 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=mN0VYqfwlRhVEGBvWVUoY9fpevsYWRdufb+QHnf9XBs=; b=Fo/njAfAHqvg3b2R31cg2BSOF1yQqvSQXfxwDWXPVYQP3XKg0Zb0AFhx2OVFQVG2DvJOzYyJYg1y9hoDaG/G4zIRHYOCaJzN9hk84SBYNo8iZukDkIoDD7Bmu2RsIc99FIogksfWtt5+EsY5EmKzlcUE3mDG1CEI6AN8SdBCciY= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436326990452.4095586290214; Fri, 3 Feb 2023 06:58:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUW-0003Qb-T0; Fri, 03 Feb 2023 09:56:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUU-0003MT-PA for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:38 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxUS-00063x-QS for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:38 -0500 Received: by mail-wm1-x334.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso4038388wmq.5 for ; Fri, 03 Feb 2023 06:56:36 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id p16-20020a05600c469000b003a84375d0d1sm8636224wmo.44.2023.02.03.06.56.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mN0VYqfwlRhVEGBvWVUoY9fpevsYWRdufb+QHnf9XBs=; b=IRudY8DDtuihwIxYQR6jmlAatCsacvcZW5DjBbIZ2EoRJejf/pAUWseMauxY4wL4GJ 7ID6P2MmJaEw1evlkqJCXq9Whozs4gJlNydCKt5yXZXzXePLBRap3iTyFgtgeB9BIWgb yDKAibLC0sXnmyjl/FZ9PqY1XdWBUO5tqccB86DxySXC9SOGbc7JKWYPF0OFnLm070xv IQEcu/efvp8gdgKjqqPZW52ZZNOqGkrD/7lEe6zjAnyPPUHTrsbEX2UOPAExLXIiEaZN eBT3EWoGauKWvTT1Om1wqhTHA5P3Z6toagL1XlTtfBvoWL+HFw8Ax5yumwSdwm+l207S yA9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mN0VYqfwlRhVEGBvWVUoY9fpevsYWRdufb+QHnf9XBs=; b=AEBL+ZDn+ZseGkOn5FAa7Rpl2e7B1I9GjiYTu2nnk/IKfJWPsQHDkcFt7HW9PKYzqT Gl4KeHBiu3qmI8PZsYLbO2bmNryD5+OBpNv50Pn2xwiOpOPuJGEToiLOKMEOEPOTaVqm k/4n9yM+QPY9iXAeoRePXxYjUhdtFTMMaJTIVn5GhpzoKuE/Vaskf5v5xcHgPMFQpJtD HQvbEZd+CFRR/q5F5whzvxfeOGqzFI3LhBwhUd792ZjUs2svzJgow27CYSnjJI2CZmwl jOn3Ll04jj6ahffJIjgDi9fNFq/zLz1GZpiKWbm7S4jEP1RdqsoS7DHK4WBmtLNtUXFp C+0Q== X-Gm-Message-State: AO0yUKXNDLlwFw5Xgv6+aClUNifBLFcSAZlAiHP4j+y9sSiYp4zCiqKC EIVPxtjQ0I1Dr1VGSL6Lb4GsWpjOrASJq8dk X-Google-Smtp-Source: AK7set+dvSwlpmiGpAhBIR1nJ8bXLpxFXji/9+JR06YDZWjlFe3+eYhtuYXiBmzZKbgbcGAQ46ID3A== X-Received: by 2002:a05:600c:4711:b0:3df:e474:2ab2 with SMTP id v17-20020a05600c471100b003dfe4742ab2mr5135335wmo.33.1675436195202; Fri, 03 Feb 2023 06:56:35 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan , Yoshinori Sato , Magnus Damm Subject: [PATCH v2 11/15] hw/display/sm501: Alias 'dma-offset' QOM property in chipset object Date: Fri, 3 Feb 2023 15:55:32 +0100 Message-Id: <20230203145536.17585-12-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436327330100003 No need to use an intermediate 'dma-offset' property in the chipset object. Alias the property, so when the machine (here r2d-plus) sets the value on the chipset, it is propagated to the OHCI object. Note we can rename the chipset 'base' property as 'dma-offset' since the object is a non-user-creatable sysbus type. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: BALATON Zoltan --- hw/display/sm501.c | 7 ++----- hw/sh4/r2d.c | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 0f7e09d7e2..efebd93f1e 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1943,7 +1943,6 @@ struct SM501SysBusState { /*< public >*/ SM501State state; uint32_t vram_size; - uint32_t base; SerialMM serial; OHCISysBusState ohci; }; @@ -1964,7 +1963,6 @@ static void sm501_realize_sysbus(DeviceState *dev, Er= ror **errp) sysbus_init_mmio(sbd, &s->state.mmio_region); =20 /* bridge to usb host emulation module */ - qdev_prop_set_uint64(DEVICE(&s->ohci), "dma-offset", s->base); sysbus_realize_and_unref(SYS_BUS_DEVICE(&s->ohci), &error_fatal); memory_region_add_subregion(&s->state.mmio_region, SM501_USB_HOST, sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->ohci), 0)= ); @@ -1979,7 +1977,6 @@ static void sm501_realize_sysbus(DeviceState *dev, Er= ror **errp) =20 static Property sm501_sysbus_properties[] =3D { DEFINE_PROP_UINT32("vram-size", SM501SysBusState, vram_size, 0), - DEFINE_PROP_UINT32("base", SM501SysBusState, base, 0), DEFINE_PROP_END_OF_LIST(), }; =20 @@ -2019,6 +2016,7 @@ static void sm501_sysbus_init(Object *o) SerialMM *smm =3D &sm501->serial; =20 object_initialize_child(o, "ohci", ohci, TYPE_SYSBUS_OHCI); + object_property_add_alias(o, "dma-offset", OBJECT(ohci), "dma-offset"); qdev_prop_set_uint32(DEVICE(ohci), "num-ports", 2); =20 object_initialize_child(o, "serial", smm, TYPE_SERIAL_MM); @@ -2026,8 +2024,7 @@ static void sm501_sysbus_init(Object *o) qdev_prop_set_uint8(DEVICE(smm), "regshift", 2); qdev_prop_set_uint8(DEVICE(smm), "endianness", DEVICE_LITTLE_ENDIAN); =20 - object_property_add_alias(o, "chardev", - OBJECT(smm), "chardev"); + object_property_add_alias(o, "chardev", OBJECT(smm), "chardev"); } =20 static const TypeInfo sm501_sysbus_info =3D { diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 39fc4f19d9..d7020d6d2b 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -274,7 +274,7 @@ static void r2d_init(MachineState *machine) dev =3D qdev_new("sysbus-sm501"); busdev =3D SYS_BUS_DEVICE(dev); qdev_prop_set_uint32(dev, "vram-size", SM501_VRAM_SIZE); - qdev_prop_set_uint32(dev, "base", 0x10000000); + qdev_prop_set_uint64(dev, "dma-offset", 0x10000000); qdev_prop_set_chr(dev, "chardev", serial_hd(2)); sysbus_realize_and_unref(busdev, &error_fatal); sysbus_mmio_map(busdev, 0, 0x10000000); --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436404; cv=none; d=zohomail.com; s=zohoarc; b=ijB/Bicdy0sg35tmZ5EL+tNa1mlaiUQoG6yjuph/l3CNhy4pY3R2CP6s4J3nZSSzhaI1NSe0/YxZ3L/cPIfuz/ROD80cu/f/lrBGNOujZer+LhxMxw8TJJPwh617+sW+2/WNGz2UEHZRzuOJ8gEE9sljsizt9XdZmsQqyZ9oR3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436404; 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=VgyTPh7msAYyuAXqahXOmNxtor/LOuPPEC+v7SLH2W8=; b=AuRJfaEJ8hnLx/U8fiZhgohxFsUqMnbgb3V2TJzBTJG1KHn6+CvfCfbvNvNltF+qRQil5ylradzJ9zCucsgbms1gsYRG1MfKKy91yy3DLwUvDNtf1MkJZDbGeqcgHSkMzRtDpcpzmLyDmRGU8+/VFBsfFhtqrGb0T/Tf7J4/cVc= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436404484667.0317160508864; Fri, 3 Feb 2023 07:00:04 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUa-0003WF-Eg; Fri, 03 Feb 2023 09:56:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUZ-0003VX-Q7 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:43 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxUX-00064g-Mf for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:43 -0500 Received: by mail-wm1-x32f.google.com with SMTP id n28-20020a05600c3b9c00b003ddca7a2bcbso4054232wms.3 for ; Fri, 03 Feb 2023 06:56:41 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id w14-20020a05600c474e00b003dfe57f6f61sm2543539wmo.33.2023.02.03.06.56.39 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VgyTPh7msAYyuAXqahXOmNxtor/LOuPPEC+v7SLH2W8=; b=r84hhi6bkgbF7U5gkkwUAmM9YrM7x6BKIexLXhgMtE2lqswqmHkfe9hxI8t5xBU14t dj5BB5ssopN1lAB1rE+24vzCtuLpXnutmtOJp2sNw/NJgL/vadMjKgkGXol4CWbdeOkf urZgd3AJ+lTm3bQMfL6+QI6l+6J2qiZKXt6Co+N3NcnIVdLqmdk4zztxpZj7+VPsKsXi EVo0REZlkgEc9d8GcRJ01DM3r13TABhWfLxLqlThF0cE80Rf+n0PHqJuPt5jvTimpStw G2FQE26wFzLDfBGQS3yc5mDs26GDI491hY0FH5mhZ6mIsNweKFbIbEamWXUZJaPd40cF +qZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VgyTPh7msAYyuAXqahXOmNxtor/LOuPPEC+v7SLH2W8=; b=QQaFIFZt4YFcrpef1Jdh3EP268JJTQg5Fb2K2ZQXcOJDorRAwA+ljcYZAirxiXv57z wDG9oIK8tjc2lE4vzg6inc75g4YAvRrN8NS/0RJobIYNiSlkfCZIcpgfMHWZRcQZi6cA wVjNjBOSEGhFP3wVJ5mfmw2Qh90pd4UIkWEZ1qyhpovNNL4926AWD7B7BNpTEr3prP6b LU6TM5UYTUiY/sRqGtUHDjU23nwO7jLdfqxmGMipPdjEIPRARkJGLLaJvbYjEu5sEDRB S+saEt4R0vl7oMprbW0YrDA2F6sS7V9krJgiS/876hLx08xdmPpl8falbgy75Za1ctxJ s4mQ== X-Gm-Message-State: AO0yUKWpUZAZ6tb90S70ZpawsAs6hrtG2VyFWww4KaIXW14fxYLUVSTh 1eFnkc4dQwp23cTs5pQxsEV0kWqEQGGi83nN X-Google-Smtp-Source: AK7set80SMJTIMXNqPCKmTnmRz9LXbME7lh8diT5KjvwzF2mnmZ7epBYJjhJpuOEX4DWmmWmc9Y54Q== X-Received: by 2002:a05:600c:3588:b0:3df:e1e9:201d with SMTP id p8-20020a05600c358800b003dfe1e9201dmr5125160wmq.40.1675436200274; Fri, 03 Feb 2023 06:56:40 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , BALATON Zoltan Subject: [PATCH v2 12/15] hw/display/sm501: Unify common QOM properties Date: Fri, 3 Feb 2023 15:55:33 +0100 Message-Id: <20230203145536.17585-13-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436406027100003 Since now PCI and SysBus properties are identical, unify them. Suggested-by: BALATON Zoltan Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: BALATON Zoltan --- hw/display/sm501.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index efebd93f1e..98375138b2 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1975,7 +1975,7 @@ static void sm501_realize_sysbus(DeviceState *dev, Er= ror **errp) /* TODO : chain irq to IRL */ } =20 -static Property sm501_sysbus_properties[] =3D { +static Property sm501_common_properties[] =3D { DEFINE_PROP_UINT32("vram-size", SM501SysBusState, vram_size, 0), DEFINE_PROP_END_OF_LIST(), }; @@ -2004,7 +2004,7 @@ static void sm501_sysbus_class_init(ObjectClass *klas= s, void *data) dc->realize =3D sm501_realize_sysbus; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->desc =3D "SM501 Multimedia Companion"; - device_class_set_props(dc, sm501_sysbus_properties); + device_class_set_props(dc, sm501_common_properties); dc->reset =3D sm501_reset_sysbus; dc->vmsd =3D &vmstate_sm501_sysbus; } @@ -2062,11 +2062,6 @@ static void sm501_realize_pci(PCIDevice *dev, Error = **errp) &s->state.mmio_region); } =20 -static Property sm501_pci_properties[] =3D { - DEFINE_PROP_UINT32("vram-size", SM501PCIState, vram_size, 64 * MiB), - DEFINE_PROP_END_OF_LIST(), -}; - static void sm501_reset_pci(DeviceState *dev) { SM501PCIState *s =3D PCI_SM501(dev); @@ -2098,7 +2093,7 @@ static void sm501_pci_class_init(ObjectClass *klass, = void *data) k->class_id =3D PCI_CLASS_DISPLAY_OTHER; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); dc->desc =3D "SM501 Display Controller"; - device_class_set_props(dc, sm501_pci_properties); + device_class_set_props(dc, sm501_common_properties); dc->reset =3D sm501_reset_pci; dc->hotpluggable =3D false; dc->vmsd =3D &vmstate_sm501_pci; --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436321; cv=none; d=zohomail.com; s=zohoarc; b=Q+DOrs1Tet59vFYYJFD1uRtMGZCSJcdW2Q5D5FFO4L7/XukUVW8j0GyOeLeYgUPjxNtDPZxqIyVX+siZyp23hjlasz7DOvwxe8erTkPmL8CVUGx6sE290G+buni+Pn2zVhsIGHv3bFC1PtkSeWVKN/U4Hth/8oNzYH9FN9ktJqo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436321; 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=A0e0NEin6/qB1UWKlWtZ3V9I0KbRtGgK0QPchGtumd0=; b=gOMGt44lGpmg5JXL3f0IX1hAFiSsgBS1fpk4sJXtWFGnqY0W28O/++q5z969oQ7qBzSZwypSJBxoyioWXIYGhjtI3Td7UMSaaT51rHeRy4dU8oQMxG1fd02n8RRtLBSH95eaYfQ9rBzaHViuUIyfQoxb9D5i9fkxDkqKXqMC1lc= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436321516828.6218228835352; Fri, 3 Feb 2023 06:58:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUf-0003jN-8a; Fri, 03 Feb 2023 09:56:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUe-0003iJ-7a for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:48 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxUc-0005uy-96 for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:47 -0500 Received: by mail-wm1-x335.google.com with SMTP id d4-20020a05600c3ac400b003db1de2aef0so4066579wms.2 for ; Fri, 03 Feb 2023 06:56:45 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id c17-20020a7bc851000000b003dc530186e1sm7952124wml.45.2023.02.03.06.56.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=A0e0NEin6/qB1UWKlWtZ3V9I0KbRtGgK0QPchGtumd0=; b=UOwBBOx+pSOAx6o+hT9sEcWjZyxdZrjr2CamsYDUfjBVb7aI3AnVNQUIyblDNfTr0Y c0vFDlEzUCDqg/JSurVSKPlGi4X8L0tRnVZesraz9IpixZp83xc2LP89dc0aACmI2cx1 hlZ5BcxLJ+PBKoq+U0SWPBkN+uYIuyrwDnunGbSjRB6rrg4EpnTGO3GVM+aMNFG4Vl/5 sSaP6LRx55j625wZbQe5LLmEu3JKXWPUweRd6Zq5jRXKhroGIiUyvlJdJ0E4OUQHOeqw ey+j91d3dr0XsRh5cFVBR5NQK2HrY5PwKvKS2lzkY91RiCdYCKUmrG8m++XjwgEnAaIz J70g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=A0e0NEin6/qB1UWKlWtZ3V9I0KbRtGgK0QPchGtumd0=; b=4iOwghUiyy+61THbr+3nVTZGxIKjiyvY0zCyOM0ven10JxcgfPOH/sGk2Cq0ly5t8+ HDCp9J/f7UkDcqZzfJxJCigntRj5eDSFaS25HdAejwLxUNRVzTtYkF5YBXtwhB/Im7+O 57OrHOCCc2nRl9l8N6njWuqZWCHAJSlQSXCB5uXrLH0aFPYbssA8v+Qvoim8ckwwko57 GTys3ygVZVuHakUXUePU3DdmNx80eB+yfQrRJr9fUtEYZ9JfDUAZZh4VwK6bszHD6gMs RZzcPOYFYc6BIx78Ejx+vnkoTCm06CrpTo0/coB909r4V2Iib/iPi99ezyDpqxGRL5+o 4NjQ== X-Gm-Message-State: AO0yUKWqYGlhjeXjDllkOnQx4ym4UjByAf12ISWXINoSw4mtufDXs7of aC7B6L2+diabt2iLy19tzLOfHYQsHjIueD9v X-Google-Smtp-Source: AK7set8xrIRk7MmPQ/e1Ax1xPOTInmLVJ6YNklJuPbsHP3w57///fWzywOZou1vYHJM48NW9GXDkaQ== X-Received: by 2002:a05:600c:c0d:b0:3dd:a4ad:ae45 with SMTP id fm13-20020a05600c0c0d00b003dda4adae45mr9636626wmb.12.1675436205411; Fri, 03 Feb 2023 06:56:45 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann Subject: [PATCH v2 13/15] hw/qdev: Remove DEFINE_PROP_DMAADDR() and 'hw/qdev-dma.h' Date: Fri, 3 Feb 2023 15:55:34 +0100 Message-Id: <20230203145536.17585-14-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=philmd@linaro.org; helo=mail-wm1-x335.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436323303100003 DEFINE_PROP_DMAADDR() is only used once. Since it doesn't add much value, simply remove it, along with the header defining it. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Markus Armbruster --- hw/usb/hcd-ohci-pci.c | 1 - hw/usb/hcd-ohci.c | 3 +-- include/hw/qdev-dma.h | 16 ---------------- 3 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 include/hw/qdev-dma.h diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c index 6b630d35a7..92cc151264 100644 --- a/hw/usb/hcd-ohci-pci.c +++ b/hw/usb/hcd-ohci-pci.c @@ -25,7 +25,6 @@ #include "migration/vmstate.h" #include "hw/pci/pci_device.h" #include "hw/sysbus.h" -#include "hw/qdev-dma.h" #include "hw/qdev-properties.h" #include "trace.h" #include "hcd-ohci.h" diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 9d68036d23..26c377bf1b 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -33,7 +33,6 @@ #include "hw/usb.h" #include "migration/vmstate.h" #include "hw/sysbus.h" -#include "hw/qdev-dma.h" #include "hw/qdev-properties.h" #include "trace.h" #include "hcd-ohci.h" @@ -2008,7 +2007,7 @@ static Property ohci_sysbus_properties[] =3D { DEFINE_PROP_STRING("masterbus", OHCISysBusState, masterbus), DEFINE_PROP_UINT32("num-ports", OHCISysBusState, num_ports, 3), DEFINE_PROP_UINT32("firstport", OHCISysBusState, firstport, 0), - DEFINE_PROP_DMAADDR("dma-offset", OHCISysBusState, dma_offset, 0), + DEFINE_PROP_UINT64("dma-offset", OHCISysBusState, dma_offset, 0), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/qdev-dma.h b/include/hw/qdev-dma.h deleted file mode 100644 index b00391aa0c..0000000000 --- a/include/hw/qdev-dma.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Support for dma_addr_t typed properties - * - * Copyright (C) 2012 David Gibson, IBM Corporation. - * - * This work is licensed under the terms of the GNU GPL, version 2 or late= r. - * See the COPYING file in the top-level directory. - */ - -#ifndef HW_QDEV_DMA_H -#define HW_QDEV_DMA_H - -#define DEFINE_PROP_DMAADDR(_n, _s, _f, _d) \ - DEFINE_PROP_UINT64(_n, _s, _f, _d) - -#endif --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436350; cv=none; d=zohomail.com; s=zohoarc; b=homP/iV/BVree/zzPW5Tg2K72c26VMt7ius7zBFNi8CL4U5Ml9VI1y/pjuPS696a8/AXiduXsiKaaCF+TPcX49mPg6g3jTzC1W0QlRT6Ic0bakuquJL49tASGUv2rZ8+5InuvlndXbnQDWN7NKoaE5Z0s4JMtoOuSBz63y5zDuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436350; 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=EJd5TtZ9CjeRkTkoWKdyn/Q2ehPN6hId4MKx9NKONbE=; b=P5gIkUHqY4wyIzzRImrEiy80EeLekpOTujLf89G0ZF1Ur0uJy14mC9zQElZHWkDGBUj1ST54JF/9mtybqKt6D/2gtat+bNKm94bHTsQxtxu22vjvvXw9+nWZ+iFn6cWhO/ZBJMOLRbDgltQg1B08DGfEKiuO9/o+9jgpaJ3EXhA= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436350167975.3279147590716; Fri, 3 Feb 2023 06:59:10 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUn-0004LS-5h; Fri, 03 Feb 2023 09:56:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUl-0004Dx-Ez for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:55 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxUi-00066X-2g for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:55 -0500 Received: by mail-wm1-x334.google.com with SMTP id k16so4072089wms.2 for ; Fri, 03 Feb 2023 06:56:51 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id m5-20020a7bcb85000000b003de8a1b06c0sm8138324wmi.7.2023.02.03.06.56.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EJd5TtZ9CjeRkTkoWKdyn/Q2ehPN6hId4MKx9NKONbE=; b=iQBhaAZoehQdMMYmFx3NhanpaFj5eVp2VwvNaim3lBwb8+vEq/n+tL/75AIkmYIo3T wvvSJt2N0KQtcCNSmvQDQyH/NJMF1S0gkx/iKpnaiYeHiqTHcp+kx70ySjYv/u67sqhC j8aRZKVSzIZF7R6bT+At7AdyFdUUwbOObtrnZ/GNk4PoBZuAZ85G98LzCT+4jKJ6GWJc 7hEOVUeJrJwyTDlTrzlIsoKtiOsZFSvIgMqASnsHTxS9nERlUi9NkfZ5vf1bfbu6WEMB MlbhIXKY49/BzjRnCqGQTq10TWcx4UomliBb6O6w/rAQlq1uEmhDm2wj/StL+EtoBBsk mxuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EJd5TtZ9CjeRkTkoWKdyn/Q2ehPN6hId4MKx9NKONbE=; b=fUZx0dwq8QGKODhikkqoI2WXRmRZsNL1tRYnK/ixGVYUuc7wVCHo5FLDivYmePEd9R yRcNIPsnZpSm9VLPBHV6cYC1p65qWqKY5SIfevh4fBdygcHiTo1k+1//9JJj7cMQvb7y 1yqoAlNYhtKm/pzrXjn/D7UUnabsUgMPyACFOLaTD817noq1R4hxJhJ1s1oLPLxFKoJg T/6XTml51awx1JBlrc2VeB1oihZfA+/lWCdooFfFxIZxYLyaZwWrQGCfvSqsXZCnwSQo 7Hq+ZAdoj5UcUalmmj1YXwwQe1W8YDOB2XQjKZbDeItOHIvBWW/XTPQ7JhOXPvZ/Nucb 0xqg== X-Gm-Message-State: AO0yUKXwMW1m6hD2gKLljggXRaVQf68J7/92UIRmbnEKOiKuJqVDgI8T o6atxU0Pq0pFrQEWCazsPaQ6U1CM/aa7pecA X-Google-Smtp-Source: AK7set8LdA+4Uma5J0U9LtGF7KyZEMEuu30hNp/ML5S/IA3GBipBvpv75Fw4yIIriqb3OWnmhewKVQ== X-Received: by 2002:a05:600c:3d98:b0:3df:50eb:7cd9 with SMTP id bi24-20020a05600c3d9800b003df50eb7cd9mr8290403wmb.14.1675436210520; Fri, 03 Feb 2023 06:56:50 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paul Burton , Aleksandar Rikalo , Aurelien Jarno , Jiaxun Yang Subject: [PATCH v2 14/15] hw/mips: Declare all length properties as unsigned Date: Fri, 3 Feb 2023 15:55:35 +0100 Message-Id: <20230203145536.17585-15-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436351651100003 Some length properties are signed, other unsigned: hw/mips/cps.c:183: DEFINE_PROP_UINT32("num-vp", MIPSCPSState, num_vp, = 1), hw/mips/cps.c:184: DEFINE_PROP_UINT32("num-irq", MIPSCPSState, num_irq= , 256), hw/misc/mips_cmgcr.c:215: DEFINE_PROP_INT32("num-vp", MIPSGCRState, nu= m_vps, 1), hw/misc/mips_cpc.c:167: DEFINE_PROP_UINT32("num-vp", MIPSCPCState, num= _vp, 0x1), hw/misc/mips_itu.c:552: DEFINE_PROP_INT32("num-fifo", MIPSITUState, nu= m_fifo, hw/misc/mips_itu.c:554: DEFINE_PROP_INT32("num-semaphores", MIPSITUSta= te, Since negative values are not used (the minimum is '0'), unify by declaring all properties as unsigned. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/intc/mips_gic.c | 4 ++-- hw/mips/boston.c | 2 +- hw/mips/cps.c | 12 ++++++------ hw/mips/malta.c | 2 +- hw/misc/mips_cmgcr.c | 2 +- hw/misc/mips_itu.c | 4 ++-- include/hw/intc/mips_gic.h | 4 ++-- include/hw/misc/mips_cmgcr.h | 2 +- include/hw/misc/mips_itu.h | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/hw/intc/mips_gic.c b/hw/intc/mips_gic.c index bda4549925..4bdc3b1bd1 100644 --- a/hw/intc/mips_gic.c +++ b/hw/intc/mips_gic.c @@ -439,8 +439,8 @@ static void mips_gic_realize(DeviceState *dev, Error **= errp) } =20 static Property mips_gic_properties[] =3D { - DEFINE_PROP_INT32("num-vp", MIPSGICState, num_vps, 1), - DEFINE_PROP_INT32("num-irq", MIPSGICState, num_irq, 256), + DEFINE_PROP_UINT32("num-vp", MIPSGICState, num_vps, 1), + DEFINE_PROP_UINT32("num-irq", MIPSGICState, num_irq, 256), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/hw/mips/boston.c b/hw/mips/boston.c index a9d87f3437..21ad844519 100644 --- a/hw/mips/boston.c +++ b/hw/mips/boston.c @@ -702,7 +702,7 @@ static void boston_mach_init(MachineState *machine) object_initialize_child(OBJECT(machine), "cps", &s->cps, TYPE_MIPS_CPS= ); object_property_set_str(OBJECT(&s->cps), "cpu-type", machine->cpu_type, &error_fatal); - object_property_set_int(OBJECT(&s->cps), "num-vp", machine->smp.cpus, + object_property_set_uint(OBJECT(&s->cps), "num-vp", machine->smp.cpus, &error_fatal); qdev_connect_clock_in(DEVICE(&s->cps), "clk-in", qdev_get_clock_out(dev, "cpu-refclk")); diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 2b436700ce..38acc57468 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -114,9 +114,9 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) /* Inter-Thread Communication Unit */ if (itu_present) { object_initialize_child(OBJECT(dev), "itu", &s->itu, TYPE_MIPS_ITU= ); - object_property_set_int(OBJECT(&s->itu), "num-fifo", 16, + object_property_set_uint(OBJECT(&s->itu), "num-fifo", 16, &error_abort); - object_property_set_int(OBJECT(&s->itu), "num-semaphores", 16, + object_property_set_uint(OBJECT(&s->itu), "num-semaphores", 16, &error_abort); object_property_set_bool(OBJECT(&s->itu), "saar-present", saar_pre= sent, &error_abort); @@ -133,7 +133,7 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) =20 /* Cluster Power Controller */ object_initialize_child(OBJECT(dev), "cpc", &s->cpc, TYPE_MIPS_CPC); - object_property_set_int(OBJECT(&s->cpc), "num-vp", s->num_vp, + object_property_set_uint(OBJECT(&s->cpc), "num-vp", s->num_vp, &error_abort); object_property_set_int(OBJECT(&s->cpc), "vp-start-running", 1, &error_abort); @@ -146,9 +146,9 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) =20 /* Global Interrupt Controller */ object_initialize_child(OBJECT(dev), "gic", &s->gic, TYPE_MIPS_GIC); - object_property_set_int(OBJECT(&s->gic), "num-vp", s->num_vp, + object_property_set_uint(OBJECT(&s->gic), "num-vp", s->num_vp, &error_abort); - object_property_set_int(OBJECT(&s->gic), "num-irq", 128, + object_property_set_uint(OBJECT(&s->gic), "num-irq", 128, &error_abort); if (!sysbus_realize(SYS_BUS_DEVICE(&s->gic), errp)) { return; @@ -161,7 +161,7 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) gcr_base =3D env->CP0_CMGCRBase << 4; =20 object_initialize_child(OBJECT(dev), "gcr", &s->gcr, TYPE_MIPS_GCR); - object_property_set_int(OBJECT(&s->gcr), "num-vp", s->num_vp, + object_property_set_uint(OBJECT(&s->gcr), "num-vp", s->num_vp, &error_abort); object_property_set_int(OBJECT(&s->gcr), "gcr-rev", 0x800, &error_abort); diff --git a/hw/mips/malta.c b/hw/mips/malta.c index ec172b111a..af9021316d 100644 --- a/hw/mips/malta.c +++ b/hw/mips/malta.c @@ -1066,7 +1066,7 @@ static void create_cps(MachineState *ms, MaltaState *= s, object_initialize_child(OBJECT(s), "cps", &s->cps, TYPE_MIPS_CPS); object_property_set_str(OBJECT(&s->cps), "cpu-type", ms->cpu_type, &error_fatal); - object_property_set_int(OBJECT(&s->cps), "num-vp", ms->smp.cpus, + object_property_set_uint(OBJECT(&s->cps), "num-vp", ms->smp.cpus, &error_fatal); qdev_connect_clock_in(DEVICE(&s->cps), "clk-in", s->cpuclk); sysbus_realize(SYS_BUS_DEVICE(&s->cps), &error_fatal); diff --git a/hw/misc/mips_cmgcr.c b/hw/misc/mips_cmgcr.c index 3c8b37f700..66eb11662c 100644 --- a/hw/misc/mips_cmgcr.c +++ b/hw/misc/mips_cmgcr.c @@ -212,7 +212,7 @@ static const VMStateDescription vmstate_mips_gcr =3D { }; =20 static Property mips_gcr_properties[] =3D { - DEFINE_PROP_INT32("num-vp", MIPSGCRState, num_vps, 1), + DEFINE_PROP_UINT32("num-vp", MIPSGCRState, num_vps, 1), DEFINE_PROP_INT32("gcr-rev", MIPSGCRState, gcr_rev, 0x800), DEFINE_PROP_UINT64("gcr-base", MIPSGCRState, gcr_base, GCR_BASE_ADDR), DEFINE_PROP_LINK("gic", MIPSGCRState, gic_mr, TYPE_MEMORY_REGION, diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index badef5c214..a06cdd10ea 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -549,9 +549,9 @@ static void mips_itu_reset(DeviceState *dev) } =20 static Property mips_itu_properties[] =3D { - DEFINE_PROP_INT32("num-fifo", MIPSITUState, num_fifo, + DEFINE_PROP_UINT32("num-fifo", MIPSITUState, num_fifo, ITC_FIFO_NUM_MAX), - DEFINE_PROP_INT32("num-semaphores", MIPSITUState, num_semaphores, + DEFINE_PROP_UINT32("num-semaphores", MIPSITUState, num_semaphores, ITC_SEMAPH_NUM_MAX), DEFINE_PROP_BOOL("saar-present", MIPSITUState, saar_present, false), DEFINE_PROP_END_OF_LIST(), diff --git a/include/hw/intc/mips_gic.h b/include/hw/intc/mips_gic.h index eeb136e261..5e4c71edd4 100644 --- a/include/hw/intc/mips_gic.h +++ b/include/hw/intc/mips_gic.h @@ -211,8 +211,8 @@ struct MIPSGICState { /* GIC VP Timer */ MIPSGICTimerState *gic_timer; =20 - int32_t num_vps; - int32_t num_irq; + uint32_t num_vps; + uint32_t num_irq; }; =20 #endif /* MIPS_GIC_H */ diff --git a/include/hw/misc/mips_cmgcr.h b/include/hw/misc/mips_cmgcr.h index 9fa58942d7..db4bf5f449 100644 --- a/include/hw/misc/mips_cmgcr.h +++ b/include/hw/misc/mips_cmgcr.h @@ -75,7 +75,7 @@ struct MIPSGCRState { SysBusDevice parent_obj; =20 int32_t gcr_rev; - int32_t num_vps; + uint32_t num_vps; hwaddr gcr_base; MemoryRegion iomem; MemoryRegion *cpc_mr; diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index 50d961106d..ab6d286c38 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -57,8 +57,8 @@ struct MIPSITUState { SysBusDevice parent_obj; /*< public >*/ =20 - int32_t num_fifo; - int32_t num_semaphores; + uint32_t num_fifo; + uint32_t num_semaphores; =20 /* ITC Storage */ ITCStorageCell *cell; --=20 2.38.1 From nobody Fri Mar 29 06:41:03 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1675436289; cv=none; d=zohomail.com; s=zohoarc; b=OOhTVA5M9DkEq+IzT8KH/aGD+RuIBdlglvy6j+Wjpr8Eum7skuMtpCuo8WJHJHYpzm0cJjp/kuRFSsrHhqmlnJTQem439w060/wm/SMrlBfzn86907U7wmDlN0bMEFixdp/sZPTDOZSylOZwFG0p+0szSSvB28d6qjXT+25w79E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1675436289; 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=dWk/17AxotpO2OiTLMBjakLfcxFYdT89H87fwCpt4bM=; b=Iv8+mvP4G4ynypG6WUgRjlqzsVmtLqeK2gsShxcLVD8OIB11orI1Nuccs6eoyc1ElcX99ShoYiXUO3QGOQd+f6buUJo1uIjsgYdjM7ESSQSpy2H/Z0Ig5pDeiIBtTgWHjcRSPoM1duGYV3RR5LpaGCnSBbv/i+Vkf2HRbiNpTE8= 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+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1675436289929705.4753480694555; Fri, 3 Feb 2023 06:58:09 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNxUr-0004oS-4z; Fri, 03 Feb 2023 09:57:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNxUp-0004ft-Sq for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:59 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNxUm-00064g-Ig for qemu-devel@nongnu.org; Fri, 03 Feb 2023 09:56:59 -0500 Received: by mail-wm1-x32f.google.com with SMTP id n28-20020a05600c3b9c00b003ddca7a2bcbso4054732wms.3 for ; Fri, 03 Feb 2023 06:56:56 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l21-20020a05600c1d1500b003dc59d6f2f8sm3268871wms.17.2023.02.03.06.56.54 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 03 Feb 2023 06:56:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dWk/17AxotpO2OiTLMBjakLfcxFYdT89H87fwCpt4bM=; b=V6lPwP4mC1QInCRGj5307s5pjCiA3lKNJkUvWVx8fuaigPxk6PbhynIY4EZDMGToJ5 Mbh5RPJZOYY1D3M1Xmq72e2vUUh2MJvYkUrl4vE7Tk7DiZEJHZ0M/aadotqv6B/KKNjT RK8vkFsmTXOaMED8fAdbQxODS1T3EiGxu2bGq0SCeKAnk5Mf0dCQjbn6Y4YjBU4XU3Pn +6Voic1JIfNOM0QPPQN8qhznpyCj7VxrSCvxiTD8e/tTXeKrPq48mc0sN8a3/vmaCtO0 zAz1tD7vIuaMIonMzXasOoTBFPphFNCXj610evAkNbgA/V744waaweh5LIltdFJ+3KQI UpFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dWk/17AxotpO2OiTLMBjakLfcxFYdT89H87fwCpt4bM=; b=DRGOG+wiCdVZlgFrf1wpmxm7OpPScZ5FvGTtXn74znyX2Kx1Tti7LbLtMpMbYLk4yA XTRNB02xUoMWRYd2elKDxTZBzIHPxO9v37cKvFLQH5/4rny+9S2CL2gRk3F6+hIg0kW2 yQrfRh5B4K84oRZjpqbNkT3qFcY+U/9DF+IPN2NI6ZepiwyAYQ6iCpfgJmq/7aSYpkW8 T0ED+viYtSYtqwUrp4aOfYh41abTr6beCi+qOEIi4NT2Twzwgz1/cYrkvC8Ug+lNihpL icTKmY1wwDdm41r/rf7SmEgRdERPvnPCz9tvHoYN1H5uFLfTFnKVR4eppxneFfepas1y GYlg== X-Gm-Message-State: AO0yUKXbciUbPkgt8+MDTVoCozLDIV2yGkmYhYS1fuyQowWe6SqhCQqt MTcZyfk2/knc5V96OgYJPzyQo/97zJErlQoN X-Google-Smtp-Source: AK7set83omHuhvDngmlsQw3r/AHFyoXLVLkZGwdKRzBPShnV1/RwCYxKCB5QnsFwJRb4sBQLlGQpJw== X-Received: by 2002:a05:600c:3ba5:b0:3d3:4007:9c88 with SMTP id n37-20020a05600c3ba500b003d340079c88mr12435443wms.18.1675436215514; Fri, 03 Feb 2023 06:56:55 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Markus Armbruster , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, Eduardo Habkost , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Jiaxun Yang Subject: [RFC PATCH v2 15/15] hw/mips/itu: Pass SAAR using QOM link property Date: Fri, 3 Feb 2023 15:55:36 +0100 Message-Id: <20230203145536.17585-16-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230203145536.17585-1-philmd@linaro.org> References: <20230203145536.17585-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1675436291176100003 QOM objects shouldn't access each other internals fields except using the QOM API. mips_cps_realize() instantiates a TYPE_MIPS_ITU object, and directly sets the 'saar' pointer: if (saar_present) { s->itu.saar =3D &env->CP0_SAAR; } In order to avoid that, pass the MIPS_CPU object via a QOM link property, and set the 'saar' pointer in mips_itu_realize(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC because not tested. --- hw/mips/cps.c | 23 ++++++----------------- hw/misc/mips_itu.c | 26 ++++++++++++++++++-------- include/hw/misc/mips_itu.h | 5 ++--- 3 files changed, 26 insertions(+), 28 deletions(-) diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 38acc57468..2b5269ebf1 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -66,20 +66,17 @@ static bool cpu_mips_itu_supported(CPUMIPSState *env) static void mips_cps_realize(DeviceState *dev, Error **errp) { MIPSCPSState *s =3D MIPS_CPS(dev); - CPUMIPSState *env; - MIPSCPU *cpu; - int i; target_ulong gcr_base; bool itu_present =3D false; - bool saar_present =3D false; =20 if (!clock_get(s->clock)) { error_setg(errp, "CPS input clock is not connected to an output cl= ock"); return; } =20 - for (i =3D 0; i < s->num_vp; i++) { - cpu =3D MIPS_CPU(object_new(s->cpu_type)); + for (int i =3D 0; i < s->num_vp; i++) { + MIPSCPU *cpu =3D MIPS_CPU(object_new(s->cpu_type)); + CPUMIPSState *env =3D &cpu->env; =20 /* All VPs are halted on reset. Leave powering up to CPC. */ if (!object_property_set_bool(OBJECT(cpu), "start-powered-off", tr= ue, @@ -97,7 +94,6 @@ static void mips_cps_realize(DeviceState *dev, Error **er= rp) cpu_mips_irq_init_cpu(cpu); cpu_mips_clock_init(cpu); =20 - env =3D &cpu->env; if (cpu_mips_itu_supported(env)) { itu_present =3D true; /* Attach ITC Tag to the VP */ @@ -107,22 +103,15 @@ static void mips_cps_realize(DeviceState *dev, Error = **errp) qemu_register_reset(main_cpu_reset, cpu); } =20 - cpu =3D MIPS_CPU(first_cpu); - env =3D &cpu->env; - saar_present =3D (bool)env->saarp; - /* Inter-Thread Communication Unit */ if (itu_present) { object_initialize_child(OBJECT(dev), "itu", &s->itu, TYPE_MIPS_ITU= ); + object_property_set_link(OBJECT(&s->itu), "cpu[0]", + OBJECT(first_cpu), &error_abort); object_property_set_uint(OBJECT(&s->itu), "num-fifo", 16, &error_abort); object_property_set_uint(OBJECT(&s->itu), "num-semaphores", 16, &error_abort); - object_property_set_bool(OBJECT(&s->itu), "saar-present", saar_pre= sent, - &error_abort); - if (saar_present) { - s->itu.saar =3D &env->CP0_SAAR; - } if (!sysbus_realize(SYS_BUS_DEVICE(&s->itu), errp)) { return; } @@ -158,7 +147,7 @@ static void mips_cps_realize(DeviceState *dev, Error **= errp) sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->gic)= , 0)); =20 /* Global Configuration Registers */ - gcr_base =3D env->CP0_CMGCRBase << 4; + gcr_base =3D MIPS_CPU(first_cpu)->env.CP0_CMGCRBase << 4; =20 object_initialize_child(OBJECT(dev), "gcr", &s->gcr, TYPE_MIPS_GCR); object_property_set_uint(OBJECT(&s->gcr), "num-vp", s->num_vp, diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c index a06cdd10ea..0eda302db4 100644 --- a/hw/misc/mips_itu.c +++ b/hw/misc/mips_itu.c @@ -93,10 +93,10 @@ void itc_reconfigure(MIPSITUState *tag) uint64_t size =3D (1 * KiB) + (am[1] & ITC_AM1_ADDR_MASK_MASK); bool is_enabled =3D (am[0] & ITC_AM0_EN_MASK) !=3D 0; =20 - if (tag->saar_present) { - address =3D ((*(uint64_t *) tag->saar) & 0xFFFFFFFFE000ULL) << 4; - size =3D 1ULL << ((*(uint64_t *) tag->saar >> 1) & 0x1f); - is_enabled =3D *(uint64_t *) tag->saar & 1; + if (tag->saar) { + address =3D (tag->saar[0] & 0xFFFFFFFFE000ULL) << 4; + size =3D 1ULL << ((tag->saar[0] >> 1) & 0x1f); + is_enabled =3D tag->saar[0] & 1; } =20 memory_region_transaction_begin(); @@ -157,7 +157,7 @@ static inline ITCView get_itc_view(hwaddr addr) static inline int get_cell_stride_shift(const MIPSITUState *s) { /* Minimum interval (for EntryGain =3D 0) is 128 B */ - if (s->saar_present) { + if (s->saar) { return 7 + ((s->icr0 >> ITC_ICR0_BLK_GRAIN) & ITC_ICR0_BLK_GRAIN_MASK); } else { @@ -515,6 +515,7 @@ static void mips_itu_init(Object *obj) static void mips_itu_realize(DeviceState *dev, Error **errp) { MIPSITUState *s =3D MIPS_ITU(dev); + CPUMIPSState *env; =20 if (s->num_fifo > ITC_FIFO_NUM_MAX) { error_setg(errp, "Exceed maximum number of FIFO cells: %d", @@ -526,6 +527,15 @@ static void mips_itu_realize(DeviceState *dev, Error *= *errp) s->num_semaphores); return; } + if (!s->cpu0) { + error_setg(errp, "Missing 'cpu[0]' property"); + return; + } + + env =3D &s->cpu0->env; + if (env->saarp) { + s->saar =3D env->CP0_SAAR; + } =20 s->cell =3D g_new(ITCStorageCell, get_num_cells(s)); } @@ -534,8 +544,8 @@ static void mips_itu_reset(DeviceState *dev) { MIPSITUState *s =3D MIPS_ITU(dev); =20 - if (s->saar_present) { - *(uint64_t *) s->saar =3D 0x11 << 1; + if (s->saar) { + s->saar[0] =3D 0x11 << 1; s->icr0 =3D get_num_cells(s) << ITC_ICR0_CELL_NUM; } else { s->ITCAddressMap[0] =3D 0; @@ -553,7 +563,7 @@ static Property mips_itu_properties[] =3D { ITC_FIFO_NUM_MAX), DEFINE_PROP_UINT32("num-semaphores", MIPSITUState, num_semaphores, ITC_SEMAPH_NUM_MAX), - DEFINE_PROP_BOOL("saar-present", MIPSITUState, saar_present, false), + DEFINE_PROP_LINK("cpu[0]", MIPSITUState, cpu0, TYPE_MIPS_CPU, MIPSCPU = *), DEFINE_PROP_END_OF_LIST(), }; =20 diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h index ab6d286c38..35218b2d14 100644 --- a/include/hw/misc/mips_itu.h +++ b/include/hw/misc/mips_itu.h @@ -72,9 +72,8 @@ struct MIPSITUState { uint64_t icr0; =20 /* SAAR */ - bool saar_present; - void *saar; - + uint64_t *saar; + MIPSCPU *cpu0; }; =20 /* Get ITC Configuration Tag memory region. */ --=20 2.38.1