Skip to contentSkip to conversation

qemu-options: bring the kernel and image options together

RFC PATCH Superseded Alex Bennée 3 participants 5 messages Jun 22, 2022 – Jun 28, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 qemu-options: bring the kernel and image options together

How to control the booting of QEMU is often a source of confusion for users. Bring the options that control this together in the manual pages and add some verbiage to describe when each option is appropriate.

Cc Cédric Le Goater <[email protected]>
---
 qemu-options.hx | 80 ++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 62 insertions(+), 18 deletions(-)
qemu-options.hx +62 -18
index 377d22fbd8..9b0242f0ef 100644
@@ -1585,13 +1585,6 @@ SRST
     Use file as SecureDigital card image.
 ERST
 
-DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
-    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
-SRST
-``-pflash file``
-    Use file as a parallel flash image.
-ERST
-
 DEF("snapshot", 0, QEMU_OPTION_snapshot,
     "-snapshot       write to temporary files instead of disk image files\n",
     QEMU_ARCH_ALL)
@@ -3680,12 +3673,51 @@ DEFHEADING()
 
 #endif
 
-DEFHEADING(Linux/Multiboot boot specific:)
+DEFHEADING(Boot Image or Kernel specific:)
+SRST
+There are broadly 4 ways you can boot a system with QEMU.
+
+ - specify a firmware and let it control finding a kernel
+ - specify a firmware and pass a hint to the kernel to boot
+ - direct kernel image boot
+ - manually load files into the guests address space
+
+The last method is useful for quickly testing kernels but as there is
+no firmware to pass configuration information to the kernel it must
+either be built for the exact configuration or be handed a DTB blob
+which tells the kernel what drivers it needs.
+
+ERST
+
+SRST
+
+For x86 machines ``-bios`` will generally do the right thing with
+whatever it is given. For non-x86 machines the more strict ``-pflash``
+option needs an image that is sized for the flash device for the given
+machine type.
+
+ERST
+
+DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
+    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
+SRST
+``-bios file``
+    Set the filename for the BIOS.
+ERST
+
+DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
+    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
+SRST
+``-pflash file``
+    Use file as a parallel flash image.
+ERST
+
 SRST
-When using these options, you can use a given Linux or Multiboot kernel
-without installing it in the disk image. It can be useful for easier
-testing of various kernels.
 
+The kernel options were designed to work with Linux kernels although
+other things (like hypervisors) can be packaged up as a kernel
+executable image. The exact format of a executable image is usually
+architecture specific.
 
 ERST
 
@@ -3725,6 +3757,25 @@ SRST
     kernel on boot.
 ERST
 
+SRST
+
+Finally you can also manually load images directly into the address
+space of the guest. This is most useful for developers who already
+know the layout of their guest and take care to ensure something sane
+will happen when the reset vector executes.
+
+The generic loader can be invoked by using the loader device:
+
+``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]``
+
+there is also the guest loader which operates in a similar way but
+tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where
+the guest image is:
+
+``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]``
+
+ERST
+
 DEFHEADING()
 
 DEFHEADING(Debug/Expert options:)
@@ -4175,13 +4226,6 @@ SRST
     To list all the data directories, use ``-L help``.
 ERST
 
-DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
-    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
-SRST
-``-bios file``
-    Set the filename for the BIOS.
-ERST
-
 DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
     "-enable-kvm     enable KVM full virtualization support\n",
     QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
Signature · 1 line
2.30.2
#1 lore raw
Quoted 36 lines · Alex Bennée

How to control the booting of QEMU is often a source of confusion for users. Bring the options that control this together in the manual pages and add some verbiage to describe when each option is appropriate.

Cc Cédric Le Goater <[email protected]>
---
  qemu-options.hx | 80 ++++++++++++++++++++++++++++++++++++++-----------
  1 file changed, 62 insertions(+), 18 deletions(-)
qemu-options.hx +3 -8
index 377d22fbd8..9b0242f0ef 100644
@@ -1585,13 +1585,6 @@ SRST
      Use file as SecureDigital card image.
  ERST
 
-DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
-    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
-SRST
-``-pflash file``
-    Use file as a parallel flash image.
-ERST
->   DEF("snapshot", 0, QEMU_OPTION_snapshot,
      "-snapshot       write to temporary files instead of disk image files\n",
      QEMU_ARCH_ALL)
