All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Julien Grall <julien.grall@arm.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Wei Liu" <wei.liu2@citrix.com>,
	"Ian Jackson" <Ian.Jackson@eu.citrix.com>,
	"Ivan Pavić2" <Ivan.Pavic2@fer.hr>
Subject: Re: ARM bare metal application test
Date: Tue, 10 May 2016 10:49:30 +0100	[thread overview]
Message-ID: <20160510094929.GX12241@citrix.com> (raw)
In-Reply-To: <5730CF79.8060809@arm.com>

On Mon, May 09, 2016 at 06:57:13PM +0100, Julien Grall wrote:
> 
> 
> On 09/05/16 18:39, Wei Liu wrote:
> >On Mon, May 09, 2016 at 05:47:38PM +0100, Julien Grall wrote:
> >>
> >>
> >>On 09/05/16 17:43, Ivan Pavić2 wrote:
> >>>Hello Julien,
> >>
> >>Hello Ivan,
> >>
> >>>
> >>>Julien Grall wrote:
> >>>>Guest are booting with MMU disabled, so 0x80008000 will be the physical
> >>>>address.
> >>>
> >>>>The toolstack will load the kernel at this physical address. However,
> >>>>the start of the guest RAM for Xen 4.7 is 0x40000000 (see
> >>>>include/public/arch-arm.h). Can you try to use 0x40008000 for the guest
> >>>>address?
> >>>
> >>>I changed address. It seems the problem is solved because PC is now
> >>>40008030 (that is address of "work: b work" i think).
> >>
> >>You can figure out the associated instruction with objdump.
> >>
> >>>
> >>>>By the way, how much RAM did you give to the guest?
> >>>
> >>>I wrote "memory = 32" in cfg file, I think that stands for 32 MB?
> >>
> >>Correct, so the end of the RAM bank would be 0x42000000. I am a bit
> >>surprised that the toolstack does not complain when trying to load the
> >>kernel at 0x80008000.
> >>
> >
> >I don't think toolstack tries to load kernel to that guest physical
> >address -- reading from Ivan's log it suggests toolstack loaded the
> >kernel to 0x40008000.
> >
> >That (0x8000800) is the address set in PC, right?  I don't think
> >toolstack is in a position to sanitise that nor should it care.
> 
> The zImage format offers the opportunity to either choose the base address
> or let the loader do it for you.
> 
> Based on the specification, this address is supposed to be both the PC and
> the loading address. However, libxc (see xc_dom_parse_zimage32_kernel) seems
> to handle the first case incorrectly.
> 

 99     /*                                                                          
100      * If start is invalid then the guest will start at some invalid
101      * address and crash, but this happens in guest context so doesn't
102      * concern us here.
103      */
104     start = zimage[ZIMAGE32_START_OFFSET/4];

It looks like the comment agrees with me.  But at the end of the day it
is your call to determine what is the correct behaviour.

> It will be fairly easy to sanitize or even fix it. I will send a patch for
> it.
> 

Cool, thanks.

Though I suspect you also need to work out how rambase is arranged so it
might not be as simple as you thought. :-/

Wei.

> Cheers,
> 
> -- 
> Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-05-10  9:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-09  8:34 ARM bare metal application test Ivan Pavić2
2016-05-09  9:16 ` Julien Grall
2016-05-09 10:29   ` Ivan Pavić2
2016-05-09 15:50     ` Konrad Rzeszutek Wilk
2016-05-09 16:21       ` Odgovor: " Ivan Pavić2
2016-05-09 16:31     ` Julien Grall
2016-05-09 16:43       ` Ivan Pavić2
2016-05-09 16:47         ` Julien Grall
2016-05-09 16:55           ` Odgovor: " Ivan Pavić2
2016-05-09 17:39           ` Wei Liu
2016-05-09 17:57             ` Julien Grall
2016-05-10  9:49               ` Wei Liu [this message]
2016-05-09 17:59             ` Ivan Pavić2
2016-05-10  9:49               ` Wei Liu

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=20160510094929.GX12241@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Ivan.Pavic2@fer.hr \
    --cc=julien.grall@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.