All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] RISC-V: Include ROM in QEMU
@ 2019-06-06 23:22 ` Alistair Francis
  0 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-06-06 23:22 UTC (permalink / raw)
  To: qemu-devel@nongnu.org Developers
  Cc: open list:RISC-V, Sagar Karandikar, onathan, Bastian Koppelmann,
	Palmer Dabbelt, Alistair Francis

Hello,

As a test of the waters, how would the QEMU community feel about
including the RISC-V OpenSBI project as a ROM submodule?

The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
for x86) included by default to simplify the QEMU RISC-V boot process
for users. This would remove the requirement for users/developers to
build a RISC-V firmware. The goal here is to allow people to just
download and run their kernel as easily as they currently do for x86.

We would make sure that it can be disabled! That is users/developers
can use their own (or none) if they want to. The idea here is just to
simplify the boot process, not lock anyone out.

Alistair


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Qemu-riscv] RISC-V: Include ROM in QEMU
@ 2019-06-06 23:22 ` Alistair Francis
  0 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-06-06 23:22 UTC (permalink / raw)
  To: qemu-devel@nongnu.org Developers
  Cc: open list:RISC-V, Sagar Karandikar, Bastian Koppelmann,
	Palmer Dabbelt, Alistair Francis, onathan

Hello,

As a test of the waters, how would the QEMU community feel about
including the RISC-V OpenSBI project as a ROM submodule?

The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
for x86) included by default to simplify the QEMU RISC-V boot process
for users. This would remove the requirement for users/developers to
build a RISC-V firmware. The goal here is to allow people to just
download and run their kernel as easily as they currently do for x86.

We would make sure that it can be disabled! That is users/developers
can use their own (or none) if they want to. The idea here is just to
simplify the boot process, not lock anyone out.

Alistair


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] RISC-V: Include ROM in QEMU
  2019-06-06 23:22 ` [Qemu-riscv] " Alistair Francis
@ 2019-06-08  0:03   ` Palmer Dabbelt
  -1 siblings, 0 replies; 12+ messages in thread
From: Palmer Dabbelt @ 2019-06-08  0:03 UTC (permalink / raw)
  To: alistair23
  Cc: qemu-riscv, sagark, onathan, Bastian Koppelmann, qemu-devel,
	Alistair Francis

On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> Hello,
>
> As a test of the waters, how would the QEMU community feel about
> including the RISC-V OpenSBI project as a ROM submodule?
>
> The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> for x86) included by default to simplify the QEMU RISC-V boot process
> for users. This would remove the requirement for users/developers to
> build a RISC-V firmware. The goal here is to allow people to just
> download and run their kernel as easily as they currently do for x86.
>
> We would make sure that it can be disabled! That is users/developers
> can use their own (or none) if they want to. The idea here is just to
> simplify the boot process, not lock anyone out.

I like it.  My only question is about the mechanics of doing so: are we just
going to assume there's a cross compiler in PATH?  I guess that's less of a
usability headache than needing a complier and a firmware.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-riscv] RISC-V: Include ROM in QEMU
@ 2019-06-08  0:03   ` Palmer Dabbelt
  0 siblings, 0 replies; 12+ messages in thread
From: Palmer Dabbelt @ 2019-06-08  0:03 UTC (permalink / raw)
  To: alistair23
  Cc: qemu-devel, qemu-riscv, sagark, Bastian Koppelmann,
	Alistair Francis, onathan

On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> Hello,
>
> As a test of the waters, how would the QEMU community feel about
> including the RISC-V OpenSBI project as a ROM submodule?
>
> The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> for x86) included by default to simplify the QEMU RISC-V boot process
> for users. This would remove the requirement for users/developers to
> build a RISC-V firmware. The goal here is to allow people to just
> download and run their kernel as easily as they currently do for x86.
>
> We would make sure that it can be disabled! That is users/developers
> can use their own (or none) if they want to. The idea here is just to
> simplify the boot process, not lock anyone out.

I like it.  My only question is about the mechanics of doing so: are we just
going to assume there's a cross compiler in PATH?  I guess that's less of a
usability headache than needing a complier and a firmware.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] RISC-V: Include ROM in QEMU
  2019-06-08  0:03   ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-11  6:30     ` Gerd Hoffmann
  -1 siblings, 0 replies; 12+ messages in thread
