Skip to contentSkip to conversation

docs: deprecate RISC-V default machine option

PATCH Applied Daniel Henrique Barboza 4 participants 6 messages Apr 4, 2025 – Apr 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 docs: deprecate RISC-V default machine option

Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and made it default for qemu-system-riscv32/64. It was the first RISC-V machine added in QEMU so setting it as default was sensible.

Today we have 7 riscv64 and 6 riscv32 machines and having 'spike' as default machine is not intuitive. For example, [1] is a bug that was opened with the 'virt' board in mind, but given that the user didn't pass a '-machine' option, the user was using 'spike' without knowing.

Being explicit in the command line is desirable when we have a handful of boards available, so deprecate the default machine setting from RISC-V.

[1] https://gitlab.com/qemu-project/qemu/-/issues/2467

---
 docs/about/deprecated.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
docs/about/deprecated.rst +17 -0
index 76291fdfd6..0f41a99c67 100644
@@ -304,6 +304,23 @@ online to check that this board did not completely bitrot yet). It is
 recommended to use another MIPS machine for future MIPS code development
 instead.
 
+RISC-V default machine option (since 10.0)
+''''''''''''''''''''''''''''''''''''''''''
+
+RISC-V defines ``spike`` as the default machine if no machine option is
+given in the command line.  This happens because ``spike`` is the first
+RISC-V machine implemented in QEMU and setting it as default was
+convenient at that time.  Now we have 7 riscv64 and 6 riscv32 machines
+and having ``spike`` as a default is no longer justified.  This default
+will also promote situations where users think they're running ``virt``
+(the most used RISC-V machine type in 10.0) when in fact they're
+running ``spike``.
+
+Removing the default machine option forces users to always set the machine
+they want to use and avoids confusion.  Existing users of the ``spike``
+machine must ensure that they're setting the ``spike`` machine in the
+command line (``-M spike``).
+
 
 Backend options
 ---------------
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 30 lines · Daniel Henrique Barboza

Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and made it default for qemu-system-riscv32/64. It was the first RISC-V machine added in QEMU so setting it as default was sensible.

Today we have 7 riscv64 and 6 riscv32 machines and having 'spike' as default machine is not intuitive. For example, [1] is a bug that was opened with the 'virt' board in mind, but given that the user didn't pass a '-machine' option, the user was using 'spike' without knowing.

Being explicit in the command line is desirable when we have a handful of boards available, so deprecate the default machine setting from RISC-V.

[1] https://gitlab.com/qemu-project/qemu/-/issues/2467

---
  docs/about/deprecated.rst | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)
docs/about/deprecated.rst +1 -0
index 76291fdfd6..0f41a99c67 100644
@@ -304,6 +304,23 @@ online to check that this board did not completely bitrot yet). It is
  recommended to use another MIPS machine for future MIPS code development
  instead.
 
+RISC-V default machine option (since 10.0)

docs/about/deprecated.rst online to check that this board did not completely bitrot yet). It is · line 317

Quoted 10 lines
docs/about/deprecated.rst +10 -0
+''''''''''''''''''''''''''''''''''''''''''
+
+RISC-V defines ``spike`` as the default machine if no machine option is
+given in the command line.  This happens because ``spike`` is the first
+RISC-V machine implemented in QEMU and setting it as default was
+convenient at that time.  Now we have 7 riscv64 and 6 riscv32 machines
+and having ``spike`` as a default is no longer justified.  This default
+will also promote situations where users think they're running ``virt``
+(the most used RISC-V machine type in 10.0) when in fact they're
+running ``spike``.

Having users specify "-M virt" doesn't seem much of a hassle IMHO, so I'd not use 'virt' as the /new/ default in 10.2 (but we aren't there yet).

Quoted 6 lines
docs/about/deprecated.rst +6 -0
+
+Removing the default machine option forces users to always set the machine
+they want to use and avoids confusion.  Existing users of the ``spike``
+machine must ensure that they're setting the ``spike`` machine in the
+command line (``-M spike``).
+
#2 lore raw
Quoted 43 lines · Philippe Mathieu-Daudé
Quoted 29 lines · Daniel Henrique Barboza

Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and made it default for qemu-system-riscv32/64. It was the first RISC-V machine added in QEMU so setting it as default was sensible.

Today we have 7 riscv64 and 6 riscv32 machines and having 'spike' as default machine is not intuitive. For example, [1] is a bug that was opened with the 'virt' board in mind, but given that the user didn't pass a '-machine' option, the user was using 'spike' without knowing.

Being explicit in the command line is desirable when we have a handful of boards available, so deprecate the default machine setting from RISC-V.

[1] https://gitlab.com/qemu-project/qemu/-/issues/2467

---
  docs/about/deprecated.rst | 17 +++++++++++++++++

  1 file changed, 17 insertions(+)
docs/about/deprecated.rst +0 -0
index 76291fdfd6..0f41a99c67 100644
@@ -304,6 +304,23 @@ online to check that this board did not completely bitrot yet). It is

  recommended to use another MIPS machine for future MIPS code development instead.

docs/about/deprecated.rst +1 -0
+RISC-V default machine option (since 10.0)

docs/about/deprecated.rst online to check that this board did not completely bitrot yet). It is · line 317

Quoted 10 lines
docs/about/deprecated.rst +10 -0
+''''''''''''''''''''''''''''''''''''''''''
+
+RISC-V defines ``spike`` as the default machine if no machine option is
+given in the command line.  This happens because ``spike`` is the first
+RISC-V machine implemented in QEMU and setting it as default was
+convenient at that time.  Now we have 7 riscv64 and 6 riscv32 machines
+and having ``spike`` as a default is no longer justified.  This default
+will also promote situations where users think they're running ``virt``
+(the most used RISC-V machine type in 10.0) when in fact they're
+running ``spike``.
Quoted 3 lines

