From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Igor Mammedov <imammedo@redhat.com>
Cc: qemu-devel@nongnu.org, Zhao Liu <zhao1.liu@intel.com>,
Markus Armbruster <armbru@redhat.com>,
Peter Xu <peterx@redhat.com>
Subject: Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs
Date: Mon, 13 Jan 2025 17:00:55 +0100 [thread overview]
Message-ID: <6f9225ad-edc6-4fe0-b0e6-8a93e7f50102@linaro.org> (raw)
In-Reply-To: <20250113132832.049f651a@imammedo.users.ipa.redhat.com>
On 13/1/25 13:28, Igor Mammedov wrote:
> On Sun, 12 Jan 2025 23:16:40 +0100
> Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
>> QDev objects created with object_new() need to manually add
>> their parent relationship with object_property_add_child().
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
>> Message-Id: <20240216110313.17039-22-philmd@linaro.org>
>> ---
>> hw/i386/x86-common.c | 1 +
>> hw/microblaze/petalogix_ml605_mmu.c | 1 +
>> hw/microblaze/petalogix_s3adsp1800_mmu.c | 1 +
>> hw/mips/cps.c | 1 +
>> hw/ppc/e500.c | 1 +
>> hw/ppc/spapr.c | 1 +
>> 6 files changed, 6 insertions(+)
>>
>> diff --git a/hw/i386/x86-common.c b/hw/i386/x86-common.c
>> index 97b4f7d4a0d..9c9ffb3484a 100644
>> --- a/hw/i386/x86-common.c
>> +++ b/hw/i386/x86-common.c
>> @@ -60,6 +60,7 @@ static 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));
>
> I might be missing something but why it needs to be done manually?
>
> device_set_realized() will place any parent-less device under (1) /machine/unattached
This is exactly what we want to avoid, to eventually remove
the "/machine/unattached" container for good.
See "= Problem 4: The /machine/unattached/ orphanage =" in:
https://lore.kernel.org/qemu-devel/87o7d1i7ky.fsf@pond.sub.org/
> while devices created with device_add() are be placed under /machine/peripheral[-anon]
>
> The commit message unfortunately doesn't explain why [1] shall be replaced
> by direct cpu[*] array property directly under machine.
Right. I'll drop for now and respin once reworded.
> Granted, those paths aren't any kind of ABI and wrt x86 cpus
> nothing should break (or I'd say it shouldn't break our promises)
> But I'd rather not do this without a good reason/explanation.
>
>> qdev_realize(DEVICE(cpu), NULL, errp);
>>
>> out:
next prev parent reply other threads:[~2025-01-13 16:01 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-12 22:16 [PULL 00/49] Misc HW patches for 2025-01-12 Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 01/49] pc-bios/meson.build: Silent unuseful DTC warnings Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 02/49] target: Replace DEVICE(object_new) -> qdev_new() Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 03/49] hw: " Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 04/49] hw: Add QOM parentship relation with CPUs Philippe Mathieu-Daudé
2025-01-13 12:28 ` Igor Mammedov
2025-01-13 16:00 ` Philippe Mathieu-Daudé [this message]
2025-01-14 10:18 ` Igor Mammedov
2025-01-14 12:38 ` Markus Armbruster
2025-01-15 10:19 ` Igor Mammedov
2025-01-15 17:44 ` Peter Xu
2025-02-25 11:50 ` Igor Mammedov
2025-01-14 14:38 ` Zhao Liu
2025-01-15 13:13 ` Igor Mammedov
2025-01-15 14:07 ` Zhao Liu
2025-01-12 22:16 ` [PULL 05/49] hw/usb: Inline usb_try_new() Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 06/49] hw/usb: Inline usb_new() Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 07/49] hw/microblaze: Restrict MemoryRegionOps are implemented as 32-bit Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 08/49] hw/net/xilinx_ethlite: Map MDIO registers (as unimplemented) Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 09/49] hw/net/xilinx_ethlite: Introduce txbuf_ptr() helper Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 10/49] hw/net/xilinx_ethlite: Introduce rxbuf_ptr() helper Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 11/49] hw/net/xilinx_ethlite: Access TX_GIE register for each port Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 12/49] hw/net/xilinx_ethlite: Access TX_LEN " Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 13/49] hw/net/xilinx_ethlite: Access TX_CTRL " Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 14/49] hw/net/xilinx_ethlite: Map RX_CTRL as MMIO Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 15/49] hw/net/xilinx_ethlite: Map TX_LEN " Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 16/49] hw/net/xilinx_ethlite: Map TX_GIE " Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 17/49] hw/net/xilinx_ethlite: Map TX_CTRL " Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 18/49] hw/net/xilinx_ethlite: Map the RAM buffer as RAM memory region Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 19/49] hw/net/xilinx_ethlite: Rename 'mmio' MR as 'container' Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 20/49] hw/net/xilinx_ethlite: Map RESERVED I/O as unimplemented Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 21/49] docs/nitro-enclave: Clarify Enclave and Firecracker relationship Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 22/49] hw/misc/vmcoreinfo: Rename VMCOREINFO_DEVICE -> TYPE_VMCOREINFO Philippe Mathieu-Daudé
2025-01-12 22:16 ` [PULL 23/49] hw/misc/vmcoreinfo: Convert to three-phase reset interface Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 24/49] hw/pci: Rename has_power to enabled Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 25/49] hw/ufs: Adjust value to match CPU's endian format Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 26/49] hw/sd/sdhci: Set SDHC_NIS_DMA bit when appropriate Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 27/49] hw/sd/sdhci: Factor sdhci_sdma_transfer() out Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 28/49] hw/char/stm32f2xx_usart: replace print with trace Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 29/49] hw/timer/imx_gpt: Remove unused define Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 30/49] tests/qtest/libqos: Reuse TYPE_IMX_I2C define Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 31/49] hw/misc/imx6_src: Convert DPRINTF() to trace events Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 32/49] hw/char/imx_serial: Turn some DPRINTF() statements into " Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 33/49] hw/i2c/imx_i2c: Convert DPRINTF() to " Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 34/49] hw/gpio/imx_gpio: Turn DPRINTF() into " Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 35/49] tests/qtest/boot-serial-test: Correct HPPA machine name Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 36/49] tests: Add functional tests for HPPA machines Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 37/49] target/hppa: Convert hppa_cpu_init() to ResetHold handler Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 38/49] hw/hppa: Reset vCPUs calling resettable_reset() Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 39/49] target/hppa: Only set PSW 'M' bit on reset Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 40/49] target/hppa: Set PC on vCPU reset Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 41/49] target/hppa: Speed up hppa_is_pa20() Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 42/49] hw/loongarch/virt: Checkpatch cleanup Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 43/49] backends/cryptodev-vhost-user: Fix local_error leaks Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 44/49] hw/usb/hcd-xhci-pci: Use event ring 0 if mapping unsupported Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 45/49] hw/tricore/triboard: Remove unnecessary use of &first_cpu Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 46/49] MAINTAINERS: remove myself from sbsa-ref Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 47/49] MAINTAINERS: Add me as the maintainer for ivshmem-flat Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 48/49] MAINTAINERS: Update path to coreaudio.m Philippe Mathieu-Daudé
2025-01-12 22:17 ` [PULL 49/49] Add a b4 configuration file Philippe Mathieu-Daudé
2025-01-13 15:40 ` [PULL 00/49] Misc HW patches for 2025-01-12 Philippe Mathieu-Daudé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6f9225ad-edc6-4fe0-b0e6-8a93e7f50102@linaro.org \
--to=philmd@linaro.org \
--cc=armbru@redhat.com \
--cc=imammedo@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).