From: Gerd Hoffmann @ 2019-06-11  6:30 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: qemu-riscv, sagark, onathan, Bastian Koppelmann, qemu-devel,
	Alistair Francis, alistair23

On Fri, Jun 07, 2019 at 05:03:42PM -0700, Palmer Dabbelt wrote:
> On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> > Hello,
> > 
> > As a test of the waters, how would the QEMU community feel about
> > including the RISC-V OpenSBI project as a ROM submodule?
> > 
> > The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> > for x86) included by default to simplify the QEMU RISC-V boot process
> > for users. This would remove the requirement for users/developers to
> > build a RISC-V firmware. The goal here is to allow people to just
> > download and run their kernel as easily as they currently do for x86.
> > 
> > We would make sure that it can be disabled! That is users/developers
> > can use their own (or none) if they want to. The idea here is just to
> > simplify the boot process, not lock anyone out.
> 
> I like it.  My only question is about the mechanics of doing so: are we just
> going to assume there's a cross compiler in PATH?  I guess that's less of a
> usability headache than needing a complier and a firmware.

Usual way to add firmware:

  (1) Add a submodule below roms/
  (2) Add rules to build the firmware to roms/Makefile.  Firmware
      maintainers can use them, and they also document the build process.
      A normal qemu build will not automatically build the firmware
      though.
  (3) Place a pre-built binary in pc-bios/

There is some cross compiler detection logic in roms/Makefile which you
can use.

cheers,
  Gerd



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-riscv] [Qemu-devel] RISC-V: Include ROM in QEMU
@ 2019-06-11  6:30     ` Gerd Hoffmann
  0 siblings, 0 replies; 12+ messages in thread
From: Gerd Hoffmann @ 2019-06-11  6:30 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: alistair23, qemu-riscv, sagark, onathan, Bastian Koppelmann,
	qemu-devel, Alistair Francis

On Fri, Jun 07, 2019 at 05:03:42PM -0700, Palmer Dabbelt wrote:
> On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> > Hello,
> > 
> > As a test of the waters, how would the QEMU community feel about
> > including the RISC-V OpenSBI project as a ROM submodule?
> > 
> > The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> > for x86) included by default to simplify the QEMU RISC-V boot process
> > for users. This would remove the requirement for users/developers to
> > build a RISC-V firmware. The goal here is to allow people to just
> > download and run their kernel as easily as they currently do for x86.
> > 
> > We would make sure that it can be disabled! That is users/developers
> > can use their own (or none) if they want to. The idea here is just to
> > simplify the boot process, not lock anyone out.
> 
> I like it.  My only question is about the mechanics of doing so: are we just
> going to assume there's a cross compiler in PATH?  I guess that's less of a
> usability headache than needing a complier and a firmware.

Usual way to add firmware:

  (1) Add a submodule below roms/
  (2) Add rules to build the firmware to roms/Makefile.  Firmware
      maintainers can use them, and they also document the build process.
      A normal qemu build will not automatically build the firmware
      though.
  (3) Place a pre-built binary in pc-bios/

There is some cross compiler detection logic in roms/Makefile which you
can use.

cheers,
  Gerd



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] RISC-V: Include ROM in QEMU
  2019-06-08  0:03   ` [Qemu-riscv] " Palmer Dabbelt