Having users specify "-M virt" doesn't seem much of a hassle IMHO, so I'd not use 'virt' as the /new/ default in 10.2 (but we aren't there yet).

The idea is to not have any default machine at all. Users will need to specify "-M <machine_name>" in the command line for all RISC-V machines. Otherwise we might run in the same problem again if another RISC-V board becomes more popular than 'virt'.

Thanks,

Daniel

Quoted 7 lines
Quoted 7 lines
docs/about/deprecated.rst +6 -0
+
+Removing the default machine option forces users to always set the machine
+they want to use and avoids confusion.  Existing users of the ``spike``
+machine must ensure that they're setting the ``spike`` machine in the
+command line (``-M spike``).
+
Reviewed-by on v1 1/1
#3 lore raw
In reply to Daniel Henrique Barboza
Quoted 13 lines · Daniel Henrique Barboza

Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and made it default for qemu-system-riscv32/64. It was the first RISC-V machine added in QEMU so setting it as default was sensible.

Today we have 7 riscv64 and 6 riscv32 machines and having 'spike' as default machine is not intuitive. For example, [1] is a bug that was opened with the 'virt' board in mind, but given that the user didn't pass a '-machine' option, the user was using 'spike' without knowing.

Being explicit in the command line is desirable when we have a handful of boards available, so deprecate the default machine setting from RISC-V.

Quoted 7 lines

[1]https://gitlab.com/qemu-project/qemu/-/issues/2467

---
  docs/about/deprecated.rst | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)

r~

Reviewed-by on v1 1/1
#4 lore raw
In reply to Daniel Henrique Barboza
Quoted 10 lines · Daniel Henrique Barboza

Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and made it default for qemu-system-riscv32/64. It was the first RISC-V machine added in QEMU so setting it as default was sensible.

Today we have 7 riscv64 and 6 riscv32 machines and having 'spike' as default machine is not intuitive. For example, [1] is a bug that was opened with the 'virt' board in mind, but given that the user didn't pass a '-machine' option, the user was using 'spike' without knowing.

Quoted 8 lines

Being explicit in the command line is desirable when we have a handful of boards available, so deprecate the default machine setting from RISC-V.

[1] https://gitlab.com/qemu-project/qemu/-/issues/2467

Alistair

Quoted 36 lines
---
 docs/about/deprecated.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
docs/about/deprecated.rst +17 -1
index 76291fdfd6..0f41a99c67 100644
@@ -304,6 +304,23 @@ online to check that this board did not completely bitrot yet). It is
 recommended to use another MIPS machine for future MIPS code development
 instead.
 
+RISC-V default machine option (since 10.0)
+''''''''''''''''''''''''''''''''''''''''''
+
+RISC-V defines ``spike`` as the default machine if no machine option is
+given in the command line.  This happens because ``spike`` is the first
+RISC-V machine implemented in QEMU and setting it as default was
+convenient at that time.  Now we have 7 riscv64 and 6 riscv32 machines
+and having ``spike`` as a default is no longer justified.  This default
+will also promote situations where users think they're running ``virt``
+(the most used RISC-V machine type in 10.0) when in fact they're
+running ``spike``.
+
+Removing the default machine option forces users to always set the machine
+they want to use and avoids confusion.  Existing users of the ``spike``
+machine must ensure that they're setting the ``spike`` machine in the
+command line (``-M spike``).
+
 
 Backend options
 ---------------
--

2.49.0

#5 lore raw
In reply to Daniel Henrique Barboza
Quoted 10 lines · Daniel Henrique Barboza

Commit 5b4beba124 ("RISC-V Spike Machines") added the Spike machine and made it default for qemu-system-riscv32/64. It was the first RISC-V machine added in QEMU so setting it as default was sensible.

Today we have 7 riscv64 and 6 riscv32 machines and having 'spike' as default machine is not intuitive. For example, [1] is a bug that was opened with the 'virt' board in mind, but given that the user didn't pass a '-machine' option, the user was using 'spike' without knowing.

Quoted 8 lines

Being explicit in the command line is desirable when we have a handful of boards available, so deprecate the default machine setting from RISC-V.

[1] https://gitlab.com/qemu-project/qemu/-/issues/2467

Thanks!

Applied to riscv-to-apply.next

Alistair

Quoted 36 lines
---
 docs/about/deprecated.rst | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
docs/about/deprecated.rst +17 -1
index 76291fdfd6..0f41a99c67 100644
@@ -304,6 +304,23 @@ online to check that this board did not completely bitrot yet). It is
 recommended to use another MIPS machine for future MIPS code development
 instead.
 
+RISC-V default machine option (since 10.0)
+''''''''''''''''''''''''''''''''''''''''''
+
+RISC-V defines ``spike`` as the default machine if no machine option is
+given in the command line.  This happens because ``spike`` is the first
+RISC-V machine implemented in QEMU and setting it as default was
+convenient at that time.  Now we have 7 riscv64 and 6 riscv32 machines
+and having ``spike`` as a default is no longer justified.  This default
+will also promote situations where users think they're running ``virt``
+(the most used RISC-V machine type in 10.0) when in fact they're
+running ``spike``.
+
+Removing the default machine option forces users to always set the machine
+they want to use and avoids confusion.  Existing users of the ``spike``
+machine must ensure that they're setting the ``spike`` machine in the
+command line (``-M spike``).
+
 
 Backend options
 ---------------
--

2.49.0