[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 3/4] xen/arm: Reserve domid 0 for Dom0


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Wed, 14 Apr 2021 05:23:32 +0100
  • 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=M/Dq2cy9NxK/tiUL1TVPJyz45kZREAyGBq8vIS5Uin8=; b=b7PIXAL9+eihzrjZx7Si/SKcOQt+1RbrDaZWGhoYrXvKmfzsiV8vrK4TMjR0duoMb6LzmoeMIu9itQ1tlqMFRTLtcl3BbdchvYnPnxjkvnUeu4mPdJYEB9KUxLG4I7hGqB6hgOBnLmuKlXX1f747ZyaFZLcv3IJOQ9FfI5mJDeZ0tC1doOxqueTqe19cEzN2LL1y+JDA3co4MFK15oIbfZiKVnfo8ozK3kocjuz/JzBdhvrJrFWHGaBNfwoViRqoopaE2rKLA/x62afpHMGO0lAhxVe0FmZXkMQCkUk85VyeYxY32lxsAiQQXHZfYHsgGM94axn4VkAxzkIJaMnm5A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MOXlkl/qRmpBLQendHx2/r+AVcVyKygumxlSlgh2dJru4I8yuihaTYoNJfrZrwKW0jeuAYimQI6sD/naGEQhMMuIzowO+2kzv8kN5PQJyHFsSG5cO9NG65rYM7mGDIZwbopPQYEwH6UkAQBXXpzer798RZWA3dygRyD3NcBY8FAIKONdrMwYxCjrTtk4tPG+XOGJ0xHukgRsaBeVPrG8ln3zRnBKDFOLTOCbYO9rjcUzayXT2Le7Hg7ymlHPpN3k9aSCurdkt9CivTbIe3lBQxrbOmb2T8CNMxqnAjdu/PVhHsxTqI0KxJm57YiqEtoNVTNkZWNzojdzXU4DDIRmFw==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Bertrand Marquis <bertrand.marquis@xxxxxxx>, wei.chen@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 14 Apr 2021 04:23:48 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;


> On 13 Apr 2021, at 18:00, Julien Grall <julien@xxxxxxx> 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@xxxxxxx>
>> ---
>> 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




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.