From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel De Graaf Subject: Re: [V8 PATCH 4/8] pvh dom0: make xsm_map_gmfn_foreign available for x86 Date: Tue, 25 Mar 2014 13:53:32 -0400 Message-ID: <5331C29C.5050002@tycho.nsa.gov> References: <1395452357-1598-1-git-send-email-mukesh.rathor@oracle.com> <1395452357-1598-5-git-send-email-mukesh.rathor@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSVYZ-0001Cs-TW for xen-devel@lists.xenproject.org; Tue, 25 Mar 2014 17:54:36 +0000 In-Reply-To: <1395452357-1598-5-git-send-email-mukesh.rathor@oracle.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Mukesh Rathor , xen-devel@lists.xenproject.org Cc: George.Dunlap@eu.citrix.com, keir.xen@gmail.com, tim@xen.org, JBeulich@suse.com, julien.grall@linaro.org List-Id: xen-devel@lists.xenproject.org On 03/21/2014 09:39 PM, Mukesh Rathor wrote: > In this patch we make xsm_map_gmfn_foreign available for x86 also. This > is used in the next patch "pvh dom0: Add and remove foreign pages" in > function p2m_add_foreign. > > Signed-off-by: Mukesh Rathor I think the definition needs to be moved above the #ifdef CONFIG_X86 group now that it is common to X86 and ARM, so that the functions in xsm_operations remain organized with common functions preceding the architecture-specific functions. Otherwise, adding ARM-only operations in the future will need to move this function to leave a sane-looking structure. > --- > xen/include/xsm/dummy.h | 2 -- > xen/include/xsm/xsm.h | 4 ---- > xen/xsm/dummy.c | 2 -- > xen/xsm/flask/hooks.c | 4 ---- > 4 files changed, 12 deletions(-) > > diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h > index 3bcd941..eb7aeb8 100644 > --- a/xen/include/xsm/dummy.h > +++ b/xen/include/xsm/dummy.h > @@ -622,10 +622,8 @@ static XSM_INLINE int xsm_ioport_mapping(XSM_DEFAULT_ARG struct domain *d, uint3 > > #endif /* CONFIG_X86 */ > > -#ifdef CONFIG_ARM > static XSM_INLINE int xsm_map_gmfn_foreign(XSM_DEFAULT_ARG struct domain *d, struct domain *t) > { > XSM_ASSERT_ACTION(XSM_TARGET); > return xsm_default_action(action, d, t); > } > -#endif > diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h > index de9cf86..6281e29 100644 > --- a/xen/include/xsm/xsm.h > +++ b/xen/include/xsm/xsm.h > @@ -164,9 +164,7 @@ struct xsm_operations { > int (*ioport_permission) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow); > int (*ioport_mapping) (struct domain *d, uint32_t s, uint32_t e, uint8_t allow); > #endif > -#ifdef CONFIG_ARM > int (*map_gmfn_foreign) (struct domain *d, struct domain *t); > -#endif > }; > > #ifdef XSM_ENABLE > @@ -630,12 +628,10 @@ static inline int xsm_ioport_mapping (xsm_default_t def, struct domain *d, uint3 > } > #endif /* CONFIG_X86 */ > > -#ifdef CONFIG_ARM > static inline int xsm_map_gmfn_foreign (xsm_default_t def, struct domain *d, struct domain *t) > { > return xsm_ops->map_gmfn_foreign(d, t); > } > -#endif /* CONFIG_ARM */ > > #endif /* XSM_NO_WRAPPERS */ > > diff --git a/xen/xsm/dummy.c b/xen/xsm/dummy.c > index 3fe4c59..0234490 100644 > --- a/xen/xsm/dummy.c > +++ b/xen/xsm/dummy.c > @@ -134,7 +134,5 @@ void xsm_fixup_ops (struct xsm_operations *ops) > set_to_dummy_if_null(ops, ioport_permission); > set_to_dummy_if_null(ops, ioport_mapping); > #endif > -#ifdef CONFIG_ARM > set_to_dummy_if_null(ops, map_gmfn_foreign); > -#endif > } > diff --git a/xen/xsm/flask/hooks.c b/xen/xsm/flask/hooks.c > index 96276ac..df92953 100644 > --- a/xen/xsm/flask/hooks.c > +++ b/xen/xsm/flask/hooks.c > @@ -1450,12 +1450,10 @@ static int flask_unbind_pt_irq (struct domain *d, struct xen_domctl_bind_pt_irq > } > #endif /* CONFIG_X86 */ > > -#ifdef CONFIG_ARM > static int flask_map_gmfn_foreign(struct domain *d, struct domain *t) > { > return domain_has_perm(d, t, SECCLASS_MMU, MMU__MAP_READ | MMU__MAP_WRITE); > } > -#endif > > long do_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op); > int compat_flask_op(XEN_GUEST_HANDLE_PARAM(xsm_op_t) u_flask_op); > @@ -1566,9 +1564,7 @@ static struct xsm_operations flask_ops = { > .ioport_permission = flask_ioport_permission, > .ioport_mapping = flask_ioport_mapping, > #endif > -#ifdef CONFIG_ARM > .map_gmfn_foreign = flask_map_gmfn_foreign, > -#endif > }; > > static __init int flask_init(void) > -- Daniel De Graaf National Security Agency