From: Alejandro Vallejo <agarciav@amd.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Roger Pau Monné" <roger.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Jason Andryuk" <jandryuk@gmail.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>,
"Michal Orzel" <michal.orzel@amd.com>,
xen-devel@lists.xenproject.org,
"Daniel Smith" <dpsmith@apertussolutions.com>
Subject: Re: [PATCH v5 03/10] x86: Replace arch-specific boot_domain with the common one
Date: Wed, 2 Jul 2025 17:34:24 +0200 [thread overview]
Message-ID: <DB1OGNLX29US.Z8UCST2IR3VI@amd.com> (raw)
In-Reply-To: <2a7dab07-9e52-4d4a-a80d-99229c9fe093@suse.com>
On Wed Jul 2, 2025 at 5:15 PM CEST, Jan Beulich wrote:
> On 02.07.2025 17:09, Alejandro Vallejo wrote:
>> On Wed Jul 2, 2025 at 3:15 PM CEST, Jan Beulich wrote:
>>> On 01.07.2025 12:56, Alejandro Vallejo wrote:
>>>> --- a/xen/arch/x86/include/asm/bootfdt.h
>>>> +++ b/xen/arch/x86/include/asm/bootfdt.h
>>>> @@ -3,6 +3,12 @@
>>>> #define X86_BOOTFDT_H
>>>>
>>>> #include <xen/types.h>
>>>> +#include <public/xen.h>
>>>> +
>>>> +struct arch_boot_domain
>>>> +{
>>>> + domid_t domid;
>>>> +};
>>>>
>>>> struct arch_boot_module
>>>> {
>>>> [...]
>>>> @@ -1048,11 +1050,11 @@ static struct domain *__init create_dom0(struct boot_info *bi)
>>>> dom0_cfg.flags |= XEN_DOMCTL_CDF_iommu;
>>>>
>>>> /* Create initial domain. Not d0 for pvshim. */
>>>> - bd->domid = get_initial_domain_id();
>>>> - d = domain_create(bd->domid, &dom0_cfg,
>>>> + bd->arch.domid = get_initial_domain_id();
>>>> + d = domain_create(bd->arch.domid, &dom0_cfg,
>>>> pv_shim ? 0 : CDF_privileged | CDF_hardware);
>>>> if ( IS_ERR(d) )
>>>> - panic("Error creating d%u: %ld\n", bd->domid, PTR_ERR(d));
>>>> + panic("Error creating d%u: %ld\n", bd->arch.domid, PTR_ERR(d));
>>>
>>> This being the only place where the (now) arch-specific field is used, why
>>> does it exist? A local variable would do? And if it's needed for
>>> (supposedly arch-agnostic) hyperlaunch, then it probably shouldn't be
>>> arch-specific? Daniel, Jason?
>>
>> As for the arch-agnostic side of things, arm needs some extra work to be
>> able to do it safely. dom0less currently constructs domains immediately after
>> parsing them, which is problematic for cases where some domains have the prop
>> and others don't. The domid allocation strategy may preclude further otherwise
>> good domains from being created just because their domid was stolen by a domain
>> that didn't actually care about which domid it got.
>>
>> It'll eventually want to leave the arch-specific area, but I don't want to do
>> that work now.
>
> But if the domU field is fine to live in a common struct despite being unused
> on x86, why can't the domid field live in a common struct too, despite being
> unused on non-x86? Otherwise it'll be extra churn for no gain to later move it
> there.
>
> Jan
Mostly out of tidiness. Otherwise it's hard to know which fields serve a purpose
where.
I genuinely forgot about the domU field. I'm more than happy to drop that arch
subfield and have domid in the main body of the struct, but I suspect MISRA
would have something to say about dead data?
Cheers,
Alejandro
next prev parent reply other threads:[~2025-07-02 15:35 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-01 10:56 [PATCH v5 00/10] Allow x86 to unflatten DTs Alejandro Vallejo
2025-07-01 10:56 ` [PATCH v5 01/10] x86: Replace arch-specific boot_module with common one Alejandro Vallejo
2025-07-02 12:43 ` Jan Beulich
2025-07-02 15:02 ` Alejandro Vallejo
2025-07-01 10:56 ` [PATCH v5 02/10] xen: Refactor kernel_info to have a header like boot_domain Alejandro Vallejo
2025-07-02 12:56 ` Jan Beulich
2025-07-02 16:04 ` Alejandro Vallejo
2025-07-03 6:01 ` Jan Beulich
2025-07-03 9:57 ` Alejandro Vallejo
2025-07-01 10:56 ` [PATCH v5 03/10] x86: Replace arch-specific boot_domain with the common one Alejandro Vallejo
2025-07-02 13:15 ` Jan Beulich
2025-07-02 15:04 ` Alejandro Vallejo
2025-07-02 15:09 ` Alejandro Vallejo
2025-07-02 15:15 ` Jan Beulich
2025-07-02 15:34 ` Alejandro Vallejo [this message]
2025-07-03 6:04 ` Jan Beulich
2025-07-07 14:49 ` Alejandro Vallejo
2025-07-01 10:56 ` [PATCH v5 04/10] xen/dt: Move bootfdt functions to xen/bootfdt.h Alejandro Vallejo
2025-07-01 10:56 ` [PATCH v5 05/10] xen/dt: Move bootinfo functions to a new bootinfo.h Alejandro Vallejo
2025-07-01 10:57 ` [PATCH v5 06/10] xen/dt: Rename bootfdt.c -> bootinfo-fdt.c Alejandro Vallejo
2025-07-01 10:57 ` [PATCH v5 07/10] xen/dt: Extract helper to map nodes to module kinds Alejandro Vallejo
2025-07-01 10:57 ` [PATCH v5 08/10] xen: Split HAS_DEVICE_TREE in two Alejandro Vallejo
2025-07-02 13:30 ` Jan Beulich
2025-07-02 15:28 ` Alejandro Vallejo
2025-07-03 5:55 ` Jan Beulich
2025-07-03 10:04 ` Alejandro Vallejo
2025-07-01 10:57 ` [PATCH v5 09/10] xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h} Alejandro Vallejo
2025-07-01 10:57 ` [PATCH v5 10/10] xen/dt: Allow CONFIG_DEVICE_TREE_PARSE to include device-tree/ Alejandro Vallejo
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=DB1OGNLX29US.Z8UCST2IR3VI@amd.com \
--to=agarciav@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=bertrand.marquis@arm.com \
--cc=dpsmith@apertussolutions.com \
--cc=jandryuk@gmail.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 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.