From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH 08/11] device tree, arm: supply a flat device tree to dom0 Date: Thu, 22 Mar 2012 17:12:49 +0000 Message-ID: <4F6B5D91.9020205@citrix.com> References: <1332179529-1828-1-git-send-email-david.vrabel@citrix.com> <1332179529-1828-9-git-send-email-david.vrabel@citrix.com> <1332425191.8817.81.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1332425191.8817.81.camel@zakaz.uk.xensource.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.xensource.com" , David Vrabel List-Id: xen-devel@lists.xenproject.org On 22/03/12 14:06, Ian Campbell wrote: > On Mon, 2012-03-19 at 17:52 +0000, David Vrabel wrote: >> From: David Vrabel >> >> Build a flat device tree for dom0 based on the one supplied to Xen. >> The following changes are made: >> >> * In the /chosen node, the xen,dom0-bootargs parameter is renamed to >> bootargs. >> >> * In all memory nodes, the reg parameters are adjusted to reflect >> the amount of memory dom0 can use. The p2m is updated using this >> info. >> >> Support for passing ATAGS to dom0 is removed. > > With the series applied up to and including this patch my dom0 kernel > fails to boot with: > [ 0.000000] Linux version 3.2.0-rc5-arm-native+ (ianc@drall) (gcc version 4.6.0 (GCC) ) #77 Thu Mar 22 13:58:33 GMT 2012 > [ 0.000000] CPU: ARMv7 Processor [410fc0f0] revision 0 (ARMv7), cr=10c53c7d > [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache > [ 0.000000] Machine: ARM Versatile Express, model: V2P-AEMv7A > [ 0.000000] bootconsole [earlycon0] enabled > [ 0.000000] Memory policy: ECC disabled, Data cache writeback > [ 0.000000] Kernel panic - not syncing: ERROR: Failed to allocate 0x1000 bytes below 0x0. > [ 0.000000] > [ 0.000000] [] (unwind_backtrace+0x0/0xe0) from [] (panic+0x50/0x17c) > [ 0.000000] [] (panic+0x50/0x17c) from [] (memblock_alloc_base+0x2c/0x34) > [ 0.000000] [] (memblock_alloc_base+0x2c/0x34) from [] (early_alloc.constprop.3+0x10/0x28) > [ 0.000000] [] (early_alloc.constprop.3+0x10/0x28) from [] (paging_init+0x48c/0x628) > [ 0.000000] [] (paging_init+0x48c/0x628) from [] (setup_arch+0x508/0x7ac) > [ 0.000000] [] (setup_arch+0x508/0x7ac) from [] (start_kernel+0x6c/0x2c0) > [ 0.000000] [] (start_kernel+0x6c/0x2c0) from [<80008048>] (0x80008048) This is really a bug in the memblock allocator. You have ARM_APPENDED_DTB enabled and you have actually appended a DTB. The appended DTB takes precedence over the one passed from the bootloader and DTB in the Linux tree has 2 GiB of memory @ 2 GiB. It looks like the memblock allocator adds start + size, overflows and ends up with the end of the region at 0. You can either: a) disable ARM_APPENDED_DTB; b) not append a DTB; or c) ensure the appended DTB's memory regions match that supplied by Xen. David