On 25/02/2025 19.04, Peter Maydell wrote:
From: Bernhard Beschow <shen...@gmail.com>

As a first step, implement the bare minimum: CPUs, RAM, interrupt controller,
serial. All other devices of the A53 memory map are represented as
TYPE_UNIMPLEMENTED_DEVICE, i.e. the whole memory map is provided. This allows
for running Linux without it crashing due to invalid memory accesses.

Signed-off-by: Bernhard Beschow <shen...@gmail.com>
Message-id: 20250223114708.1780-5-shen...@gmail.com
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>
[PMM: drop 'static const' from serial_table[] definition to avoid
  compile failure on GCC 7.5]
Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
---
...
+static const TypeInfo fsl_imx8mp_types[] = {
+    {
+        .name = TYPE_FSL_IMX8MP,
+        .parent = TYPE_DEVICE,
+        .instance_size = sizeof(FslImx8mpState),
+        .instance_init = fsl_imx8mp_init,
+        .class_init = fsl_imx8mp_class_init,
+    },
+};
+
+DEFINE_TYPES(fsl_imx8mp_types)

 Hi Bernhard, hi Peter,

this device can be used to crash QEMU quite easily:

$ ./qemu-system-aarch64  -M virt -device fsl-imx8mp
**
ERROR:../../devel/qemu/tcg/tcg.c:1006:tcg_register_thread: assertion failed: (n < tcg_max_ctxs) Bail out! ERROR:../../devel/qemu/tcg/tcg.c:1006:tcg_register_thread: assertion failed: (n < tcg_max_ctxs)
Aborted (core dumped)

Should it maybe be marked with "user_creatable = false" to avoid this?

 Thomas


Reply via email to