@ 2019-06-18 22:17     ` Alistair Francis
  -1 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-06-18 22:17 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: open list:RISC-V, Sagar Karandikar, onathan, Bastian Koppelmann,
	qemu-devel@nongnu.org Developers, Alistair Francis

On Fri, Jun 7, 2019 at 5:03 PM Palmer Dabbelt <palmer@sifive.com> wrote:
>
> On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> > Hello,
> >
> > As a test of the waters, how would the QEMU community feel about
> > including the RISC-V OpenSBI project as a ROM submodule?
> >
> > The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> > for x86) included by default to simplify the QEMU RISC-V boot process
> > for users. This would remove the requirement for users/developers to
> > build a RISC-V firmware. The goal here is to allow people to just
> > download and run their kernel as easily as they currently do for x86.
> >
> > We would make sure that it can be disabled! That is users/developers
> > can use their own (or none) if they want to. The idea here is just to
> > simplify the boot process, not lock anyone out.
>
> I like it.  My only question is about the mechanics of doing so: are we just
> going to assume there's a cross compiler in PATH?  I guess that's less of a
> usability headache than needing a complier and a firmware.

It looks like we will include a binary in the QEMU source and also
provide the option for users to compile it themselves.

Alistair


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-riscv] RISC-V: Include ROM in QEMU
@ 2019-06-18 22:17     ` Alistair Francis
  0 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-06-18 22:17 UTC (permalink / raw)
  To: Palmer Dabbelt
  Cc: qemu-devel@nongnu.org Developers, open list:RISC-V,
	Sagar Karandikar, Bastian Koppelmann, Alistair Francis, onathan

On Fri, Jun 7, 2019 at 5:03 PM Palmer Dabbelt <palmer@sifive.com> wrote:
>
> On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> > Hello,
> >
> > As a test of the waters, how would the QEMU community feel about
> > including the RISC-V OpenSBI project as a ROM submodule?
> >
> > The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> > for x86) included by default to simplify the QEMU RISC-V boot process
> > for users. This would remove the requirement for users/developers to
> > build a RISC-V firmware. The goal here is to allow people to just
> > download and run their kernel as easily as they currently do for x86.
> >
> > We would make sure that it can be disabled! That is users/developers
> > can use their own (or none) if they want to. The idea here is just to
> > simplify the boot process, not lock anyone out.
>
> I like it.  My only question is about the mechanics of doing so: are we just
> going to assume there's a cross compiler in PATH?  I guess that's less of a
> usability headache than needing a complier and a firmware.

It looks like we will include a binary in the QEMU source and also
provide the option for users to compile it themselves.

Alistair


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] RISC-V: Include ROM in QEMU
  2019-06-11  6:30     ` [Qemu-riscv] " Gerd Hoffmann
@ 2019-06-18 22:17       ` Alistair Francis
  -1 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-06-18 22:17 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: open list:RISC-V, Sagar Karandikar, onathan, Bastian Koppelmann,
	Palmer Dabbelt, qemu-devel@nongnu.org Developers,
	Alistair Francis

On Mon, Jun 10, 2019 at 11:30 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Fri, Jun 07, 2019 at 05:03:42PM -0700, Palmer Dabbelt wrote:
> > On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> > > Hello,
> > >
> > > As a test of the waters, how would the QEMU community feel about
> > > including the RISC-V OpenSBI project as a ROM submodule?
> > >
> > > The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> > > for x86) included by default to simplify the QEMU RISC-V boot process
> > > for users. This would remove the requirement for users/developers to
> > > build a RISC-V firmware. The goal here is to allow people to just
> > > download and run their kernel as easily as they currently do for x86.
> > >
> > > We would make sure that it can be disabled! That is users/developers
> > > can use their own (or none) if they want to. The idea here is just to
> > > simplify the boot process, not lock anyone out.
> >
> > I like it.  My only question is about the mechanics of doing so: are we just
> > going to assume there's a cross compiler in PATH?  I guess that's less of a
> > usability headache than needing a complier and a firmware.
>
> Usual way to add firmware:
>
>   (1) Add a submodule below roms/
>   (2) Add rules to build the firmware to roms/Makefile.  Firmware
>       maintainers can use them, and they also document the build process.
>       A normal qemu build will not automatically build the firmware
>       though.
>   (3) Place a pre-built binary in pc-bios/
>
> There is some cross compiler detection logic in roms/Makefile which you
> can use.

Thanks for the info. I have it all working now, just running a few
more tests. I will send my patches out today or tomorrow.

Alistair

