From nobody Fri Nov 1 07:34:44 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1708081762; cv=none; d=zohomail.com; s=zohoarc; b=Y9Otws0dJClwcgNm/b9gRC792TaM6jIMVrbUKUFdwn+9GD9BNM/cjlFJIRNgn17B4O9wnskYt94xFwza0+mDDK5QF5pDpSbuZwVyUmugJ+KPUg7GNJnLBMlvZWvKvEX8aQDhJtrtvF6XpF0eQyBnkfhQs/cmXd5JoNH6Evpdm+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1708081762; 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=F6ajeUmTQmKHExarjmIHQmgeLAwEfZL4L6fDKfFyi0M=; b=WGPxSQBg8Fch5s2kG7fr5F5f1t1TVTDzhz2EAKDGPHJv/7nzwz6KOCYvbW4zTnFc01aOjL0ski/CJWxBccd70vSGjCZnDrBvTSRrKQqbriiNcKCI3foAyxT3WgcXOckm4NDMj960VRdHktYRpAeHjsJI8oW2g/ppxx0CKcYubVQ= 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 1708081762843620.4398193075892; Fri, 16 Feb 2024 03:09:22 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1raw2M-0003Mr-SU; Fri, 16 Feb 2024 06:05:46 -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 1raw2H-0002kS-D4 for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:41 -0500 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1raw2E-0001W3-4p for qemu-devel@nongnu.org; Fri, 16 Feb 2024 06:05:41 -0500 Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-41211097adcso13376235e9.3 for ; Fri, 16 Feb 2024 03:05:37 -0800 (PST) Received: from m1x-phil.lan ([176.187.210.246]) by smtp.gmail.com with ESMTPSA id 13-20020a05600c020d00b00410dd253008sm1927267wmi.42.2024.02.16.03.05.33 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 16 Feb 2024 03:05:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1708081536; x=1708686336; 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=F6ajeUmTQmKHExarjmIHQmgeLAwEfZL4L6fDKfFyi0M=; b=dWLtbfh1Gmr6bwIP2lCRTT6tGAslqKGAd5oAfkaSRPDMUCRyTqrHaOGoSpQq9ioStb Zo9NDQ0ilplfg58JEJ9G+W8gDEftqg10W9VITYfrbK25DD40K2bPSp3PxxMd9p2DOKTi 5zzyWXTpXBDo1MpFRnNRLiAI6AsdvhnaB0qVUMV72LrQ28NhRKR5SUgjSeGkLxxapIxr YxbG+y8RZW2ny7sivB4uNUYLOwlcXnr17Sc56bQYA+7CZ/XpoUaaCl6KUsGo5DqdP1cf Um63Hnh9nc7+vBnal5rnbsWfAr0KlvwWm4PMTM/9dDoQHcRTCRn0h6tl++kZ50gXV8Kw yP1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708081536; x=1708686336; 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=F6ajeUmTQmKHExarjmIHQmgeLAwEfZL4L6fDKfFyi0M=; b=LCSpljAMvxZIgpStSfmAF7n0hTY/1uCiLWxuhGt8MAirGYQwO8GlepFg6+7Pimvqep I+Zmye2yUEOpoOglANa6VV1h5pDr+8dJF6xk0fK0fnJzxSECXpRsh+QwMiuw2QL1UugL WfNdyLZDAZd7dwov/RBrSuEdJBriCa1qiUNNlnIrtxqMcILwN/qG8UyppyEcXXEeBrmx pQmBLJQCUVWMb8EfATyMUQbdpZXFqKvDpF+KJAGVc6WyYfwBimeXSmpYUUCk4WWrGuLG 1HQFn1X2F48CrnrN17aE769Fb+Zc75dIFPmzWO/CPaP46lg94skT9uvx+RvVrYqaVxHy XR8w== X-Gm-Message-State: AOJu0YyWgYVbqyUAb9Roke0s9LtEc8PYhyC1xHGxqXw/5egr7okA57KS 2K0FoKaineQv0UpSRRrmWtpMpdyjsGT9xQunNwDOr0490bOZJdGjqJk826UZ/We5uYWHifUZIdR p X-Google-Smtp-Source: AGHT+IH7KB2yafp1Cdch5vIutGT7LSLUakLOWcYOmzNAq8g5xI+ojLUoPdGge2xdRTTfyXPRuNhppQ== X-Received: by 2002:a1c:7918:0:b0:411:a802:700f with SMTP id l24-20020a1c7918000000b00411a802700fmr3604707wme.39.1708081536016; Fri, 16 Feb 2024 03:05:36 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, qemu-block@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Marcel Apfelbaum , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Edgar E. Iglesias" , Chris Wulff , Marek Vasut , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Harsh Prateek Bora Subject: [PATCH 21/21] hw: Add QOM parentship relation with CPUs Date: Fri, 16 Feb 2024 12:03:12 +0100 Message-ID: <20240216110313.17039-22-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240216110313.17039-1-philmd@linaro.org> References: <20240216110313.17039-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+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philmd@linaro.org; helo=mail-wm1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1708081763356100001 QDev objects created with object_new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Zhao Liu --- hw/i386/x86.c | 1 + hw/microblaze/petalogix_ml605_mmu.c | 1 + hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 + hw/mips/cps.c | 1 + hw/nios2/10m50_devboard.c | 1 + hw/ppc/e500.c | 1 + hw/ppc/spapr.c | 1 + 7 files changed, 7 insertions(+) diff --git a/hw/i386/x86.c b/hw/i386/x86.c index 684dce90e9..7021419d91 100644 --- a/hw/i386/x86.c +++ b/hw/i386/x86.c @@ -102,6 +102,7 @@ void x86_cpu_new(X86MachineState *x86ms, int64_t apic_i= d, Error **errp) if (!object_property_set_uint(cpu, "apic-id", apic_id, errp)) { goto out; } + object_property_add_child(OBJECT(x86ms), "cpu[*]", OBJECT(cpu)); qdev_realize(DEVICE(cpu), NULL, errp); =20 out: diff --git a/hw/microblaze/petalogix_ml605_mmu.c b/hw/microblaze/petalogix_= ml605_mmu.c index 0f5fabc32e..dfd881322d 100644 --- a/hw/microblaze/petalogix_ml605_mmu.c +++ b/hw/microblaze/petalogix_ml605_mmu.c @@ -83,6 +83,7 @@ petalogix_ml605_init(MachineState *machine) =20 /* init CPUs */ cpu =3D MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); object_property_set_str(OBJECT(cpu), "version", "8.10.a", &error_abort= ); /* Use FPU but don't use floating point conversion and square * root instructions diff --git a/hw/microblaze/petalogix_s3adsp1800_mmu.c b/hw/microblaze/petal= ogix_s3adsp1800_mmu.c index dad46bd7f9..255d8d4d47 100644 --- a/hw/microblaze/petalogix_s3adsp1800_mmu.c +++ b/hw/microblaze/petalogix_s3adsp1800_mmu.c @@ -70,6 +70,7 @@ petalogix_s3adsp1800_init(MachineState *machine) MemoryRegion *sysmem =3D get_system_memory(); =20 cpu =3D MICROBLAZE_CPU(object_new(TYPE_MICROBLAZE_CPU)); + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); object_property_set_str(OBJECT(cpu), "version", "7.10.d", &error_abort= ); qdev_realize(DEVICE(cpu), NULL, &error_abort); =20 diff --git a/hw/mips/cps.c b/hw/mips/cps.c index 07b73b0a1f..6b4e918807 100644 --- a/hw/mips/cps.c +++ b/hw/mips/cps.c @@ -84,6 +84,7 @@ static void mips_cps_realize(DeviceState *dev, Error **er= rp) /* All cores use the same clock tree */ qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock); =20 + object_property_add_child(OBJECT(dev), "cpu[*]", OBJECT(cpu)); if (!qdev_realize_and_unref(DEVICE(cpu), NULL, errp)) { return; } diff --git a/hw/nios2/10m50_devboard.c b/hw/nios2/10m50_devboard.c index 6cb32f777b..f6a691d340 100644 --- a/hw/nios2/10m50_devboard.c +++ b/hw/nios2/10m50_devboard.c @@ -95,6 +95,7 @@ static void nios2_10m50_ghrd_init(MachineState *machine) cpu->exception_addr =3D 0xc8000120; cpu->fast_tlb_miss_addr =3D 0xc0000100; =20 + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal); =20 if (nms->vic) { diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index 3bd12b54ab..77b7d2858c 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -956,6 +956,7 @@ void ppce500_init(MachineState *machine) */ object_property_set_bool(OBJECT(cs), "start-powered-off", i !=3D 0, &error_abort); + object_property_add_child(OBJECT(machine), "cpu[*]", OBJECT(cpu)); qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); =20 if (!firstenv) { diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0d72d286d8..b6e5caa0d2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -2715,6 +2715,7 @@ static void spapr_init_cpus(SpaprMachineState *spapr) &error_fatal); object_property_set_int(core, CPU_CORE_PROP_CORE_ID, core_id, &error_fatal); + object_property_add_child(OBJECT(spapr), "cpu[*]", OBJECT(core= )); qdev_realize(DEVICE(core), NULL, &error_fatal); =20 object_unref(core); --=20 2.41.0