@@ -3680,12 +3673,51 @@ DEFHEADING()
 
  #endif
 
-DEFHEADING(Linux/Multiboot boot specific:)
+DEFHEADING(Boot Image or Kernel specific:)
+SRST
+There are broadly 4 ways you can boot a system with QEMU.

qemu-options.hx DEFHEADING() · line 3688

Quoted 10 lines
qemu-options.hx +10 -0
+
+ - specify a firmware and let it control finding a kernel
+ - specify a firmware and pass a hint to the kernel to boot
+ - direct kernel image boot
+ - manually load files into the guests address space
+
+The last method is useful for quickly testing kernels but as there is
+no firmware to pass configuration information to the kernel it must
+either be built for the exact configuration or be handed a DTB blob
+which tells the kernel what drivers it needs.

The last method can also load any FW blob with the correct executable layout (reset vector).

qemu-options.hx DEFHEADING() · line 3697

Quoted 9 lines
qemu-options.hx +9 -0
+
+ERST
+
+SRST
+
+For x86 machines ``-bios`` will generally do the right thing with
+whatever it is given. For non-x86 machines the more strict ``-pflash``
+option needs an image that is sized for the flash device for the given
+machine type.

Some ppc machine use -bios also, mac, pseries, PowerNV (let's not restrict to x86).

LGTM.

Thanks,

C.

Quoted 67 lines
qemu-options.hx +39 -10
+
+ERST
+
+DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
+    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
+SRST
+``-bios file``
+    Set the filename for the BIOS.
+ERST
+
+DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
+    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
+SRST
+``-pflash file``
+    Use file as a parallel flash image.
+ERST
+
  SRST
-When using these options, you can use a given Linux or Multiboot kernel
-without installing it in the disk image. It can be useful for easier
-testing of various kernels.
 
+The kernel options were designed to work with Linux kernels although
+other things (like hypervisors) can be packaged up as a kernel
+executable image. The exact format of a executable image is usually
+architecture specific.
  ERST
 
@@ -3725,6 +3757,25 @@ SRST
      kernel on boot.
  ERST
 
+SRST
+
+Finally you can also manually load images directly into the address
+space of the guest. This is most useful for developers who already
+know the layout of their guest and take care to ensure something sane
+will happen when the reset vector executes.
+
+The generic loader can be invoked by using the loader device:
+
+``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]``
+
+there is also the guest loader which operates in a similar way but
+tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where
+the guest image is:
+
+``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]``
+ERST
+
  DEFHEADING()
 
  DEFHEADING(Debug/Expert options:)
@@ -4175,13 +4226,6 @@ SRST
      To list all the data directories, use ``-L help``.
  ERST
 
-DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
-    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
-SRST
-``-bios file``
-    Set the filename for the BIOS.
-ERST
-
  DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
      "-enable-kvm     enable KVM full virtualization support\n",
      QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
#2 lore raw
Quoted 37 lines · Cédric Le Goater
Quoted 36 lines · Alex Bennée

How to control the booting of QEMU is often a source of confusion for users. Bring the options that control this together in the manual pages and add some verbiage to describe when each option is appropriate.

Cc Cédric Le Goater <[email protected]>
---
  qemu-options.hx | 80 ++++++++++++++++++++++++++++++++++++++-----------
  1 file changed, 62 insertions(+), 18 deletions(-)
qemu-options.hx +8 -6
index 377d22fbd8..9b0242f0ef 100644
@@ -1585,13 +1585,6 @@ SRST
      Use file as SecureDigital card image.
  ERST
  -DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
-    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
-SRST
-``-pflash file``
-    Use file as a parallel flash image.
-ERST
->   DEF("snapshot", 0, QEMU_OPTION_snapshot,
      "-snapshot       write to temporary files instead of disk image files\n",
      QEMU_ARCH_ALL)
@@ -3680,12 +3673,51 @@ DEFHEADING()
    #endif
  -DEFHEADING(Linux/Multiboot boot specific:)
+DEFHEADING(Boot Image or Kernel specific:)
+SRST
+There are broadly 4 ways you can boot a system with QEMU.
+
+ - specify a firmware and let it control finding a kernel
+ - specify a firmware and pass a hint to the kernel to boot
+ - direct kernel image boot
+ - manually load files into the guests address space
Quoted 8 lines

qemu-options.hx DEFHEADING() · line 3688

