From patchwork Fri Feb 16 11:03:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 773321 Delivered-To: patch@linaro.org Received: by 2002:adf:9dc2:0:b0:33b:4db1:f5b3 with SMTP id q2csp1287512wre; Fri, 16 Feb 2024 03:09:22 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX5wjb6YnXR4rDXyiDR5g7IP491gIWuAanniPuQP+8tKVHxXM2Xavbyo1zr/qklSfJIiBTvd4dYkLz3a7SZwq2T X-Google-Smtp-Source: AGHT+IEN/un1PL572RqC8GOiIUMEWc8CWjPT7d9QmPR5NOjG+vA3IjiF7lb6xBOqu0qtIpGH0Rqo X-Received: by 2002:a05:622a:1b8d:b0:42c:70a8:1b40 with SMTP id bp13-20020a05622a1b8d00b0042c70a81b40mr5267558qtb.17.1708081762515; Fri, 16 Feb 2024 03:09:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1708081762; cv=none; d=google.com; s=arc-20160816; b=ZCq0dilsNBXgfstyhDugdBUdn5FzVVm27NJpNF8nHpzJ0+eD1ZGQybgy3Yo+ALO3Cj QbyXbugct1FPYY3fspZGTMdoYcloMJ+InA2cGTI0uv43GUPTbkg/ucjwD9/E41HRQymE ihs5pq/9ZlsjipdAlgWIVMzAlKSkhu2uUXk73ZDNYZ5WArX7iMS/kE7lQpxDzpxbt259 oe8m/Tp3fUNs+7I3ZjoGxJphS49/5jfALrwTrpx5+rKZNjvGhowWhv3ibnMx5Mrgr8+1 /CGlP27TBya3et9A/QZlb2YmQfbcN5+mcHSWV41ReDrArKghIjt8O4VzK0VGn3fyODmq L8CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F6ajeUmTQmKHExarjmIHQmgeLAwEfZL4L6fDKfFyi0M=; fh=ZKKgbbU8WVqPGHC0Cm5TsGKB0jx8PKipJZhIfpuaAW4=; b=XWpoms9nMmvexinH1sScFtU6erDacLQYf+1dItshOfK/tEBDc106ZOUUC3j+SRJ4cK RB59d0ozvExoyCUhpDdq3ZfVjVj+Nsk9YrkkJ4l1lz/bVXfDoqoH3MbU4Cb8d8M7yiir UrrFAVa3n/bqNzFIReIKzRIHxlK76TdS6XyCyeIbyZIUmX9DQrhl7wzg+wCUOPLh0eki g7XiIbiyu6G7VAQ/pa/oQZLYc8CPNpgxDvW6mwSmwHASbssEH4TxCBOPo0TFc7pSMfqX L+70DYfERAdsNb2WaGaIvRdRgkJKf7QMWVLyVFkk0hAYpNuKnssfE7aLIpZvxqku/AXI FkOA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dWLtbfh1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id g10-20020ac870ca000000b0042c384540d3si3391595qtp.595.2024.02.16.03.09.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Feb 2024 03:09:22 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dWLtbfh1; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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_Le_G?= =?utf-8?q?oater?= , 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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org QDev objects created with object_new() need to manually add their parent relationship with object_property_add_child(). Signed-off-by: Philippe Mathieu-Daudé 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_id, 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); 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) /* init CPUs */ cpu = 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/petalogix_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 = get_system_memory(); cpu = 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); 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 **errp) /* All cores use the same clock tree */ qdev_connect_clock_in(DEVICE(cpu), "clk-in", s->clock); + 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 = 0xc8000120; cpu->fast_tlb_miss_addr = 0xc0000100; + object_property_add_child(OBJECT(machine), "cpu", OBJECT(cpu)); qdev_realize_and_unref(DEVICE(cpu), NULL, &error_fatal); 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 != 0, &error_abort); + object_property_add_child(OBJECT(machine), "cpu[*]", OBJECT(cpu)); qdev_realize_and_unref(DEVICE(cs), NULL, &error_fatal); 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); object_unref(core);