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

Re: [PATCH] xen/arm: Allow to set grant table related limits for dom0less domUs


  • To: Michal Orzel <michal.orzel@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Wed, 14 Dec 2022 15:20:31 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rTym/Yo5ckKFFKsvIeBULuz83/6+wmN7G1wBIkwWE4k=; b=ZjU1aqsW5cNFNdU0FJ0ERuvAseJms5bcxZGj3K3E6V9Hk3TWb8rIaQOWPLmHtNqQG5GOffo1epj6CZz6z+0PiDGv1C7EptVSh3e0S3t6ws0I8TqJXs9Gtg+i1b2jJ6fjWrLTXmu+sNQcIt/OQpzLSWt7iMTjjLa/Yr8xUAk7/a5yeMgcEk0nHw0glGoeUVQ3b25JAU25+X/1G2cphxCYGU+p8JwUwj5o//mfCK2SEc0po/b+NNU/OAMFCpf5QWeiKadT7MtsHpCgut5DNzFpCXTk12YbB/wNlaO/rmyVbCNuVQxRAto+wsGWirwVDFdObpbqm8m23vSOP2OVeLlllg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NGnOur/jtEFs7N/csqCKlxaRO8ntsOdnWYVFJAgQyyYfdqDl0/NYBihczHUUOnrzDWnnC5NjNRCrxu6+e2quSjuaPAYtQbtbp0t+vXXw78tu6kYUt+W69bVNR2bgpBHCbYGDMkudBZeiSnZ5sqnUCJbikPllxbBXVA7/De88mRH1VaL6FRo2jA8YCeHrFDZEHwxfdP6hCYX+GZx5uJUDqdepbkWRXAhzVkWLSao/D/V2F6q7CNjonvAQMccFcEArvHj+LlyOesuOWUAOpakteh980Xh+QdSSEX6RAQmexvLYJ6nyC8TanOyPt+KgIqyvVxceaSr2j65CQfzJOA1F1w==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Wed, 14 Dec 2022 15:21:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHZD74qZCDATUsvpUqdx+UqIsQp5q5tf6sA
  • Thread-topic: [PATCH] xen/arm: Allow to set grant table related limits for dom0less domUs


> On 14 Dec 2022, at 13:08, Michal Orzel <michal.orzel@xxxxxxx> wrote:
> 
> At the moment, for dom0less domUs, we do not have a way to specify
> per domain grant table related limits (unlike when using xl), namely
> max version, max number of grant frames, max number of maptrack frames.
> This means that such domains always use the values specified by the Xen
> command line parameters or their default values if unspecified.
> 
> In order to have more control over dom0less domUs, introduce the
> following device-tree properties that can be set under domUs nodes:
> - max_grant_version to set the maximum grant table version the domain
>   is allowed to use,
> - max_grant_frames to set the maximum number of grant frames the domain
>   is allowed to have,
> - max_maptrack_frames to set the maximum number of grant maptrack frames
>   the domain is allowed to have.
> 
> Update documentation accordingly.
> 
> Note that the sanity checks regarding the passed values are already
> there in grant_table_init() resulting in panic in case of errors,
> therefore no need to repeat them in create_domUs().
> 
> Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>

The patch looks good to me.

Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx>


> ---
> docs/misc/arm/device-tree/booting.txt | 21 +++++++++++++++++++++
> xen/arch/arm/domain_build.c           | 11 ++++++++++-
> 2 files changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/misc/arm/device-tree/booting.txt 
> b/docs/misc/arm/device-tree/booting.txt
> index 87eaa3e25491..3879340b5e0a 100644
> --- a/docs/misc/arm/device-tree/booting.txt
> +++ b/docs/misc/arm/device-tree/booting.txt
> @@ -223,6 +223,27 @@ with the following properties:
>     the default size of domain P2M pool, i.e. 1MB per guest vCPU plus 4KB
>     per MB of guest RAM plus 512KB for guest extended regions.
> 
> +- max_grant_version
> +
> +    Optional. A 32-bit integer specifying the maximum grant table version
> +    the domain is allowed to use (valid values are 1 or 2). If this property
> +    is missing, the value specified by Xen command line parameter 
> gnttab=max-ver
> +    (or its default value if unspecified, i.e. 1) is used.
> +
> +- max_grant_frames
> +
> +    Optional. A 32-bit integer specifying the maximum number of grant frames
> +    the domain is allowed to have. If this property is missing, the value
> +    specified by Xen command line parameter gnttab_max_frames (or its default
> +    value if unspecified, i.e. 64) is used.
> +
> +- max_maptrack_frames
> +
> +    Optional. A 32-bit integer specifying the maximum number of grant 
> maptrack
> +    frames the domain is allowed to have. If this property is missing, the
> +    value specified by Xen command line parameter gnttab_max_maptrack_frames
> +    (or its default value if unspecified, i.e. 1024) is used.
> +
> Under the "xen,domain" compatible node, one or more sub-nodes are present
> for the DomU kernel and ramdisk.
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index bef5e905a73c..29b2f3e1faa2 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3871,7 +3871,7 @@ void __init create_domUs(void)
>             .max_maptrack_frames = -1,
>             .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>         };
> -        unsigned int flags = 0U;
> +        unsigned int flags = 0U, val;
> 
>         if ( !dt_device_is_compatible(node, "xen,domain") )
>             continue;
> @@ -3940,6 +3940,15 @@ void __init create_domUs(void)
>             d_cfg.cpupool_id = pool_id;
>         }
> 
> +        if ( dt_property_read_u32(node, "max_grant_version", &val) )
> +            d_cfg.grant_opts = XEN_DOMCTL_GRANT_version(val);
> +
> +        if ( dt_property_read_u32(node, "max_grant_frames", &val) )
> +            d_cfg.max_grant_frames = val;
> +
> +        if ( dt_property_read_u32(node, "max_maptrack_frames", &val) )
> +            d_cfg.max_maptrack_frames = val;
> +
>         /*
>          * The variable max_init_domid is initialized with zero, so here it's
>          * very important to use the pre-increment operator to call
> -- 
> 2.25.1
> 
> 




 


Rackspace

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