All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Brian Woods <brian.woods@xilinx.com>
Cc: xen-devel <xen-devel@lists.xenproject.org>, nd <nd@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Subject: Re: [Xen-devel] Errors with Loading Xen at a Certain Address
Date: Fri, 4 Oct 2019 10:49:28 +0100	[thread overview]
Message-ID: <edb70263-f98c-da0b-0e6a-859d6808b438@arm.com> (raw)
In-Reply-To: <20191004002502.GA9033@xilinx.com>

Hi Brian,

On 04/10/2019 01:25, Brian Woods wrote:
> On Thu, Oct 03, 2019 at 10:20:36PM +0100, Julien Grall wrote:
>> Hi Brian,
>>
>> On 10/3/19 9:24 PM, Brian Woods wrote:
>>> On Thu, Oct 03, 2019 at 07:23:23PM +0000, Julien Grall wrote:
>>> There's a WARN_ON() between the two debug printks calls I shared above.
>>
>> Looking at the log, the MFN seems to correspond to the one right after Xen
>> (0000000001400000 - 00000000015328f1) in memory.
>>
>> So it is normal to have the page given to the boot allocator. However, I am
>> not entirely sure which bit of init_done() is giving the page again to
>> xenheap.
>>
>> It is unlikely to be free_init_memory() because it deal with the init
>> section that is not at the end of the binary.
>>
>> This would leave discard_initial_modules() but there are a check to skip Xen
>> module.
>>
>> The call stack only print the address and not the symbol because it
>> unregistered the symbols for init. See unregister_init_virtual_memory().
>>
>> (XEN) Xen call trace:
>> (XEN)    [<000000000021c1a8>] page_alloc.c#free_heap_pages+0x1a8/0x614 (PC)
>> (XEN)    [<000000000021c1a8>] page_alloc.c#free_heap_pages+0x1a8/0x614 (LR)
>> (XEN)    [<000000000021e900>] page_alloc.c#init_heap_pages+0x3d4/0x564
>> (XEN)    [<000000000021eb24>] init_domheap_pages+0x94/0x9c
>> (XEN)    [<00000000002b83ec>] 00000000002b83ec
>> (XEN)    [<00000000002b8904>] 00000000002b8904
>> (XEN)    [<0000000000260a3c>] setup.c#init_done+0x10/0x20
>> (XEN)    [<00000000002b99ac>] 00000000002b99ac
>>
>> You should be able to use addr2line on the address with Xen binary.
>> I have the feeling this will point to discard_initial_modules() as this is
>> an init function and the symbol should not be printed.
>>
>> But, I can't see anything obviously wrong in the function... So I am not
>> entirely sure what could be the next steps.
>>
>> Cheers,
>>
>> -- 
>> Julien Grall
> 
> In the log, there's:
> (XEN) MODULE[0]: 0000000001400000 - 00000000015328f1 Xen
> (XEN) MODULE[1]: 00000000076d2000 - 00000000076dc080 Device Tree
> (XEN) MODULE[2]: 00000000076df000 - 0000000007fff364 Ramdisk
> (XEN) MODULE[3]: 0000000000080000 - 0000000003180000 Kernel
> (XEN)  RESVD[0]: 00000000076d2000 - 00000000076dc000
> (XEN)  RESVD[1]: 00000000076df000 - 0000000007fff364
> 
> Linux kernel	->   8_0000 - 318_0000
> Xen		-> 140_0000 - 153_28f1
> 
> There's something not quite right here... I'm guessing Xen was working
> at the address before because it was out of the "range" of the Linux
> kernel.  Now I guess I need to look into if it's a Xen or u-boot issue.

The loading address you wrote match the ones you seem to have requested in U-boot:

Filename 'yocto-Image'.
Load address: 0x80000

Filename 'xen-custom.ub'.
Load address: 0x1400000

But the size does not match the one you provided in the Device-Tree:

Bytes transferred = 18215424 (115f200 hex)

vs

0x0000000003180000 - 0x0000000000080000 = 0x3100000

This is always a risk when you write in advance the size of the binaries and 
location in the Device-Tree. If you are using tftp/load from FS, it is much less 
risky to provide a U-boot script that will generate the Xen DT node.

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2019-10-04  9:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02  0:32 [Xen-devel] Errors with Loading Xen at a Certain Address Brian Woods
     [not found] ` <48c9fc54-553e-3b6b-bad2-dbad35991df0@arm.com>
2019-10-02 16:52   ` Julien Grall
2019-10-02 18:56     ` Brian Woods
2019-10-02 19:59       ` Julien Grall
2019-10-02 21:22         ` Brian Woods
2019-10-02 23:20           ` Brian Woods
2019-10-03 17:08             ` Julien Grall
2019-10-03 18:15               ` Brian Woods
2019-10-03 19:23                 ` Julien Grall
2019-10-03 20:24                   ` Brian Woods
2019-10-03 21:20                     ` Julien Grall
2019-10-04  0:25                       ` Brian Woods
2019-10-04  9:49                         ` Julien Grall [this message]
2019-10-04 15:36                           ` Brian Woods

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=edb70263-f98c-da0b-0e6a-859d6808b438@arm.com \
    --to=julien.grall@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=brian.woods@xilinx.com \
    --cc=nd@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.