Quoted 5 lines
qemu-options.hx +5 -0
+
+The last method is useful for quickly testing kernels but as there is
+no firmware to pass configuration information to the kernel it must
+either be built for the exact configuration or be handed a DTB blob
+which tells the kernel what drivers it needs.

The last method can also load any FW blob with the correct executable layout (reset vector).

Heh - actually I wrote that paragraph for the direct kernel image boot and then added the manual option after the fact. I'll try and clean that up to make it clearer.

Quoted 13 lines

qemu-options.hx DEFHEADING() · line 3697

Quoted 10 lines
qemu-options.hx +9 -0
+
+ERST
+
+SRST
+
+For x86 machines ``-bios`` will generally do the right thing with
+whatever it is given. For non-x86 machines the more strict ``-pflash``
+option needs an image that is sized for the flash device for the given
+machine type.

Some ppc machine use -bios also, mac, pseries, PowerNV (let's not restrict to x86).

Ahh the magic some ;-) Does it essentially rely on if the correct plumbing has been done for the machine? Anything I can look for to audit other machine types?

Quoted 72 lines

LGTM.

Thanks,

C.

Quoted 63 lines
qemu-options.hx +17 -3
+
+ERST
+
+DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
+    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
+SRST
+``-bios file``
+    Set the filename for the BIOS.
+ERST
+
+DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
+    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
+SRST
+``-pflash file``
+    Use file as a parallel flash image.
+ERST
+
  SRST
-When using these options, you can use a given Linux or Multiboot kernel
-without installing it in the disk image. It can be useful for easier
-testing of various kernels.
  +The kernel options were designed to work with Linux kernels

although

qemu-options.hx +20 -6
+other things (like hypervisors) can be packaged up as a kernel
+executable image. The exact format of a executable image is usually
+architecture specific.
  ERST
  @@ -3725,6 +3757,25 @@ SRST
      kernel on boot.
  ERST
  +SRST
+
+Finally you can also manually load images directly into the address
+space of the guest. This is most useful for developers who already
+know the layout of their guest and take care to ensure something sane
+will happen when the reset vector executes.
+
+The generic loader can be invoked by using the loader device:
+
+``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]``
+
+there is also the guest loader which operates in a similar way but
+tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where
+the guest image is:
+
+``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]``
+ERST
+
  DEFHEADING()
    DEFHEADING(Debug/Expert options:)
@@ -4175,13 +4226,6 @@ SRST
      To list all the data directories, use ``-L help``.
  ERST
  -DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
-    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
-SRST
-``-bios file``
-    Set the filename for the BIOS.
-ERST
-
  DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
      "-enable-kvm     enable KVM full virtualization support\n",
      QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
Signature · 1 line
Alex Bennée
#3 lore raw
Quoted 67 lines · Alex Bennée
Quoted 37 lines · Cédric Le Goater
Quoted 36 lines · Alex Bennée

How to control the booting of QEMU is often a source of confusion for users. Bring the options that control this together in the manual pages and add some verbiage to describe when each option is appropriate.

Cc Cédric Le Goater <[email protected]>
---
   qemu-options.hx | 80 ++++++++++++++++++++++++++++++++++++++-----------
   1 file changed, 62 insertions(+), 18 deletions(-)
qemu-options.hx +8 -6
index 377d22fbd8..9b0242f0ef 100644
@@ -1585,13 +1585,6 @@ SRST
       Use file as SecureDigital card image.
   ERST
   -DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
-    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
-SRST
-``-pflash file``
-    Use file as a parallel flash image.
-ERST
->   DEF("snapshot", 0, QEMU_OPTION_snapshot,
       "-snapshot       write to temporary files instead of disk image files\n",
       QEMU_ARCH_ALL)
@@ -3680,12 +3673,51 @@ DEFHEADING()
     #endif
   -DEFHEADING(Linux/Multiboot boot specific:)
+DEFHEADING(Boot Image or Kernel specific:)
+SRST
+There are broadly 4 ways you can boot a system with QEMU.
+
+ - specify a firmware and let it control finding a kernel
+ - specify a firmware and pass a hint to the kernel to boot
+ - direct kernel image boot
+ - manually load files into the guests address space
Quoted 8 lines

qemu-options.hx DEFHEADING() · line 3688

