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

Re: [PATCH v4 01/11] xen: introduce internal CDF_xxx flags for domain creation


  • To: Penny Zheng <penny.zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 7 Jan 2022 15:14:24 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=i5WuuNgJhEFKyF6HTH6N7TYfyfm6w/0abFEOFDDCIjk=; b=W2mrT4lGCOt39f5Fe3/dSvpwYkJa/wd4uJ8NWo4ObWley55XDOy5ODtDaASwHG94cvnrIbF9/vkMiVeWVINLiJolSL/yGMno0+oTwFLOzbpG1JydpMt+p582vntFz89psCEB5PkQKFhZ6mBGjjJqLk1uX/QDr5r/zPeWxANXB3cRGvSzeP33Uqsq5R/DdlzVEEq8dIaw6FHoAx5FDfc+0AUj+dAbEuWrzR7tuakiISZIpGyN7BVz+RN2TZcB1tTHuu9t0htw8f/K2gvELUJXxKH61w2zEXnQnYS8ObpDTvO0TjZnhqyW4y6TXbjOL0aLrvaJk0irA2NvfeWgvb8bwA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QnyPuEa2iV9TuC4OPsz0MNz4Gru6W+ruvOjKhZ7tyQQgTlSA5EKXIMZDeJUuM2OBsfS/pdzoSI3tpZWetwtTCEd+fE1JEecS/ZaEPWlXA5rhornIhSQIjc6aN+tVXyANv6oajttkHHy+OkbD55ybnVo444G8O3E/qke3ubVg8ibXR4PYkxpYX4iE53PxHbhG10n9WinXhEbl6U5T5MPz+wwTzVGZoguPKRFTtlljDzsyxJyyWZGYkgt8x3fhigaRC2Mdu6OSgj0rwzOdQ9tt3z5Qk6CaHK5DlcYpWHaDI0XzQN4rKOQ6pUKDLdERiGClSE1xIbMdjaqzToVJtGLuAA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand.Marquis@xxxxxxx, Wei.Chen@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, julien@xxxxxxx
  • Delivery-date: Fri, 07 Jan 2022 14:14:56 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 20.12.2021 06:21, Penny Zheng wrote:
> From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> 
> We are passing an internal-only boolean flag at domain creation to
> specify whether we want the domain to be privileged (i.e. dom0) or
> not. Another flag will be introduced later in this series.
> 
> This commit extends original "boolean" to an "unsigned int" covering both
> the existing "is_priv" and our new "directmap", which will be introduced 
> later.
> 
> To make visible the relationship, we name the respective constants CDF_xxx
> (with no XEN_DOMCTL_ prefix) to represent the difference with the public
> constants XEN_DOMCTL_CDF_xxx.
> 
> Allocate bit 0 as CDF_privileged: whether a domain is privileged or not.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
with one remark:

> --- a/xen/common/domain.c
> +++ b/xen/common/domain.c
> @@ -552,7 +552,7 @@ static int sanitise_domain_config(struct 
> xen_domctl_createdomain *config)
>  
>  struct domain *domain_create(domid_t domid,
>                               struct xen_domctl_createdomain *config,
> -                             bool is_priv)
> +                             const unsigned int flags)

We don't normally use const like this, so I'd suggest to drop it here
and ...

> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -665,7 +665,7 @@ int arch_sanitise_domain_config(struct 
> xen_domctl_createdomain *config);
>   */
>  struct domain *domain_create(domid_t domid,
>                               struct xen_domctl_createdomain *config,
> -                             bool is_priv);
> +                             const unsigned int flags);

... here.

Jan




 


Rackspace

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