>
> cheers,
>   Gerd
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-riscv] [Qemu-devel] RISC-V: Include ROM in QEMU
@ 2019-06-18 22:17       ` Alistair Francis
  0 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-06-18 22:17 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Palmer Dabbelt, open list:RISC-V, Sagar Karandikar, onathan,
	Bastian Koppelmann, qemu-devel@nongnu.org Developers,
	Alistair Francis

On Mon, Jun 10, 2019 at 11:30 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
>
> On Fri, Jun 07, 2019 at 05:03:42PM -0700, Palmer Dabbelt wrote:
> > On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> > > Hello,
> > >
> > > As a test of the waters, how would the QEMU community feel about
> > > including the RISC-V OpenSBI project as a ROM submodule?
> > >
> > > The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> > > for x86) included by default to simplify the QEMU RISC-V boot process
> > > for users. This would remove the requirement for users/developers to
> > > build a RISC-V firmware. The goal here is to allow people to just
> > > download and run their kernel as easily as they currently do for x86.
> > >
> > > We would make sure that it can be disabled! That is users/developers
> > > can use their own (or none) if they want to. The idea here is just to
> > > simplify the boot process, not lock anyone out.
> >
> > I like it.  My only question is about the mechanics of doing so: are we just
> > going to assume there's a cross compiler in PATH?  I guess that's less of a
> > usability headache than needing a complier and a firmware.
>
> Usual way to add firmware:
>
>   (1) Add a submodule below roms/
>   (2) Add rules to build the firmware to roms/Makefile.  Firmware
>       maintainers can use them, and they also document the build process.
>       A normal qemu build will not automatically build the firmware
>       though.
>   (3) Place a pre-built binary in pc-bios/
>
> There is some cross compiler detection logic in roms/Makefile which you
> can use.

Thanks for the info. I have it all working now, just running a few
more tests. I will send my patches out today or tomorrow.

Alistair

>
> cheers,
>   Gerd
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-devel] RISC-V: Include ROM in QEMU
  2019-06-18 22:17       ` [Qemu-riscv] " Alistair Francis
@ 2019-06-19 14:27         ` Alistair Francis
  -1 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-06-19 14:27 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: open list:RISC-V, Sagar Karandikar, onathan, Bastian Koppelmann,
	Palmer Dabbelt, qemu-devel@nongnu.org Developers,
	Alistair Francis

On Tue, Jun 18, 2019 at 3:17 PM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Mon, Jun 10, 2019 at 11:30 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > On Fri, Jun 07, 2019 at 05:03:42PM -0700, Palmer Dabbelt wrote:
> > > On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> > > > Hello,
> > > >
> > > > As a test of the waters, how would the QEMU community feel about
> > > > including the RISC-V OpenSBI project as a ROM submodule?
> > > >
> > > > The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> > > > for x86) included by default to simplify the QEMU RISC-V boot process
> > > > for users. This would remove the requirement for users/developers to
> > > > build a RISC-V firmware. The goal here is to allow people to just
> > > > download and run their kernel as easily as they currently do for x86.
> > > >
> > > > We would make sure that it can be disabled! That is users/developers
> > > > can use their own (or none) if they want to. The idea here is just to
> > > > simplify the boot process, not lock anyone out.
> > >
> > > I like it.  My only question is about the mechanics of doing so: are we just
> > > going to assume there's a cross compiler in PATH?  I guess that's less of a
> > > usability headache than needing a complier and a firmware.
> >
> > Usual way to add firmware:
> >
> >   (1) Add a submodule below roms/
> >   (2) Add rules to build the firmware to roms/Makefile.  Firmware
> >       maintainers can use them, and they also document the build process.
> >       A normal qemu build will not automatically build the firmware
> >       though.
> >   (3) Place a pre-built binary in pc-bios/
> >
> > There is some cross compiler detection logic in roms/Makefile which you
> > can use.
>
> Thanks for the info. I have it all working now, just running a few
> more tests. I will send my patches out today or tomorrow.

We hit the problem in RISC-V now that including a firmware by default
will break all existing users as they are already passing the firmware
in via -kernel.

I don't suppose any other architecture ever had this problem and has a
nice fix? At the moment the only fix I can think of is only include
the default firmware if the user specifies "-bios default". Then
hopefully once everyone is doing that we can make it the default and
not break anything. I can't see a sane way to automatically extract
the information from the kernel binary to be smart about the default.

Alistair

>
> Alistair
>
> >
> > cheers,
> >   Gerd
> >


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Qemu-riscv] [Qemu-devel] RISC-V: Include ROM in QEMU
@ 2019-06-19 14:27         ` Alistair Francis
  0 siblings, 0 replies; 12+ messages in thread
