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

Re: [Xen-devel] [PATCH v4] xen/arm: Allow balooning working with 1:1 memory mapping



>>> On 16.12.13 at 17:36, Julien Grall <julien.grall@xxxxxxxxxx> wrote:
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -65,6 +65,11 @@ struct vcpu *__init alloc_dom0_vcpu0(void)
>      return alloc_vcpu(dom0, 0, 0);
>  }
>  
> +int is_domain_direct_mapped(struct domain *d)

bool_t please, and const struct domain *.

> --- a/xen/include/asm-arm/domain.h
> +++ b/xen/include/asm-arm/domain.h
> @@ -86,6 +86,8 @@ enum domain_type {
>  #define is_pv64_domain(d) (0)
>  #endif
>  
> +int is_domain_direct_mapped(struct domain *d);

Furthermore, if this could be made a macro, ...

> --- a/xen/include/asm-x86/domain.h
> +++ b/xen/include/asm-x86/domain.h
> @@ -16,6 +16,8 @@
>  #define is_pv_32on64_domain(d) (is_pv_32bit_domain(d))
>  #define is_pv_32on64_vcpu(v)   (is_pv_32on64_domain((v)->domain))
>  
> +#define is_domain_direct_mapped(d) (0)

... you wouldn't need this here, but rather put it inside an
"#ifndef is_domain_direct_mapped" in xen/common/memory.c
itself.

And you'll want to make sure (even if unlikely to be needed in
practice) that you evaluate the macro argument exactly once
in both flavors, i.e. in the case here

#define is_domain_direct_mapped(d) ((void)(d), 0)

or, assuming that d being NULL is a mistake anyway (and
would crash elsewhere)

#define is_domain_direct_mapped(d) (!(d))

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

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