Skip to contentSkip to conversation

Fix bugs in the next-cube code and deprecate it

PATCH In review Thomas Huth 2 participants 7 messages Aug 28

lore
Share & tools
lore
#0 lore raw

cover Fix bugs in the next-cube code and deprecate it

Fix some guest-triggerable assert() and abort() statements in the next-cube machine. Since this machine is incomplete and not really usable, mark it as deprecated and orphan, so we can remove it in a couple of releases if nobody chimes in to get it into a proper state.

Thomas Huth (3):
hw/m68k/next-cube: Replace assert()s and abort()s with logging
functions
docs/about: Deprecate the 'next-cube' m68k machine
MAINTAINERS: Mark the next-cube machine as "Orphan"

 MAINTAINERS               |  3 +--
 docs/about/deprecated.rst |  8 ++++++++
 hw/m68k/next-cube.c       | 10 ++++++----
 3 files changed, 15 insertions(+), 6 deletions(-)
Signature · 1 line
2.55.0
#1 lore raw

PATCH 1/3 hw/m68k/next-cube: Replace assert()s and abort()s with logging functions

The next-cube code contains some assert() and abort() statements that can be triggered from the guest side. Of course LLMs love to complain about those and people are filing bugs about this. Thus replace those spots with logging functions to not get bothered about this again in the future.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4303
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4304
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4305

---
 hw/m68k/next-cube.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
hw/m68k/next-cube.c +6 -4
index 9a0a57c0cc..c541e6d00c 100644
@@ -30,6 +30,7 @@
 #include "hw/core/qdev-properties.h"
 #include "qapi/error.h"
 #include "qemu/error-report.h"
+#include "qemu/log.h"
 #include "ui/console.h"
 #include "target/m68k/cpu.h"
 #include "migration/vmstate.h"
@@ -620,8 +621,7 @@ static void nextdma_write(void *opaque, uint8_t *buf, int size, int type)
 
 static void nextscsi_read(void *opaque, uint8_t *buf, int len)
 {
-    DPRINTF("SCSI READ: %x\n", len);
-    abort();
+    qemu_log_mask(LOG_UNIMP, "nextscsi_read with len = %d\n", len);
 }
 
 static void nextscsi_write(void *opaque, uint8_t *buf, int size)
@@ -825,7 +825,8 @@ static void next_floppy_write(void *opaque, hwaddr addr, uint64_t val,
         break;
 
     default:
-        g_assert_not_reached();
+        qemu_log_mask(LOG_UNIMP, "next_floppy_write at addr 0x%"HWADDR_PRIx"\n",
+                      addr);
     }
 }
 
@@ -840,7 +841,8 @@ static uint64_t next_floppy_read(void *opaque, hwaddr addr, unsigned size)
         break;
 
     default:
-        g_assert_not_reached();
+        qemu_log_mask(LOG_UNIMP, "next_floppy_read at addr 0x%"HWADDR_PRIx"\n",
+                      addr);
     }
 
     return val;
Signature · 1 line
2.55.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] hw/m68k/next-cube: Replace assert()s and abort()s with logging functions

Quoted 6 lines · Thomas Huth

The next-cube code contains some assert() and abort() statements that can be triggered from the guest side. Of course LLMs love to complain about those and people are filing bugs about this. Thus replace those spots with logging functions to not get bothered about this again in the future.

Quoted 7 lines

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4303
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4304
Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4305

---
  hw/m68k/next-cube.c | 10 ++++++----
  1 file changed, 6 insertions(+), 4 deletions(-)
#3 lore raw

PATCH 2/3 docs/about: Deprecate the 'next-cube' m68k machine

In reply to Thomas Huth

The machine is incomplete since years and we never managed to fully boot a kernel with it. So it's maybe best if we mark this machine as deprecated and finally remove it again in case it gets into the way of a code refactoring or other reasons.

---
 docs/about/deprecated.rst | 8 ++++++++
 1 file changed, 8 insertions(+)
docs/about/deprecated.rst +8 -0
index 0c656a968f..0b2e298305 100644
@@ -249,6 +249,14 @@ was an early implementation of memory encryption support in QEMU, but it has
 been superseded by the more comprehensive ``confidential-guest-support``
 object.
 
+``next-cube`` m68k machine (since 11.2)
+'''''''''''''''''''''''''''''''''''''''
+
+The machine never got fully implemented and can only show the firmware prompt.
+Given the incomplete state and slow progress on improvements, it might get
+removed again without replacement.
+
+
 Backend options
 ---------------
 
Signature · 1 line
2.55.0
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] docs/about: Deprecate the 'next-cube' m68k machine

Quoted 9 lines · Thomas Huth

The machine is incomplete since years and we never managed to fully boot a kernel with it. So it's maybe best if we mark this machine as deprecated and finally remove it again in case it gets into the way of a code refactoring or other reasons.

---
  docs/about/deprecated.rst | 8 ++++++++
  1 file changed, 8 insertions(+)
#5 lore raw

PATCH 3/3 MAINTAINERS: Mark the next-cube machine as "Orphan"

In reply to Thomas Huth

I never manage to get this machine to a fully usable state, and in the course of time I also lost interest in this machine. Mark it as "Orphan" to set expectations right and make place for somebody else to take over.

---
 MAINTAINERS | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
MAINTAINERS +1 -2
index 6c18b8a419..a6db951b59 100644
@@ -1418,8 +1418,7 @@ F: include/hw/m68k/mcf*.h
 F: tests/functional/m68k/test_mcf5208evb.py
 
 NeXTcube
-M: Thomas Huth <[email protected]>
-S: Odd Fixes
+S: Orphan
 F: hw/m68k/next-*.c
 F: hw/display/next-fb.c
 F: include/hw/m68k/next-cube.h
Signature · 1 line
2.55.0
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] MAINTAINERS: Mark the next-cube machine as "Orphan"

Quoted 9 lines · Thomas Huth

I never manage to get this machine to a fully usable state, and in the course of time I also lost interest in this machine. Mark it as "Orphan" to set expectations right and make place for somebody else to take over.

---
  MAINTAINERS | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)