From: Luca Fancellu <luca.fancellu@arm.com>
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org,
Bertrand Marquis <bertrand.marquis@arm.com>,
wei.chen@arm.com, Stefano Stabellini <sstabellini@kernel.org>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH v3 3/4] xen/arm: Reserve domid 0 for Dom0
Date: Wed, 14 Apr 2021 05:23:32 +0100 [thread overview]
Message-ID: <60A07B94-1499-4313-988C-60EE987B43AA@arm.com> (raw)
In-Reply-To: <db54612f-e237-2084-f11e-ffd5e045c3dc@xen.org>
> On 13 Apr 2021, at 18:00, Julien Grall <julien@xen.org> wrote:
>
> Hi Luca,
>
> The title probably wants to be updated as you don't really reserve domid 0. How about:
>
> xen/arm: Clarify how the domid is decided in create_domUs()
Sure I’ll update in the v4 patch I will send soon
Cheers,
Luca
>
> On 12/04/2021 11:52, Luca Fancellu wrote:
>> This patch adds a comment in create_domUs() right before
>> domain_create() to explain the importance of the pre-increment
>> operator on the variable max_init_domid, to ensure that the
>> domid 0 is allocated only during start_xen() function by the
>> create_dom0() and not on any other possible code path to the
>> domain_create() function.
>> Signed-off-by: Luca Fancellu <luca.fancellu@arm.com>
>> ---
>> Changes in v3:
>> - removed check introduced in v2.
>> ---
>> xen/arch/arm/domain_build.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
>> index 359957dc1b..b1d7b9849f 100644
>> --- a/xen/arch/arm/domain_build.c
>> +++ b/xen/arch/arm/domain_build.c
>> @@ -2508,6 +2508,11 @@ void __init create_domUs(void)
>> GUEST_VPL011_SPI - 32 + 1);
>> }
>> + /*
>> + * The variable max_init_domid is initialized with zero, so here it's
>> + * very important to use the pre-increment operator to call
>> + * domain_create() with a domid > 0. (domid == 0 is reserved for Dom0)
>> + */
>> d = domain_create(++max_init_domid, &d_cfg, false);
>> if ( IS_ERR(d) )
>> panic("Error creating domain %s\n", dt_node_name(node));
>
> --
> Julien Grall
next prev parent reply other threads:[~2021-04-14 4:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 10:52 [PATCH v3 0/4] xen/arm: Prevent Dom0 to be loaded when using dom0less Luca Fancellu
2021-04-12 10:52 ` [PATCH v3 1/4] xen/arm: Move dom0 creation in domain_build.c Luca Fancellu
2021-04-13 16:40 ` Julien Grall
2021-04-14 4:22 ` Luca Fancellu
2021-04-12 10:52 ` [PATCH v3 2/4] xen/arm: Handle cases when hardware_domain is NULL Luca Fancellu
2021-04-12 11:03 ` Jan Beulich
2021-04-12 13:58 ` Luca Fancellu
2021-04-12 14:22 ` Jan Beulich
2021-04-12 16:53 ` Luca Fancellu
2021-04-12 10:52 ` [PATCH v3 3/4] xen/arm: Reserve domid 0 for Dom0 Luca Fancellu
2021-04-13 17:00 ` Julien Grall
2021-04-14 4:23 ` Luca Fancellu [this message]
2021-04-12 10:52 ` [PATCH v3 4/4] xen/arm: Prevent Dom0 to be loaded when using dom0less Luca Fancellu
2021-04-13 17:02 ` Julien Grall
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=60A07B94-1499-4313-988C-60EE987B43AA@arm.com \
--to=luca.fancellu@arm.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=sstabellini@kernel.org \
--cc=wei.chen@arm.com \
--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 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).