From: Ian Campbell Subject: Re: [RFC 13/14] xen/xsm: Add support for device tree Date: Mon, 17 Mar 2014 10:15:09 +0000 Message-ID: <1395051309.4122.40.camel@kazak.uk.xensource.com> References: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> <1394640969-25583-14-git-send-email-julien.grall@linaro.org> <1394818442.6065.19.camel@kazak.uk.xensource.com> <53234966.9030901@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 1WPUZe-00025C-9w for xen-devel@lists.xenproject.org; Mon, 17 Mar 2014 10:15:14 +0000 In-Reply-To: <53234966.9030901@linaro.org> 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: xen-devel@lists.xenproject.org, Daniel De Graaf , tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-03-14 at 18:24 +0000, Julien Grall wrote: > Hi Ian, > > On 03/14/2014 05:34 PM, Ian Campbell wrote: > > On Wed, 2014-03-12 at 16:16 +0000, Julien Grall wrote: > >> This patch adds a new module "xen,xsm-blob" to allow the user to load the XSM > >> policy when Xen is booting. > > > > While xsm_dt_policy_init does seem DT specific the xem_dt_init is very > > similar to the xsm_multiboot_init. Can they not be a common function > > with #ifdef HAVE_MULTIBOOT / #ifdef HAVE_DEVICETREE around the relevant > > specific bits (essentially just the call to the relevant policy_init)? > > Or at least refactor the tail of xsm_init into xsm_core_init which both > > cases can call into. > > The parameters of the function is not the same and it seems stupid to > also ifdef the list of arguments :). > > I can at least create a new function with > > if ( verify(&dummy_xsm_ops) ) > { > printk("%s could not verify dummy_xsm_ops structure.\n", > __FUNCTION__); > ret = -EIO; > goto err; > } > > xsm_ops = &dummy_xsm_ops; > do_xsm_initcalls(); My main concern was new code getting added to the generic tail of the init function, so putting that into a function sounds like a good idea to me. Ian.