From: Alistair Francis @ 2019-06-19 14:27 UTC (permalink / raw)
  To: Gerd Hoffmann
  Cc: Palmer Dabbelt, open list:RISC-V, Sagar Karandikar, onathan,
	Bastian Koppelmann, qemu-devel@nongnu.org Developers,
	Alistair Francis

On Tue, Jun 18, 2019 at 3:17 PM Alistair Francis <alistair23@gmail.com> wrote:
>
> On Mon, Jun 10, 2019 at 11:30 PM Gerd Hoffmann <kraxel@redhat.com> wrote:
> >
> > On Fri, Jun 07, 2019 at 05:03:42PM -0700, Palmer Dabbelt wrote:
> > > On Thu, 06 Jun 2019 16:22:47 PDT (-0700), alistair23@gmail.com wrote:
> > > > Hello,
> > > >
> > > > As a test of the waters, how would the QEMU community feel about
> > > > including the RISC-V OpenSBI project as a ROM submodule?
> > > >
> > > > The idea would be to have OpenSBI (similar to ATF for ARM and a BIOS
> > > > for x86) included by default to simplify the QEMU RISC-V boot process
> > > > for users. This would remove the requirement for users/developers to
> > > > build a RISC-V firmware. The goal here is to allow people to just
> > > > download and run their kernel as easily as they currently do for x86.
> > > >
> > > > We would make sure that it can be disabled! That is users/developers
> > > > can use their own (or none) if they want to. The idea here is just to
> > > > simplify the boot process, not lock anyone out.
> > >
> > > I like it.  My only question is about the mechanics of doing so: are we just
> > > going to assume there's a cross compiler in PATH?  I guess that's less of a
> > > usability headache than needing a complier and a firmware.
> >
> > Usual way to add firmware:
> >
> >   (1) Add a submodule below roms/
> >   (2) Add rules to build the firmware to roms/Makefile.  Firmware
> >       maintainers can use them, and they also document the build process.
> >       A normal qemu build will not automatically build the firmware
> >       though.
> >   (3) Place a pre-built binary in pc-bios/
> >
> > There is some cross compiler detection logic in roms/Makefile which you
> > can use.
>
> Thanks for the info. I have it all working now, just running a few
> more tests. I will send my patches out today or tomorrow.

We hit the problem in RISC-V now that including a firmware by default
will break all existing users as they are already passing the firmware
in via -kernel.

I don't suppose any other architecture ever had this problem and has a
nice fix? At the moment the only fix I can think of is only include
the default firmware if the user specifies "-bios default". Then
hopefully once everyone is doing that we can make it the default and
not break anything. I can't see a sane way to automatically extract
the information from the kernel binary to be smart about the default.

Alistair

>
> Alistair
>
> >
> > cheers,
> >   Gerd
> >


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-06-19 14:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-06 23:22 [Qemu-devel] RISC-V: Include ROM in QEMU Alistair Francis
2019-06-06 23:22 ` [Qemu-riscv] " Alistair Francis
2019-06-08  0:03 ` [Qemu-devel] " Palmer Dabbelt
2019-06-08  0:03   ` [Qemu-riscv] " Palmer Dabbelt
2019-06-11  6:30   ` [Qemu-devel] " Gerd Hoffmann
2019-06-11  6:30     ` [Qemu-riscv] " Gerd Hoffmann
2019-06-18 22:17     ` Alistair Francis
2019-06-18 22:17       ` [Qemu-riscv] " Alistair Francis
2019-06-19 14:27       ` Alistair Francis
2019-06-19 14:27         ` [Qemu-riscv] " Alistair Francis
2019-06-18 22:17   ` Alistair Francis
2019-06-18 22:17     ` [Qemu-riscv] " Alistair Francis

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.