From nobody Fri Apr 4 21:29:30 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1741977248; cv=none; d=zohomail.com; s=zohoarc; b=lBz3mO9fBWEkq5VXZuaES4F2XWp2JvjS5/D8vRif1J5WgECgeItK4zuVwqNwPxwmskMD9QIISWaPDwzzvbK80Jx5mXYvSgjcH1aESBwv8LkomjMsyJxYVWRfvCv+id+kkm5sBpPcSUAAbIq9mKnq80b4DnHEnRrHsy5RMFKYMyg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1741977248; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=zAO3S/7q0ZinhoijfNeacj7mj7W5fG+tqzSOImMUvxo=; b=ezmNjqSY8rpWo4bnqSXtQJao1E8/UFnluUHfmflMIPeiXFNcJtOGppABTnYEAdlF6fuc9TupV3t67XOg8Q9Xs9NPG0KPJsE9cs7cvVs4dbNtE7yPurxGPW8K0qBFQ3pSCquxP3Xo1EB1ntMQescXjL04lw+HK1U2tn51M1bPGFc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1741977248683398.4846568561413; Fri, 14 Mar 2025 11:34:08 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tt9px-000899-72; Fri, 14 Mar 2025 14:32:49 -0400 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 1tt9pv-00088H-BT; Fri, 14 Mar 2025 14:32:47 -0400 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tt9ps-0007gp-Se; Fri, 14 Mar 2025 14:32:46 -0400 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-5e5deb6482cso6283173a12.1; Fri, 14 Mar 2025 11:32:43 -0700 (PDT) Received: from Provence.localdomain (dynamic-2a02-3100-1ac1-f400-0219-99ff-feb2-2458.310.pool.telefonica.de. [2a02:3100:1ac1:f400:219:99ff:feb2:2458]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-ac3147f0ca7sm262104466b.60.2025.03.14.11.32.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 11:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741977162; x=1742581962; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zAO3S/7q0ZinhoijfNeacj7mj7W5fG+tqzSOImMUvxo=; b=UBNy9Po5sRLFhbVUglPCpubKp09vhuv1+nJ+ere/bomrOcXaNM+nFaUaVefCrE1nrO gBVTfoQjKHTco6uR43XKxG9tdm24r6nb7Of2jHjiOiur6IUxer9qIgrCQOMpqQ24AMu7 ve7FapXgTdQ0VGun9Sz3rKn8cIzy0rSplxhyGUK7jpDf1v6Viq0lY/HP969BcYTyX6aj faKSS+o8BrLjeVuocut0ikPHe3dsI6b53rw4a2yHLzK4dszTvijVMCcNgAUeaSAI0K91 Z6YfH6DUXGjzKHhf+yE5jXeDytmQ5NHJP+84MT0/TsNOL6vaJztBU0GVGPaBO5nRQbOA 8t1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741977162; x=1742581962; 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=zAO3S/7q0ZinhoijfNeacj7mj7W5fG+tqzSOImMUvxo=; b=Arb7EsOwwvD7urKzMO/Z2r3o2ZpEutMNRQNkAh3rlxlOJnePbOS8DDOJWB30SpGV3v ZnND893zh/1VXcqq6Tl9PK82p/0/QbxztGp7ZxNqnYHPzSL8+xujMpygLdn8LoB9r7qI kah9szs5yhLenyOrQ2ApGyDEJZgmohfzUNRxG4HrAtSUcKhwUKbt7KpOKa7WO7dW0fwX Cp7pvSKHhr87zQurbTWuczO3qOOsDbtBdtb4e+9sFNUVKtrZcYm1z3wher16O6eIfzQC 3q7ulb3Ae9RyM6Cga2P/bKuXPbFAs/6pIshugdVcceJnokpFbWtYJfeRn1VmeMXwk9sa j5wg== X-Forwarded-Encrypted: i=1; AJvYcCWH2rjkT6+FdO0fy0nQq+ncWD8kFF4fi5zWXIkVvnt01PXXnARCb96gixJ0hO7mf/Nt7fdMBfygmw==@nongnu.org X-Gm-Message-State: AOJu0YxsRVwdVZPLZQcFwizf9oXAd0K2KGytoqfFojR8NfXjGH1ULRdl GnXjCgeU6UifEOqX/jWJfE3gz7Sd7Z6QEPgHalVCgkTDrQgwFFn1ptuDWA== X-Gm-Gg: ASbGncvYqF666Uel2tL/rVowi1yTN/FSCPCTO1RgO1WdXZv10c2ueP3Wwcy6lKjgbou 0JYIYaUYg9d9wzqZcTktHtrwFevCTgxhIl5SGHIfxvn7jbly180Muc1aRwEvT41V5uUbfE3rRlT EBD1HddaprH6w/rhmk4XotakUThSbKn9nIKzvK+taMFtHW2OAZERE6+bd+vYTCENThNCzIv4Cg1 /4mcntBejYFX8+oNlq1W3rps2/Af3xrG16DdEw2+lA1Po2yJy36828YDzmKQba/9HYSHFZoBDzU r/cb+3mvCQa1RTaVimiYzkgD9T+yVoH4InBrqNlCTtFUhiLzHbLKeq6yNKWlCbNktr7m2yQffBS PYgSdyQxIHaXuxYdvoQ+apAf8eryXyA93dFtHRWvAWlgtq1vsb70Mp70/QuD8Si/2 X-Google-Smtp-Source: AGHT+IG7/egpgEfm6ICsM/9Q5G/MIXtrpNJDO6v7CeyBPYh3hDmkmS+wFzWo6BAMtZpH2y2sFCiFPg== X-Received: by 2002:a17:907:178c:b0:ac2:b813:ac25 with SMTP id a640c23a62f3a-ac3123415b4mr880350066b.14.1741977161610; Fri, 14 Mar 2025 11:32:41 -0700 (PDT) From: Bernhard Beschow To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Peter Maydell , Thomas Huth , qemu-arm@nongnu.org, Bernhard Beschow Subject: [PATCH v2 1/2] hw/arm/fsl-imx8mp: Derive struct FslImx8mpState from TYPE_SYS_BUS_DEVICE Date: Fri, 14 Mar 2025 19:32:23 +0100 Message-ID: <20250314183224.21822-2-shentey@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250314183224.21822-1-shentey@gmail.com> References: <20250314183224.21822-1-shentey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=shentey@gmail.com; helo=mail-ed1-x533.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, FREEMAIL_FROM=0.001, 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1741977250476019100 Deriving from TYPE_SYS_BUS_DEVICE fixes the SoC object to be reset upon mac= hine reset. It also makes the SoC implementation not user-creatable which can tr= igger the following crash: $ ./qemu-system-aarch64 -M virt -device fsl-imx8mp ** ERROR:../../devel/qemu/tcg/tcg.c:1006:tcg_register_thread: assertion fail= ed: (n < tcg_max_ctxs) Bail out! ERROR:../../devel/qemu/tcg/tcg.c:1006:tcg_register_thread: assertion failed: (n < tcg_max_ctxs) Aborted (core dumped) Fixes: a4eefc69b237 "hw/arm: Add i.MX 8M Plus EVK board" Reported-by: Thomas Huth Suggested-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Bernhard Beschow Reviewed-by: Peter Maydell --- include/hw/arm/fsl-imx8mp.h | 3 ++- hw/arm/fsl-imx8mp.c | 2 +- hw/arm/imx8mp-evk.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/hw/arm/fsl-imx8mp.h b/include/hw/arm/fsl-imx8mp.h index bc97fc416e..22fdc0d67c 100644 --- a/include/hw/arm/fsl-imx8mp.h +++ b/include/hw/arm/fsl-imx8mp.h @@ -26,6 +26,7 @@ #include "hw/timer/imx_gpt.h" #include "hw/usb/hcd-dwc3.h" #include "hw/watchdog/wdt_imx2.h" +#include "hw/sysbus.h" #include "qom/object.h" #include "qemu/units.h" =20 @@ -49,7 +50,7 @@ enum FslImx8mpConfiguration { }; =20 struct FslImx8mpState { - DeviceState parent_obj; + SysBusDevice parent_obj; =20 ARMCPU cpu[FSL_IMX8MP_NUM_CPUS]; GICv3State gic; diff --git a/hw/arm/fsl-imx8mp.c b/hw/arm/fsl-imx8mp.c index c3f6da6322..82edf61082 100644 --- a/hw/arm/fsl-imx8mp.c +++ b/hw/arm/fsl-imx8mp.c @@ -702,7 +702,7 @@ static void fsl_imx8mp_class_init(ObjectClass *oc, void= *data) static const TypeInfo fsl_imx8mp_types[] =3D { { .name =3D TYPE_FSL_IMX8MP, - .parent =3D TYPE_DEVICE, + .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(FslImx8mpState), .instance_init =3D fsl_imx8mp_init, .class_init =3D fsl_imx8mp_class_init, diff --git a/hw/arm/imx8mp-evk.c b/hw/arm/imx8mp-evk.c index e1a7892fd7..f17d5db466 100644 --- a/hw/arm/imx8mp-evk.c +++ b/hw/arm/imx8mp-evk.c @@ -37,7 +37,7 @@ static void imx8mp_evk_init(MachineState *machine) s =3D FSL_IMX8MP(object_new(TYPE_FSL_IMX8MP)); object_property_add_child(OBJECT(machine), "soc", OBJECT(s)); object_property_set_uint(OBJECT(s), "fec1-phy-num", 1, &error_fatal); - qdev_realize(DEVICE(s), NULL, &error_fatal); + sysbus_realize_and_unref(SYS_BUS_DEVICE(s), &error_fatal); =20 memory_region_add_subregion(get_system_memory(), FSL_IMX8MP_RAM_START, machine->ram); --=20 2.48.1