[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 3/4] xen/arm: Clarify how the domid is decided in create_domUs()
- To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Wed, 14 Apr 2021 10:14:37 +0000
- Accept-language: en-GB, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LAiUwCKuHt4rmaWRpICcakGzsNcTinl6FR0YNeTAW70=; b=F60IzQb1Yxd8IwAInRcdTuyBMBrc3q1vBxyHnJZ5oxYK1gtfK/mI8BZeB9S77g+Y3EpZRF1kivrJJqPSKgZIadVSivGqyq53B+ksLvt6APbEQVTnPc06pcpDKRbtev9qDbPh5DHUDB0Rlo8E4f/Ofl55LQzhjkUkyNWYlfNrCtB83xk9slQhzFid8T5LYkAg9TiFc6uCVHlnWIRARDhWexZW9eowcPGEwOxfV+okwVdv/HGdd0FYoXlT3DOql96wcVek3Qg3vfqw1CqHByzwIryDIvSbHWyr44w2cFhSIAUEoP6GPqlBQ/QHJFpsrjdNUcf1XRKJZTN/iVtGKZe9YQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J2NMpui5bafaLgaV14U0n6Z3GppZD/ZmM0umXYWR0h4fs0imanZ7rKpaVftLW5WFT8enyZKvjCB9T8jWGi3cCeRDLcLVNXdonZvUDW1je6L2fQM3rXmJmXWjunKUdn+ZySrryGKVIrdCiKygU0flKFX+pfDmkGb80r4g6+Gn6LHUBgITsdAcCbEH2mlCtXxsAHh6Pxie8Ei/OXcSGC0O+IVS7eulfLppIuhtP1+/KTbesafKf1iMvDjInqTJ2d2WMi/bjhYaX0Z6WmCzDYRLqROdH6/sV+iwxYmRP3n0HcmTJjXvrtnNi8YekoLMl5YvVp82YShtlHszFBywbt4UKA==
- Authentication-results-original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Wed, 14 Apr 2021 10:15:02 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com;
- Thread-index: AQHXMQ6fDaCb9krTZ0m5muPO6Ilq06qzy9WA
- Thread-topic: [PATCH v4 3/4] xen/arm: Clarify how the domid is decided in create_domUs()
Hi Luca,
> On 14 Apr 2021, at 10:14, Luca Fancellu <Luca.Fancellu@xxxxxxx> 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@xxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
Cheers,
Bertrand
> ---
> Changes in v4:
> - Change to the commit title
> 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));
> --
> 2.17.1
>
>
|