Quoted 5 lines
qemu-options.hx +5 -0
+
+The last method is useful for quickly testing kernels but as there is
+no firmware to pass configuration information to the kernel it must
+either be built for the exact configuration or be handed a DTB blob
+which tells the kernel what drivers it needs.

The last method can also load any FW blob with the correct executable layout (reset vector).

Heh - actually I wrote that paragraph for the direct kernel image boot and then added the manual option after the fact. I'll try and clean that up to make it clearer.

Quoted 13 lines

qemu-options.hx DEFHEADING() · line 3697

Quoted 10 lines
qemu-options.hx +9 -0
+
+ERST
+
+SRST
+
+For x86 machines ``-bios`` will generally do the right thing with
+whatever it is given. For non-x86 machines the more strict ``-pflash``
+option needs an image that is sized for the flash device for the given
+machine type.

Some ppc machine use -bios also, mac, pseries, PowerNV (let's not restrict to x86).

Quoted 2 lines

Ahh the magic some ;-) Does it essentially rely on if the correct plumbing has been done for the machine?

They rely on finding a reset vector. So yes, the FW should be mapped where it is expected and have vectors. The machines also know how to expose kernel/initrd to the FW and the FWs have runtime services. It's more than a kernel loader.

Quoted 1 line

Anything I can look for to audit other machine types?

Good question. There are some many ways to start a machine.

The avocado tests should be a good reference and here is a little tool I use to verify that the PPC machines supported in QEMU boot correctly :

https://github.com/legoater/qemu-ppc-boot/blob/main/ppc-boot.sh

Sometime ago, I did a model for a MicroWatt SoC, a POWER9 FPGA implementation, and I found quite a few ways to boot from some blob. See :

https://github.com/qemu/qemu/commit/2f43989f87332c226358c1f3ef7b96d94ba342ca

I guess when FW runtime services are required so is -bios. Else all these options :

-kernel
-bios
-device loader
-drive <flash>

can be used more or less in the same way.

Thanks,

C.

Quoted 75 lines
Quoted 73 lines

LGTM.

Thanks,

C.

Quoted 63 lines
qemu-options.hx +17 -3
+
+ERST
+
+DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
+    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
+SRST
+``-bios file``
+    Set the filename for the BIOS.
+ERST
+
+DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
+    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
+SRST
+``-pflash file``
+    Use file as a parallel flash image.
+ERST
+
   SRST
-When using these options, you can use a given Linux or Multiboot kernel
-without installing it in the disk image. It can be useful for easier
-testing of various kernels.
   +The kernel options were designed to work with Linux kernels

although

qemu-options.hx +20 -6
+other things (like hypervisors) can be packaged up as a kernel
+executable image. The exact format of a executable image is usually
+architecture specific.
   ERST
   @@ -3725,6 +3757,25 @@ SRST
       kernel on boot.
   ERST
   +SRST
+
+Finally you can also manually load images directly into the address
+space of the guest. This is most useful for developers who already
+know the layout of their guest and take care to ensure something sane
+will happen when the reset vector executes.
+
+The generic loader can be invoked by using the loader device:
+
+``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]``
+
+there is also the guest loader which operates in a similar way but
+tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where
+the guest image is:
+
+``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]``
+ERST
+
   DEFHEADING()
     DEFHEADING(Debug/Expert options:)
@@ -4175,13 +4226,6 @@ SRST
       To list all the data directories, use ``-L help``.
   ERST
   -DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
