All of lore.kernel.org
 help / color / mirror / Atom feed
From: "mar.krzeminski" <mar.krzeminski@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Edgar Iglesias <edgar.iglesias@xilinx.com>,
	"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] Loading image/elf to cpu that has different not system memory address space
Date: Wed, 23 Sep 2015 19:31:07 +0200	[thread overview]
Message-ID: <5602E1DB.1060201@gmail.com> (raw)
In-Reply-To: <CAFEAcA-MSvwVK=HKxk5_HbHSHSxSZwh=t7WCD0xQC9hp5_k2OA@mail.gmail.com>

W dniu 23.09.2015 o 17:46, Peter Maydell pisze:
> On 23 September 2015 at 08:17, Marcin Krzemiński
> <mar.krzeminski@gmail.com> wrote:
>> Hello,
>>
>> I am trying to write a model of embedded board that have corterx-m3 and
>> cotex a9 processors.
>> Because M3 see different memory at address 0x0 than A9 (m3 has small rom, a9
>> has whole ram) I created different address space for m3 (thanks Peter
>> Crosthwaite! for hints how to do this!).
>> Now I stacked at loading "kernel" to start M3. If I use default address
>> space for M3 I can load I run my elf filr (it can be image, but currently it
>> is easiest for me with elf) all works fine.
>> The problem is when I switch to my new (root MR is not from
>> get_system_memory() call ) i got execution outside RAM exception.
>> That is happening because there are only zeroes in memory pointed by my
>> second address space.
>> The question is how can I load image to this memory (it might be elf, but
>> binary image also is fine)?
>> I can not even find the code that loads data to memory in fist place. Could
>> you point me where the loading is done in the code?
> This is going to be complicated. I suspect you will need to add
> some infrastructure for specifying per-CPU image loading (maybe
> via CPU properties?), which we don't have at all right now.
>
> (Our current image loading code for arm lives in hw/arm/boot.c.)
>
> thanks
> -- PMM
>
I couldn't find the place were actual data are put int M-, I don't know 
why I haven't seen
rom_add_blob() in boot.c.
At the machine init level I know all MRs, so I'll use 
memory_region_get_ram_ptr(),
and put data there.
If you have idea how to add this into framework, and someone beside me 
needs this,
maybe I can implement that?

Thanks,
Marcin

  reply	other threads:[~2015-09-23 17:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-23 15:17 [Qemu-devel] Loading image/elf to cpu that has different not system memory address space Marcin Krzemiński
2015-09-23 15:46 ` Peter Maydell
2015-09-23 17:31   ` mar.krzeminski [this message]
2015-09-24  3:06     ` Peter Crosthwaite
2015-09-24  3:07       ` Peter Crosthwaite
2015-09-24 17:14         ` mar.krzeminski
2015-09-24 18:38           ` Peter Crosthwaite
2015-09-24 18:58             ` mar.krzeminski
2015-09-29 22:40               ` Alistair Francis
2015-09-29 22:59                 ` Peter Maydell
2015-09-30  5:18                   ` Marcin Krzemiński
2015-09-30 10:44                     ` Peter Maydell
2015-09-30 12:15                       ` Marcin Krzemiński
2015-09-30 13:26                         ` Peter Maydell

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=5602E1DB.1060201@gmail.com \
    --to=mar.krzeminski@gmail.com \
    --cc=crosthwaite.peter@gmail.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.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.