Hi Jan > -----Original Message----- > From: Jan Beulich <[email protected]> > Sent: Tuesday, May 31, 2022 4:41 PM > To: Penny Zheng <[email protected]> > Cc: Wei Chen <[email protected]>; Stefano Stabellini > <[email protected]>; Julien Grall <[email protected]>; Bertrand Marquis > <[email protected]>; Volodymyr Babchuk > <[email protected]>; Andrew Cooper > <[email protected]>; George Dunlap <[email protected]>; > Wei Liu <[email protected]>; [email protected] > Subject: Re: [PATCH v5 6/9] xen/arm: introduce CDF_staticmem > > On 31.05.2022 05:12, Penny Zheng wrote: > > --- a/xen/arch/arm/include/asm/domain.h > > +++ b/xen/arch/arm/include/asm/domain.h > > @@ -31,6 +31,10 @@ enum domain_type { > > > > #define is_domain_direct_mapped(d) ((d)->cdf & CDF_directmap) > > > > +#ifdef CONFIG_STATIC_MEMORY > > +#define is_domain_using_staticmem(d) ((d)->cdf & CDF_staticmem) > > +#endif > > Why is this in the Arm header, rather than ... > > > --- a/xen/include/xen/domain.h > > +++ b/xen/include/xen/domain.h > > @@ -34,6 +34,12 @@ void arch_get_domain_info(const struct domain *d, > > #ifdef CONFIG_ARM > > /* Should domain memory be directly mapped? */ > > #define CDF_directmap (1U << 1) > > +/* Is domain memory on static allocation? */ > > +#define CDF_staticmem (1U << 2) > > +#endif > > + > > +#ifndef is_domain_using_staticmem > > +#define is_domain_using_staticmem(d) ((void)(d), false) > > #endif > > ... here (with what you have here now simply becoming the #else part)? > Once living here, I expect it also can be an inline function rather than a > macro, > with the #ifdef merely inside its body. >
In order to avoid bring the chicken and egg problem in xen/include/xen/domain.h, I may need to move the static inline function to xen/include/xen/sched.h(which has already included domain.h header). > Jan