-    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
-SRST
-``-bios file``
-    Set the filename for the BIOS.
-ERST
-
   DEF("enable-kvm", 0, QEMU_OPTION_enable_kvm, \
       "-enable-kvm     enable KVM full virtualization support\n",
       QEMU_ARCH_ARM | QEMU_ARCH_I386 | QEMU_ARCH_MIPS | QEMU_ARCH_PPC |
#4 lore raw
In reply to Alex Bennée
Quoted 5 lines · Alex Bennée

How to control the booting of QEMU is often a source of confusion for users. Bring the options that control this together in the manual pages and add some verbiage to describe when each option is appropriate.

https://stackoverflow.com/a/58434837/4499941 is my answer to this common user question, though it's a bit more conversational in tone than we want for the manual :-)

Quoted 27 lines
Cc Cédric Le Goater <[email protected]>
---
 qemu-options.hx | 80 ++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 62 insertions(+), 18 deletions(-)
qemu-options.hx +0 -7
index 377d22fbd8..9b0242f0ef 100644
@@ -1585,13 +1585,6 @@ SRST
     Use file as SecureDigital card image.
 ERST
 
-DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
-    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
-SRST
-``-pflash file``
-    Use file as a parallel flash image.
-ERST
-
 DEF("snapshot", 0, QEMU_OPTION_snapshot,
     "-snapshot       write to temporary files instead of disk image files\n",
     QEMU_ARCH_ALL)
@@ -3680,12 +3673,51 @@ DEFHEADING()
 
 #endif

qemu-options.hx DEFHEADING() · line 3683

Quoted 10 lines
qemu-options.hx +8 -1
 
-DEFHEADING(Linux/Multiboot boot specific:)
+DEFHEADING(Boot Image or Kernel specific:)
+SRST
+There are broadly 4 ways you can boot a system with QEMU.
+
+ - specify a firmware and let it control finding a kernel
+ - specify a firmware and pass a hint to the kernel to boot
+ - direct kernel image boot
+ - manually load files into the guests address space

"guest's"

qemu-options.hx DEFHEADING() · line 3685

Quoted 2 lines
qemu-options.hx +2 -0
+
+The last method

Do you mean the third method? The last method isn't usually used to load kernels, but rather bare-metal binaries.

is useful for quickly testing kernels but as there is

qemu-options.hx DEFHEADING() · line 3688

Quoted 3 lines
qemu-options.hx +3 -0
+no firmware to pass configuration information to the kernel it must
+either be built for the exact configuration or be handed a DTB blob
+which tells the kernel what drivers it needs.

This is all somewhat architecture specific: you don't necessarily need to do either of those if the hardware is probeable.

You should also mention that all of this is board specific.

qemu-options.hx DEFHEADING() · line 3697

Quoted 9 lines
qemu-options.hx +9 -0
+
+ERST
+
+SRST
+
+For x86 machines ``-bios`` will generally do the right thing with
+whatever it is given. For non-x86 machines the more strict ``-pflash``
+option needs an image that is sized for the flash device for the given
+machine type.

-bios works for some non-x86 machine types too.

Ideally we would:
* have all our machine types have some documentation
* have the documentation for each machine type say whether it supports -bios or not, and what it does

Quoted 30 lines
qemu-options.hx +21 -3
+
+ERST
+
+DEF("bios", HAS_ARG, QEMU_OPTION_bios, \
+    "-bios file      set the filename for the BIOS\n", QEMU_ARCH_ALL)
+SRST
+``-bios file``
+    Set the filename for the BIOS.
+ERST
+
+DEF("pflash", HAS_ARG, QEMU_OPTION_pflash,
+    "-pflash file    use 'file' as a parallel flash image\n", QEMU_ARCH_ALL)
+SRST
+``-pflash file``
+    Use file as a parallel flash image.
+ERST
+
 SRST
-When using these options, you can use a given Linux or Multiboot kernel
-without installing it in the disk image. It can be useful for easier
-testing of various kernels.
 
+The kernel options were designed to work with Linux kernels although
+other things (like hypervisors) can be packaged up as a kernel
+executable image. The exact format of a executable image is usually
+architecture specific.
 
 ERST
 

qemu-options.hx SRST · line 3765

Quoted 9 lines
qemu-options.hx +6 -0
@@ -3725,6 +3757,25 @@ SRST
     kernel on boot.
 ERST
 
+SRST
+
+Finally you can also manually load images directly into the address
+space of the guest. This is most useful for developers who already
+know the layout of their guest and take care to ensure something sane
+will happen when the reset vector executes.

We should say that this is the favoured option for "I want to run a bare-metal binary", and we should also say that this option works the same way on any architecture and machine.

Quoted 4 lines
qemu-options.hx +4 -0
+
+The generic loader can be invoked by using the loader device:
+
+``-device loader,addr=<addr>,data=<data>,data-len=<data-len>[,data-be=<data-be>][,cpu-num=<cpu-num>]``

qemu-options.hx SRST · line 3779

Quoted 10 lines
qemu-options.hx +9 -0
+
+there is also the guest loader which operates in a similar way but
+tweaks the DTB so a hypervisor loaded via ``-kernel`` can find where
+the guest image is:
+
+``-device guest-loader,addr=<addr>[,kernel=<path>,[bootargs=<arguments>]][,initrd=<path>]``
+
+ERST
+
 DEFHEADING()

thanks
-- PMM