All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
	qemu-devel@nongnu.org, ale@rev.ng,
	"Andrey Smirnov" <andrew.smirnov@gmail.com>,
	"Thomas Huth" <thuth@redhat.com>,
	qemu-arm@nongnu.org, "Niek Linnenbank" <nieklinnenbank@gmail.com>,
	"Jean-Christophe Dubois" <jcd@tribudubois.net>,
	"Antonio Caggiano" <antonio.caggiano@collabora.com>,
	"Rob Herring" <robh@kernel.org>,
	"Antony Pavlov" <antonynpavlov@gmail.com>,
	"Jan Kiszka" <jan.kiszka@web.de>,
	"Beniamino Galvani" <b.galvani@gmail.com>
Subject: Re: [PATCH 12/18] hw/arm/digic: Replace object_initialize(ARMCPU) by object_new(ARMCPU)
Date: Wed, 25 Jan 2023 11:58:23 +0000	[thread overview]
Message-ID: <87sffyreuv.fsf@linaro.org> (raw)
In-Reply-To: <CAFEAcA-yEN3F3p6W16vfML4dAHzdwSnOS=759MkqQ0qDpArnaw@mail.gmail.com>


Peter Maydell <peter.maydell@linaro.org> writes:

> On Tue, 10 Jan 2023 at 16:45, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>>
>> Replace the ARMCPU field in DigicState by a reference to
>> an allocated ARMCPU. Instead of initializing the field
>> with object_initialize(), allocate it with object_new().
>>
>> As we don't access ARMCPU internal fields or size, we can
>> move digic.c from arm_ss[] to the more generic softmmu_ss[].
>
> I'm not really a fan of this, because it moves away
> from a standard coding pattern we've been using for
> new QOM 'container' devices, where all the sub-components
> of the device are structs embedded in the device's own
> struct. This is as opposed to the old style which tended
> to use "allocate memory for the sub-component and have
> pointers to it". It means the CPU object is now being
> treated differently from all the timers, UARTs, etc.

I think you can certainly make the argument that CPU's have always been
treated separately because we pass it around as an anonymous pointer all
the time. We currently can't support two concrete CPU types in the same
structure. For example zyncmp has:

  struct XlnxZynqMPState {
      /*< private >*/
      DeviceState parent_obj;

      /*< public >*/
      CPUClusterState apu_cluster;
      CPUClusterState rpu_cluster;
      ARMCPU apu_cpu[XLNX_ZYNQMP_NUM_APU_CPUS];
      ARMCPU rpu_cpu[XLNX_ZYNQMP_NUM_RPU_CPUS];

which only works because A/R cpus are the same underlying type. However
when we want to add Microblaze how would we do it?

Is the main problem preventing us from including multiple cpu.h
definitions that we overload CPUArch and CPUArchState? What are the
implications if we convert them to fully anonymous pointer types?

>
> thanks
> -- PMM


-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro

  parent reply	other threads:[~2023-01-25 12:14 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 16:43 [PATCH 00/18] hw/arm: Move various objects to softmmu_ss to build them once (part 1) Philippe Mathieu-Daudé
2023-01-10 16:43 ` [PATCH 01/18] hw/arm: Move various units to softmmu_ss[] Philippe Mathieu-Daudé
2023-01-11 19:53   ` Richard Henderson
2023-01-10 16:43 ` [PATCH 02/18] hw/arm/boot: Include missing 'exec/cpu-all.h' header Philippe Mathieu-Daudé
2023-01-11 19:55   ` Richard Henderson
2023-01-10 16:43 ` [PATCH 03/18] target/arm/cpregs: Include missing 'target/arm/cpu.h' header Philippe Mathieu-Daudé
2023-01-11 19:56   ` Richard Henderson
2023-01-10 16:43 ` [PATCH 04/18] hw/arm: Use full "target/arm/cpu.h" path to include target's "cpu.h" Philippe Mathieu-Daudé
2023-01-11 19:58   ` Richard Henderson
2023-01-10 16:43 ` [PATCH 05/18] target/arm: Move CPU QOM type definitions to "hw/arm/cpu.h" Philippe Mathieu-Daudé
2023-01-11 20:02   ` Richard Henderson
2023-01-12  7:17     ` Philippe Mathieu-Daudé
2025-04-02  4:06       ` Philippe Mathieu-Daudé
2025-04-02  4:59         ` Philippe Mathieu-Daudé
2025-04-02 15:29         ` Pierrick Bouvier
2023-01-10 16:43 ` [PATCH 06/18] target/arm: Move CPU definitions consumed by HW model " Philippe Mathieu-Daudé
2025-04-02  4:08   ` Philippe Mathieu-Daudé
2023-01-10 16:43 ` [PATCH 07/18] hw/arm: Move more units to softmmu_ss[] Philippe Mathieu-Daudé
2023-01-10 16:43 ` [PATCH 08/18] hw/arm: Move units to softmmu[] by replacing "{target -> hw}/arm/cpu.h" Philippe Mathieu-Daudé
2023-01-10 16:43 ` [PATCH 09/18] hw/arm/armv7m: Remove 'target/arm/cpu.h' from NVIC header Philippe Mathieu-Daudé
2023-01-10 16:43 ` [PATCH 10/18] hw/arm: Move various armv7m-related units to softmmu_ss[] Philippe Mathieu-Daudé
2023-01-10 16:43 ` [PATCH 11/18] hw/arm/digic: Remove unnecessary target_long use Philippe Mathieu-Daudé
2023-01-11 20:04   ` Richard Henderson
2023-01-10 16:44 ` [PATCH 12/18] hw/arm/digic: Replace object_initialize(ARMCPU) by object_new(ARMCPU) Philippe Mathieu-Daudé
2023-01-10 16:52   ` Peter Maydell
2023-01-11  9:01     ` Philippe Mathieu-Daudé
2023-01-25 11:58     ` Alex Bennée [this message]
2023-01-26 12:43       ` Peter Maydell
2023-01-10 16:44 ` [PATCH 13/18] hw/arm/fsl-imx: Correct GPIO/GPT index in QOM tree Philippe Mathieu-Daudé
2025-04-02  4:12   ` Philippe Mathieu-Daudé
2023-01-10 16:44 ` [PATCH 14/18] hw/arm/fsl-imx25: Replace object_initialize(ARMCPU) by object_new() Philippe Mathieu-Daudé
2023-01-10 16:44 ` [PATCH 15/18] hw/arm/fsl-imx31: " Philippe Mathieu-Daudé
2023-01-10 16:44 ` [PATCH 16/18] hw/arm/fsl-imx7: " Philippe Mathieu-Daudé
2023-01-10 16:44 ` [PATCH 17/18] hw/arm/fsl-imx6: " Philippe Mathieu-Daudé
2023-01-10 16:44 ` [PATCH 18/18] hw/arm/allwinner: " 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=87sffyreuv.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=ale@rev.ng \
    --cc=andrew.smirnov@gmail.com \
    --cc=antonio.caggiano@collabora.com \
    --cc=antonynpavlov@gmail.com \
    --cc=b.galvani@gmail.com \
    --cc=jan.kiszka@web.de \
    --cc=jcd@tribudubois.net \
    --cc=nieklinnenbank@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=robh@kernel.org \
    --cc=thuth@redhat.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.