On 20.12.2021 06:21, Penny Zheng wrote:
> From: Stefano Stabellini <stefano.stabell...@xilinx.com>
> 
> 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.stabell...@xilinx.com>
> Signed-off-by: Penny Zheng <penny.zh...@arm.com>

Non-Arm parts
Acked-by: Jan Beulich <jbeul...@suse.com>
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


Reply via email to