Hi Jan

Sorry for the late reply.

> -----Original Message-----
> From: Jan Beulich <[email protected]>
> Sent: Friday, January 7, 2022 10:22 PM
> To: Penny Zheng <[email protected]>
> Cc: Bertrand Marquis <[email protected]>; Wei Chen
> <[email protected]>; [email protected];
> [email protected]; [email protected]
> Subject: Re: [PATCH v4 02/11] xen: introduce CDF_directmap
> 
> On 20.12.2021 06:21, Penny Zheng wrote:
> > From: Stefano Stabellini <[email protected]>
> >
> > 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 <[email protected]>
> > Signed-off-by: Penny Zheng <[email protected]>
> 
> Non-Arm parts
> Acked-by: Jan Beulich <[email protected]> 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.
> 

Ok.
I'll change the check to " if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || 
!dt_find_property(node, "xen,static-mem", NULL) ) "
to make the check a bit more strict.

> > @@ -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

Many thanks,
Penny Zheng

Reply via email to