From: Markus Armbruster <armbru@redhat.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org, "Zhao Liu" <zhao1.liu@intel.com>,
"Peter Xu" <peterx@redhat.com>
Subject: Re: [PULL 04/49] hw: Add QOM parentship relation with CPUs
Date: Tue, 14 Jan 2025 13:38:59 +0100 [thread overview]
Message-ID: <87zfjtfu3g.fsf@pond.sub.org> (raw)
In-Reply-To: <20250114111829.2f577596@imammedo.users.ipa.redhat.com> (Igor Mammedov's message of "Tue, 14 Jan 2025 11:18:29 +0100")
Igor Mammedov <imammedo@redhat.com> writes:
> On Mon, 13 Jan 2025 17:00:55 +0100
> Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
>> 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/
>
>
> QOM paths as far as I'm aware were never part ABI nor I'm aware of
> of any proposal to make it or some parts of it a public interface.
We've been waffling on this since forever. QOM is not a public
interface except when it is, and it is when somebody says so, and it
isn't when somebody says so, resulting in a wave function that wobbles
like an underdone souffle, but never quite collapses.
> IMHO for public ABI, QEMU provides explicit QMP commands while
> QOM should stay a playground for developers.
Plenty of commands take QOM paths as arguments: eject,
blockdev-open-tray, blockdev-close-tray, blockdev-remove-medium,
blockdev-insert-medium, blockdev-change-medium,
block-latency-histogram-set, cxl-inject-general-media-event,
cxl-inject-dram-event, cxl-inject-memory-module-event,
cxl-inject-poison, cxl-inject-uncorrectable-errors,
cxl-inject-correctable-error, device_del, device-sync-config,
query-stats, x-query-virtio-status, x-query-virtio-queue-status,
x-query-virtio-vhost-queue-status, x-query-virtio-queue-element, and
possibly more.
The only way their QOM path arguments can be used without relying on QOM
paths being ABI would be obtaining the argument value with a command or
from an event. I doubt that would be possible even if we tried it,
which we haven't.
> I this specific case, one basically replaces /machine/unattached
> orphanage with explicit /machine one and many 'cpuN' children,
> which ain't any better than device[N].
>
> and in future I can imagine that at least in x86 case vcpus
> might have another parent depending on configuration.
> (i.e. being parented to cores instead)
>
> If goal is to get rid of /machine/unattached, that's fine.
/machine/unattached was a lazy mistake.
> But please not make brittle naming under /machine/unattached
> as a reason as 'cpu[N]' is the same just in different place
> and scattered all over code (hence doubts if it's any better than current way).
Can you suggest a better, workable naming scheme?
> (ps: don't we have exactly the same for peripheral-anon container)
Yes, but users can avoid that by passing an @id argument.
[...]
next prev parent reply other threads:[~2025-01-14 12:39 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é
2025-01-14 10:18 ` Igor Mammedov
2025-01-14 12:38 ` Markus Armbruster [this message]
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=87zfjtfu3g.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=imammedo@redhat.com \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.