From: "Jan Beulich" Subject: Re: [PATCH v4] xen/arm: Allow balooning working with 1:1 memory mapping Date: Mon, 16 Dec 2013 16:46:04 +0000 Message-ID: <52AF3C5C020000780010DD7F@nat28.tlf.novell.com> References: <1387211803-24933-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VsbJ4-000749-Dm for xen-devel@lists.xenproject.org; Mon, 16 Dec 2013 16:46:10 +0000 In-Reply-To: <1387211803-24933-1-git-send-email-julien.grall@linaro.org> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: Keir Fraser , ian.campbell@citrix.com, patches@linaro.org, tim@xen.org, stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 16.12.13 at 17:36, Julien Grall 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