From: dmkhn@proton.me
To: Jan Beulich <jbeulich@suse.com>
Cc: andrew.cooper3@citrix.com, anthony.perard@vates.tech,
julien@xen.org, michal.orzel@amd.com, roger.pau@citrix.com,
sstabellini@kernel.org, dmukhin@ford.com,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v10 3/3] xen/domain: use get_initial_domain_id() instead of open-coded 0
Date: Tue, 22 Jul 2025 23:24:05 +0000 [thread overview]
Message-ID: <aIAdkbaKyDPO1WWg@kraken> (raw)
In-Reply-To: <93080cb5-d00d-4c58-9efd-c377343eb165@suse.com>
On Tue, Jun 24, 2025 at 08:07:55AM +0200, Jan Beulich wrote:
> On 23.06.2025 20:28, dmkhn@proton.me wrote:
> > --- a/xen/common/domain.c
> > +++ b/xen/common/domain.c
> > @@ -492,7 +492,7 @@ static int late_hwdom_init(struct domain *d)
> > struct domain *dom0;
> > int rv;
> >
> > - if ( d != hardware_domain || d->domain_id == 0 )
> > + if ( d != hardware_domain || d->domain_id == get_initial_domain_id() )
> > return 0;
> >
> > rv = xsm_init_hardware_domain(XSM_HOOK, d);
> > @@ -501,7 +501,7 @@ static int late_hwdom_init(struct domain *d)
> >
> > printk("Initialising hardware domain %d\n", hardware_domid);
> >
> > - dom0 = rcu_lock_domain_by_id(0);
> > + dom0 = rcu_lock_domain_by_id(get_initial_domain_id());
> > ASSERT(dom0 != NULL);
>
> For both changes above you're introducing a subtle (largely theoretical)
> behavioral change: In shim mode, this assertion, if we somehow made it
> here, would suddenly not trigger anymore. Similarly for the earlier
> change the return path may wrongly be taken then.
Thanks.
>
> > @@ -2479,7 +2479,7 @@ domid_t domid_alloc(domid_t domid)
> > if ( domid == DOMID_FIRST_RESERVED )
> > domid = find_next_zero_bit(domid_bitmap,
> > DOMID_FIRST_RESERVED,
> > - 1);
> > + get_initial_domain_id() + 1);
>
> This imo is the worst of the changes. get_initial_domain_id() can return
> non-zero. In that case we still would (in principle) want to re-start
> from 1 here.
Thanks.
I will postpone this patch until the split of dom0 into control/hardware
settles.
>
> Jan
next prev parent reply other threads:[~2025-07-22 23:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 18:27 [PATCH v10 0/3] xen/domain: domain ID allocation dmkhn
2025-06-23 18:28 ` [PATCH v10 1/3] xen/domain: unify " dmkhn
2025-06-24 5:58 ` Jan Beulich
2025-07-17 10:27 ` Alejandro Vallejo
2025-07-22 23:17 ` dmkhn
2025-06-23 18:28 ` [PATCH v10 2/3] xen/domain: update create_dom0() messages dmkhn
2025-07-17 10:34 ` Alejandro Vallejo
2025-07-22 23:19 ` dmkhn
2025-07-17 12:58 ` Grygorii Strashko
2025-07-17 13:03 ` Jan Beulich
2025-07-18 11:20 ` Grygorii Strashko
2025-06-23 18:28 ` [PATCH v10 3/3] xen/domain: use get_initial_domain_id() instead of open-coded 0 dmkhn
2025-06-24 6:07 ` Jan Beulich
2025-07-22 23:24 ` dmkhn [this message]
2025-07-17 10:59 ` Alejandro Vallejo
2025-07-22 23:46 ` dmkhn
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=aIAdkbaKyDPO1WWg@kraken \
--to=dmkhn@proton.me \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=dmukhin@ford.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.