All of lore.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm <qemu-arm@nongnu.org>
Subject: Re: [Qemu-arm] Booting Cortex-M3 Linux kernels in qemu
Date: Tue, 19 Jun 2018 10:43:45 -0700	[thread overview]
Message-ID: <20180619174345.GC16846@roeck-us.net> (raw)
In-Reply-To: <CAFEAcA_8c6awzGcik2Hzs8zrHpkqGG=tCt_ykjVnSSa1fkkpzQ@mail.gmail.com>

On Tue, Jun 19, 2018 at 01:41:06PM +0100, Peter Maydell wrote:
> On 16 June 2018 at 19:53, Guenter Roeck <linux@roeck-us.net> wrote:
> > On 06/16/2018 11:08 AM, Peter Maydell wrote:
> >> My general view is that where QEMU takes the path of "do what
> >> the hardware does", that is straightforward and doesn't lead
> >> us into future annoying deadends or misdesigns. Where QEMU
> >> does things that are not what the hardware does, that is where
> >> it's easy to go wrong. Real MPS2 hardware doesn't magically
> >> load Linux kernels and DTBs (it boots whatever the firmware
> >> image is).
> >
> > ... while mine is that I have no trouble running Linux test images
> > in qemu when it supports options such as -dtb and -initrd, while it
> > is a pain to run and maintain if I have to have a secondary loader
> > that isn't part of qemu. Guess we just have different perspectives.
> 
> Well, somebody has to write and maintain the code that deals
> with the mismatch between how hardware starts up and how
> the kernel wants to be started. The question seems to me
> to be whether that should be in QEMU, in the kernel or a
> standalone bit of code... I don't think the overall effort
> required changes much. (Personally I'd put the code in the
> kernel, since it's about a dozen lines of asm and a linker
> script or two.)
> 
> You need a boot-wrapper bit of code to run the kernel on the
> real hardware too. I haven't actually tested it but
> I think it ought to work in QEMU too (and if it doesn't
> that's a bug I'd like to fix):
>  https://github.com/ARM-software/bootwrapper/tree/cortex-m-linux
> 

Thanks a lot for the link; that gave me enough information to find
a solution that is not too invasive and works for me.

I need to be able to run a single kernel image against multiple
devicetree files and root file systems. This doesn't work with
above solution since it bundles everything together (or, rather,
it would break my workflow). However, it was easy enough to tweak the
boot wrapper and load it using "-bios". I added support for "-bios",
"-initrd", and "-dtb" to mps2_common_init(). That change is simple
enough to carry in my private qemu branch.

Thanks,
Guenter

  reply	other threads:[~2018-06-19 17:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-14 21:54 [Qemu-arm] Booting Cortex-M3 Linux kernels in qemu Guenter Roeck
2018-06-15  9:16 ` Peter Maydell
2018-06-15 13:30   ` Guenter Roeck
2018-06-15 13:54     ` Peter Maydell
2018-06-15 18:13       ` Guenter Roeck
2018-06-15 22:49         ` Guenter Roeck
2018-06-16 11:13         ` Peter Maydell
2018-06-16 15:08           ` Guenter Roeck
2018-06-16 18:08             ` Peter Maydell
2018-06-16 18:53               ` Guenter Roeck
2018-06-19 12:41                 ` Peter Maydell
2018-06-19 17:43                   ` Guenter Roeck [this message]
2018-06-20  8:52                     ` Peter Maydell
2018-06-20 22:54                       ` Guenter Roeck

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=20180619174345.GC16846@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@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.