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

Re: [PATCH v4 02/11] xen: introduce CDF_directmap


  • To: Penny Zheng <penny.zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 7 Jan 2022 15:22:15 +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=W0aR9RyLcm2HgSb0SEQ4dUaDAcdv7xx4z6fzykrqqvc=; b=SSrvf76vTBE7+EZUJVjoHOp7hTOc05FbWZ8x+8m1PSoQqzJBvL1dh8nP62OyfMbgo8E42vVwXlzPimPfLBuTuzBNiCbDIUslP9uw875p4RpP64WerPD1vNl0yUFT9khajVa4hJG0DcXApS2wUl5hSD/+LCODccC8Q6gd665ucsWZt5068ivLzDuCa0doLE5gxhMrafSHyQb3cFczA8UHp+FxchJMtDGGXgOXLGzJi9sIyuo2ILU1T0Pr+hMgbTlZNhCOlE3Y4YxvYwDFB9ybVgmghEbFZ+9Hk4/+C1HG5Udsp9cVA3k2YLFzhHrg3Igw5Y2LkQKfvSuNI7i0WfrMxQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W2mm27whvtyte3fzv642DmHH5vrHygsGu49L6jVT1uZAqmsiAmrwYmcylLYSFhl//4QsIeztiHkrv4BCqKW/0bWCYHpx8z1OvnCDR5RYCkiA9wHhG/q09/So7Hzgbkiqmfxo/GzG09GYcshZ1qN/QKH55s6XNT44NEJuo74VwgaOyIAHDX8elN21ntdBlNtzgPjtU8jDDqpu1ahwvkID+tL/hQ73iqSTjVj97yzGLWDndE45vQEdzTkkyQRjxZSqzTlxvYEhyf6AFg9vXYJN+Y4ETHLzrsTKK2bOUVnu2+xRa/GlG6w9qBTAoXFp5x49ETCCYr5SvWVkHohv9oTOHw==
  • 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:22:34 +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>
> 
> This commit introduces a new arm-specific flag CDF_directmap to specify
> that a domain should have its memory direct-map(guest physical address
> == physical address) at domain creation.
> 
> Also, add a directmap flag under struct arch_domain and use it to
> reimplement is_domain_direct_mapped.
> 
> For now, direct-map is only available when statically allocated memory is
> used for the domain, that is, "xen,static-mem" must be also defined in the
> domain configuration.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>
> Signed-off-by: Penny Zheng <penny.zheng@xxxxxxx>

Non-Arm parts
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
However, ...

> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3029,10 +3029,20 @@ void __init create_domUs(void)
>              .max_maptrack_frames = -1,
>              .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
>          };
> +        unsigned int flags = 0U;

Nit: No real need for a U suffix here.

>          if ( !dt_device_is_compatible(node, "xen,domain") )
>              continue;
>  
> +        if ( dt_property_read_bool(node, "direct-map") )
> +        {
> +            if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) )

Isn't this too lax a check? I didn't find any other check of this
property, so the use of static memory must be keyed to something
else. Hence it's not sufficient that static memory support is
enabled in the build.

> @@ -65,7 +67,8 @@ int map_vcpu_info(struct vcpu *v, unsigned long gfn, 
> unsigned offset);
>  void unmap_vcpu_info(struct vcpu *v);
>  
>  int arch_domain_create(struct domain *d,
> -                       struct xen_domctl_createdomain *config);
> +                       struct xen_domctl_createdomain *config,
> +                       const unsigned int flags);

Same comment as for the earlier patch regarding the const here.

Jan




 


Rackspace

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