From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v3 15/24] xen/dts: Provide an helper to get a DT node from a path provided by a guest Date: Thu, 19 Mar 2015 14:53:54 +0000 Message-ID: <550AE302.7050200@linaro.org> References: <1421159133-31526-1-git-send-email-julien.grall@linaro.org> <1421159133-31526-16-git-send-email-julien.grall@linaro.org> <1424705450.27930.164.camel@citrix.com> <54EB4EC7.4050502@linaro.org> <1424708838.27930.206.camel@citrix.com> <54FEF868.7090704@linaro.org> <1426077291.21353.234.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 1YYbq3-0000hP-HX for xen-devel@lists.xenproject.org; Thu, 19 Mar 2015 14:54:23 +0000 Received: by wibdy8 with SMTP id dy8so120084580wib.0 for ; Thu, 19 Mar 2015 07:54:21 -0700 (PDT) In-Reply-To: <1426077291.21353.234.camel@citrix.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: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 11/03/15 12:34, Ian Campbell wrote: > On Tue, 2015-03-10 at 13:58 +0000, Julien Grall wrote: >> On 23/02/15 16:27, Ian Campbell wrote: >>> On Mon, 2015-02-23 at 16:01 +0000, Julien Grall wrote: >>>> Hi Ian, >>>> >>>> On 23/02/15 15:30, Ian Campbell wrote: >>>>> On Tue, 2015-01-13 at 14:25 +0000, Julien Grall wrote: >>>>> >>>>>> +/* This limit is used by the hypercalls to restrict the size of the path */ >>>>>> +#define DEVICE_TREE_MAX_PATHLEN 1024 >>>>> >>>>> Is this something you've made up or derived from the DT spec/ePAPR etc? >>>> >>>> I didn't find a such requirements on the spec. >>> >>> I vaguely recall a limit on the length of a single node name, and a >>> limit on the depth which they may nest, which can be multiplied. It's >>> probably an unhelpfully large number though, so... >>> >>>> I chose this number based on the linux pathlen because the path is also >>>> used in the sysfs (/sys/firmware/devicetree). >>> >>> ...that's a good as anything I suppose! >> >> Hmmm... I'm not so sure about the 1024 limit anymore. Linux is defining >> PATH_MAX to 4096 but I don't see many usage in the sysfs code. >> >> And this value may change from one OS to another. Although, 1024 sounds >> a very long path to write in the configuration file... > > I imagine in practice it will be cut-and-pasted, but yes. > >> Maybe we should >> support alias too? > > Perhaps 2048 + (optionally, perhaps later) add alias support? > > 2048 because I assume 4096 being PAGE_SIZE would have some interesting > corner cases, especially for a target buffer on the stack. If not then > why not go straight for 4096? XSM seems to use 4096 to copy string for an hypercall buffer. I will use the same here. Regards, -- Julien Grall