From: Pierrick Bouvier <pierrick.bouvier@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <richard.henderson@linaro.org>
Subject: Re: [PATCH 0/3] single-binary: compile hw/intc/arm* files once
Date: Mon, 28 Jul 2025 15:04:00 -0700 [thread overview]
Message-ID: <09d56dc3-76f6-4186-822e-fcb338e2cddd@linaro.org> (raw)
In-Reply-To: <62c947c3-0e16-4484-83cc-3aff3a694041@linaro.org>
On 7/28/25 2:57 PM, Philippe Mathieu-Daudé wrote:
> On 28/7/25 21:34, Pierrick Bouvier wrote:
>> On 7/28/25 2:39 AM, Philippe Mathieu-Daudé wrote:
>>> On 25/7/25 22:19, Pierrick Bouvier wrote:
>>>> Move those files to hw/arm, as they depend on arm target code.
>>>>
>>>> Pierrick Bouvier (3):
>>>> hw/arm/arm_gicv3_cpuif_common: move to hw/arm and compile only once
>>>> hw/arm/arm_gicv3_cpuif: move to hw/arm and compile only once
>>>> hw/arm/armv7m_nvic: move to hw/arm and compile only once
>>>>
>>>> hw/{intc => arm}/arm_gicv3_cpuif.c | 2 +-
>>>> hw/{intc => arm}/arm_gicv3_cpuif_common.c | 2 +-
>>>> hw/{intc => arm}/armv7m_nvic.c | 0
>>>
>>> Alternatively add arm_common_ss in hw/intc/meson.build?
>>>
>>> arm_common_ss = ss.source_set()
>>> arm_common_ss.add(when: 'CONFIG_ARM_GIC',
>>> if_true: files('arm_gicv3_cpuif_common.c'))
>>> arm_common_ss.add(when: 'CONFIG_ARM_GICV3',
>>> if_true: files('arm_gicv3_cpuif.c'))
>>> arm_common_ss.add(when: 'CONFIG_ARM_V7M',
>>> if_true: files('armv7m_nvic.c'))
>>> hw_common_arch += {'arm': arm_common_ss}
>>>
>>
>> The problem with this approach is that we need to aggregate hw/arm and
>> hw/intc arm related source sets, and the last line in your proposed
>> change does not have this semantic.
>> Regarding meson, hw/intc subfolder is parsed *before* hw/arm (see hw/
>> meson.build), so we can't reuse the same source set, defined in hw/arm/
>> meson.build.
>>
>> This old commit (7702e47c2) was the origin of having interrupt related
>> code in a generic folder, but I don't really understand the rationale
>> behind it to be honest. It seems to be an exception regarding all the
>> rest of the codebase, thus the idea to bring back things where they belong.
>
> Yeah, you are right. What was suggested once was to move them to
> target/arm/hw/, being architecture dependent / specific.
>
> $ ls -l hw/arm | wc -l
> 97
>
> hw/arm/ contains board / soc / arm-specific hw and helpers (such
> code loaders). Nothing wrong, I'm just wondering there is room for
> improvements.
>
Sure, that makes sense.
GIC is a bit in the middle, as it's definitely an arm specific
controller, and not a classical device. SMMU is directly in hw/arm for
instance.
I'm really open to any structure Arm related developers would think is
the best. It's just that moving a lot of files is always a pain for
everyone, as it creates a lot of conflicts for people working on them
currently, so I tried to minimize it here to target the strictly needed
set of files only.
As well, I would prefer having a clean build system more than a clear
filesystem structure, considering it's quite easy to jump into any
definition automatically with your work editor nowadays, vs understand a
meson.build file full of tricks and implicit dependencies where no tool
can help you.
> Personally I'd rather keep hw/arm/ for boards / soc, and move
> ARM specific components (like GIC, NVIC, SMMU, timers to target/arm/hw/.
>
> Anyhow, I don't object to your approach :) For this series:
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
>>
>> I'm open to any other idea someone would have. Peter, without
>> necessarily a working solution, do you have any preference on where
>> those things should be?
>>
>>>> hw/arm/meson.build | 3 +
>>>> hw/arm/trace-events | 79 +++++++++++++++++++
>>>> ++++
>>>> hw/intc/meson.build | 3 -
>>>> hw/intc/trace-events | 79
>>>> -----------------------
>>>> 7 files changed, 84 insertions(+), 84 deletions(-)
>>>> rename hw/{intc => arm}/arm_gicv3_cpuif.c (99%)
>>>> rename hw/{intc => arm}/arm_gicv3_cpuif_common.c (92%)
>>>> rename hw/{intc => arm}/armv7m_nvic.c (100%)
>>>>
>>>
>>
>
next prev parent reply other threads:[~2025-07-28 22:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-25 20:19 [PATCH 0/3] single-binary: compile hw/intc/arm* files once Pierrick Bouvier
2025-07-25 20:19 ` [PATCH 1/3] hw/arm/arm_gicv3_cpuif_common: move to hw/arm and compile only once Pierrick Bouvier
2025-07-25 20:19 ` [PATCH 2/3] hw/arm/arm_gicv3_cpuif: " Pierrick Bouvier
2025-07-25 20:19 ` [PATCH 3/3] hw/arm/armv7m_nvic: " Pierrick Bouvier
2025-07-28 9:39 ` [PATCH 0/3] single-binary: compile hw/intc/arm* files once Philippe Mathieu-Daudé
2025-07-28 19:34 ` Pierrick Bouvier
2025-07-28 21:57 ` Philippe Mathieu-Daudé
2025-07-28 22:04 ` Pierrick Bouvier [this message]
2025-07-31 16:23 ` Peter Maydell
2025-07-31 18:30 ` Pierrick Bouvier
2025-07-31 21:27 ` Philippe Mathieu-Daudé
2025-07-31 22:24 ` Pierrick Bouvier
2025-08-01 8:34 ` Peter Maydell
2025-08-01 16:31 ` Pierrick Bouvier
2025-08-01 16:38 ` Peter Maydell
2025-08-01 16:59 ` Pierrick Bouvier
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=09d56dc3-76f6-4186-822e-fcb338e2cddd@linaro.org \
--to=pierrick.bouvier@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/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).