From: Ian Campbell Subject: Re: [RFC 04/24] xen/dts: Constify device_tree_flattened Date: Thu, 22 Aug 2013 15:07:04 +0100 Message-ID: <1377180424.2825.45.camel@kazak.uk.xensource.com> References: <1376687156-6737-1-git-send-email-julien.grall@linaro.org> <1376687156-6737-5-git-send-email-julien.grall@linaro.org> <1377176728.2825.3.camel@kazak.uk.xensource.com> <5216139C.2010006@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5216139C.2010006@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: patches@linaro.org, xen-devel@lists.xen.org, andre.przywara@linaro.org, stefano.stabellini@eu.citrix.com List-Id: xen-devel@lists.xenproject.org On Thu, 2013-08-22 at 14:35 +0100, Julien Grall wrote: > On 08/22/2013 02:05 PM, Ian Campbell wrote: > > On Fri, 2013-08-16 at 22:05 +0100, Julien Grall wrote: > >> The Flat Device Tree is given by the bootloader. Xen doesn't need to modify it. > >> > >> Signed-off-by: Julien Grall > > > > Acked-by: Ian Campbell > > > >> @@ -363,8 +364,9 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) > >> * > >> * TODO: handle other payloads too. > >> */ > >> - device_tree_flattened = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); > >> - copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE); > >> + fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); > >> + copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE); > >> + device_tree_flattened = fdt; > > > > Not related to this patch but I wonder if we ought to alloc_boot_pages > > (order_of(dtb_size)) or at least BUG_ON(dtb_size > PAGE_SIZE). > > The last solution can't work. The size of device tree is about 32K, so > greater than one page. I was being thick, I thought the "1" was the allocation size, missing the fact that "dtb_pages" was right there staring me in the face. (FTR 1 is the alignment...) Ian