From: Alistair Francis <alistair23@gmail.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: "open list:RISC-V" <qemu-riscv@nongnu.org>,
Palmer Dabbelt <palmer@sifive.com>,
Alistair Francis <alistair.francis@wdc.com>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC v1 0/5] RISC-V: Add firmware loading support and default
Date: Wed, 19 Jun 2019 11:23:37 -0700 [thread overview]
Message-ID: <CAKmqyKMmm-38DijX_wL=pAbvxzLQ+KSOtd1xg_GrT4Az70GKsw@mail.gmail.com> (raw)
In-Reply-To: <CAEUhbmUwAVLXY9SSoryWBDeNL8gUfBCE+xweSSmuE9KwzWeX=w@mail.gmail.com>
On Wed, Jun 19, 2019 at 7:42 AM Bin Meng <bmeng.cn@gmail.com> wrote:
>
> On Wed, Jun 19, 2019 at 10:30 PM Alistair Francis <alistair23@gmail.com> wrote:
> >
> > On Wed, Jun 19, 2019 at 7:26 AM Bin Meng <bmeng.cn@gmail.com> wrote:
> > >
> > > On Wed, Jun 19, 2019 at 8:56 AM Alistair Francis
> > > <alistair.francis@wdc.com> wrote:
> > > >
> > > > This is an RFC as it will break ALL current users! See below for details.
> > > >
> > > > This series consolidates the current RISC-V kernel loading
> > > > impelementation while also adding support for the -bios option and more
> > > > advanced kernel image types.
> > > >
> > > > After consolidating the kernel loading we can extend the boot loader to
> > > > support a -bios option. We can also extend the kernel loading options to
> > > > support not just ELF files but other standard formats.
> > > >
> > > > Finally we can include the OpenSBI firmware by default for QEMU users.
> > > >
> > > > At the end of this series we are in the good place of no longer
> > > > requiring users to build firmware to boot a kernel. Instead users can
> > > > just run QEMu with the -kernel option and everything will work. They can
> > >
> > > This is great. I like booting kernel directly for testing without
> > > bothering the firmware stuff.
> >
> > That's the goal! Now we just need to not break everything.
> >
> > >
> > > > also override the firmware with their own using the -bios option. Using
> > > > "-bios none" will result in no firmware being loaded (as it is today).
> > > >
> > > > !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> > > >
> > > > Unfortunately this series (patch 5 specifically) results in all current
> > > > Linux boots being broken as users are already loading in their own
> > > > firmware, which overlaps with the now included default. They will
> > > > see this error:
> > > >
> > > > rom: requested regions overlap (rom phdr #0: ./images/qemuriscv64/fw_jump.elf. free=0x0000000080008090, addr=0x0000000080000000)
> > > > qemu-system-riscv64: rom check and register reset failed
> > > >
> > > > If a current user specieifies "-bios none" their flow will continue
> > > > working. A user can instead no longer load their firmware and
> > > > use the default or they can load their firmware with the -bios option.
> > > >
> > > > At the moment the best idea I have to not break all users is to only
> > > > include the default firmware if the user specifies "-bios opensbi".
> > > > That is change the default to not loading the firmware. Then we can work
> > > > on updating documentation and maybe in future change the default to
> > > > include a firmware and anyone who doesn't want a default firmware can
> > > > specify "-bios none".
> > > >
> > > > Any other ideas on how to not break everything?
> > > >
> > > >
> > > >
> > > > Alistair Francis (5):
> > > > hw/riscv: Split out the boot functions
> > > > hw/riscv: Add support for loading a firmware
> > > > hw/riscv: Extend the kernel loading support
> > > > roms: Add OpenSBI version 0.3
> > > > hw/riscv: Load OpenSBI as the default firmware
> > > >
> > > > .gitmodules | 3 +
> > > > Makefile | 3 +-
> > > > configure | 1 +
> > > > hw/riscv/Makefile.objs | 1 +
> > > > hw/riscv/boot.c | 143 ++++++++++++++++++++++++++++
> > > > hw/riscv/sifive_e.c | 17 +---
> > > > hw/riscv/sifive_u.c | 19 +---
> > > > hw/riscv/spike.c | 21 +---
> > > > hw/riscv/virt.c | 54 ++---------
> > > > include/hw/riscv/boot.h | 30 ++++++
> > > > pc-bios/opensbi-riscv32-fw_jump.elf | Bin 0 -> 197988 bytes
> > > > pc-bios/opensbi-riscv64-fw_jump.elf | Bin 0 -> 200192 bytes
> > >
> > > Since we are considering adding "bios" images, I prefer to add the
> > > pure binary images instead of ELF images here.
> >
> > I didn't think about that. Can we just boot them in QEMU like we do
> > with the ELFs?
>
> Yes, use load_image_targphys() instead of load_elf().
Ah, that is obvious. I'll update it to use the bin files then.
Alistair
>
> Regards,
> Bin
next prev parent reply other threads:[~2019-06-19 18:36 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-19 0:38 [Qemu-devel] [RFC v1 0/5] RISC-V: Add firmware loading support and default Alistair Francis
2019-06-19 0:38 ` [Qemu-devel] [RFC v1 1/5] hw/riscv: Split out the boot functions Alistair Francis
2019-06-19 15:16 ` Bin Meng
2019-06-19 18:24 ` Alistair Francis
2019-06-19 0:38 ` [Qemu-devel] [RFC v1 2/5] hw/riscv: Add support for loading a firmware Alistair Francis
2019-06-19 15:16 ` Bin Meng
2019-06-19 15:25 ` [Qemu-devel] [Qemu-riscv] " Jonathan Behrens
2019-06-19 15:30 ` Bin Meng
2019-06-19 21:00 ` Alistair Francis
2019-06-19 0:38 ` [Qemu-devel] [RFC v1 3/5] hw/riscv: Extend the kernel loading support Alistair Francis
2019-06-19 15:16 ` Bin Meng
2019-06-19 21:01 ` Alistair Francis
2019-06-19 22:06 ` Alistair Francis
2019-06-19 0:38 ` [Qemu-devel] [RFC v1 4/5] roms: Add OpenSBI version 0.3 Alistair Francis
2019-06-19 5:14 ` [Qemu-devel] [Qemu-riscv] " Anup Patel
2019-06-19 15:18 ` Bin Meng
2019-06-19 18:27 ` Alistair Francis
2019-06-21 5:41 ` Bin Meng
2019-06-21 22:41 ` Alistair Francis
2019-06-19 0:38 ` [Qemu-devel] [RFC v1 5/5] hw/riscv: Load OpenSBI as the default firmware Alistair Francis
2019-06-19 5:16 ` [Qemu-devel] [Qemu-riscv] " Anup Patel
2019-06-19 14:26 ` [Qemu-devel] [RFC v1 0/5] RISC-V: Add firmware loading support and default Bin Meng
2019-06-19 14:29 ` Alistair Francis
2019-06-19 14:42 ` Bin Meng
2019-06-19 18:23 ` Alistair Francis [this message]
2019-06-20 8:16 ` [Qemu-devel] [Qemu-riscv] " Andrea Bolognani
2019-06-20 17:59 ` Alistair Francis
2019-06-20 18:43 ` David Abdurachmanov
2019-06-21 12:35 ` Andrea Bolognani
2019-06-27 13:49 ` Andrea Bolognani
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='CAKmqyKMmm-38DijX_wL=pAbvxzLQ+KSOtd1xg_GrT4Az70GKsw@mail.gmail.com' \
--to=alistair23@gmail.com \
--cc=alistair.francis@wdc.com \
--cc=bmeng.cn@gmail.com \
--cc=palmer@sifive.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).