From: Ian Jackson Subject: Re: [PATCH] tools: implement initial ramdisk support for ARM. Date: Thu, 3 Apr 2014 15:41:11 +0100 Message-ID: <21309.29447.77194.376178@mariner.uk.xensource.com> References: <1396521943-30825-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1396521943-30825-1-git-send-email-ian.campbell@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: stefano.stabellini@eu.citrix.com, tim@xen.org, julien.grall@linaro.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("[PATCH] tools: implement initial ramdisk support for ARM."): > [stuff] Thanks. This will be useful. I have some fairly minor comments: > Furthermore if the ramdisk has been explicitly placed then xc_dom_build_image() > assumes that it is not to be decompressed (since that would muck up the sizings > used on placement). This strikes me as rather subtle. Perhaps it should be documented in the header file. > @@ -326,7 +364,6 @@ int xc_dom_feature_translated(struct xc_dom_image *dom) > * mode: C > * c-file-style: "BSD" > * c-basic-offset: 4 > - * tab-width: 4 Not mentioned in your commit message, but fair enough. > +/* setup arch specific hardware description, i.e. DTB on ARM */ > +int libxl__arch_domain_init_hw_description(libxl__gc *gc, > + libxl_domain_build_info *info, > + struct xc_dom_image *dom); > +/* finalize arch specific hardware description. */ > +int libxl__arch_domain_finalise_hw_description(libxl__gc *gc, > + libxl_domain_build_info *info, > + struct xc_dom_image *dom); These comments mostly simply repeat the function name. I would delete the second one (but won't object if you want to keep it ...) > @@ -475,7 +488,7 @@ next_resize: > FDT( fdt_begin_node(fdt, "") ); > > FDT( make_root_properties(gc, vers, fdt) ); > - FDT( make_chosen_node(gc, fdt, info) ); > + FDT( make_chosen_node(gc, fdt, !!dom->ramdisk_blob, info) ); The !! are redundant when converting an expression to a bool. But you can leave them in if you feel it's clearer. > + if (ramdisk) { > + int chosen, res = fdt_path_offset(fdt, "/chosen"); That's rather confusing. At the very least can we have these as two lines so it doesn't look like a multiple-values-bind to Lisp programmers :-) ? But I'm not sure of the need for chosen to be separate from res. This whole function is rather flabby, with two near-idential 9-line stanzas. How can fdt_setprop_inplace fail ? Can you justify assert() ? Thanks, Ian.