From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v8 1/6] tools/libxl: Check if fdt_{first, next}_subnode are present in libfdt Date: Wed, 13 May 2015 16:22:10 +0100 Message-ID: <55536C22.6070100@citrix.com> References: <1431441192-27897-1-git-send-email-julien.grall@citrix.com> <1431441192-27897-2-git-send-email-julien.grall@citrix.com> <1431526046.8263.285.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YsYrm-0002gs-TT for xen-devel@lists.xenproject.org; Wed, 13 May 2015 15:46:39 +0000 In-Reply-To: <1431526046.8263.285.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 , Julien Grall Cc: Wei Liu , tim@xen.org, Julien Grall , Ian Jackson , stefano.stabellini@citrix.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org Hi Ian, On 13/05/15 15:07, Ian Campbell wrote: > On Tue, 2015-05-12 at 15:33 +0100, Julien Grall wrote: >> From: Julien Grall >> >> The functions fdt_{fisrt,next}_subnode may not be available because: > > "first" > >> * It has been introduced in 2013 => Doesn't work on Wheezy >> * The prototype exists but the functions are not exposed. Don't ask >> why... >> >> The later has been fixed recently in the dtc repo [1] >> >> When the functions are not available, implement our own in order to use >> them in a following patch. >> >> [1] git://git.kernel.org/pub/scm/utils/dtc/dtc.git >> commit a4b093f7366fdb429ca1781144d3985fa50d0fbb >> >> Signed-off-by: Julien Grall >> Signed-off-by: Ian Jackson >> Cc: Wei Liu > > I'm afraid this failed to build again this time with: > > tools/libxl/libxenlight.so: undefined reference to `fdt_first_property_offset' > tools/libxl/libxenlight.so: undefined reference to `fdt_get_property_by_offset' > tools/libxl/libxenlight.so: undefined reference to `fdt_next_property_offset' > > That's with arm32 == Debian Wheezy and arm64 == Ubuntu Saucy. :(. Both the distribution are using an old version of libfdt where the 3 prototypes are defined but the implementation is not exposed in the library (this is because they use a whitelist for building it) I gave look to see if we can import them from libfdt. It will require to import few others in order to make them work: - _fdt_check_node_offset - _fdt_offset_ptr - _nextprop I think we can skip the first one because it's only a validity check. FWIW, we declared the the partial device tree should be trusted so valid. Nonetheless we would add 5 more functions (+ the actual 2) in libxl which represents ~50 lines of codes. The 3 offending function have been correctly exposed since the version v1.4.0 released in June 2013. I gave a look to major distribution to see which version is using an old version of libfdt (i.e < 1.4.0: - Centos: < Centos 6 - Debian: < Jessie => Wheezy using an old version - Fedora: < Fedora 20 - openSuse: < opensuse 13.1 - ubuntu: < Ubuntu 14.04 => The LTS (14.04) is using a new version - RedHat: < Redhat 6 AFAICT, all major distributions except debian (for wheezy) are using a libfdt > v1.4. So I would suggest to disable the partial device tree support on distribution using older version. If the user want to use platform device passthrough it would have either to build a newer version of libfdt or append a device tree to the guest kernel. Note: IIRC osstest is using wheezy. If so, we won't be able to test platform device passthrough until the distribution version is upgraded. Although, we don't currently have a platform supporting non-PCI passthrough in osstest. Regards, -- Julien Grall