summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCédric Le Goater <clg@redhat.com>2024-03-18 16:58:44 +0100
committerCédric Le Goater <clg@redhat.com>2024-03-19 11:56:45 +0100
commit5b2b9450a2f83668bedd092b43233ad35f0d40bd (patch)
tree4aefeab4a9ab73b3c122449abbf8c40e359794cf
parent57001144628db65ef9b7dbbfb759101212696d6a (diff)
downloadfocaccia-qemu-5b2b9450a2f83668bedd092b43233ad35f0d40bd.tar.gz
focaccia-qemu-5b2b9450a2f83668bedd092b43233ad35f0d40bd.zip
ppc/pnv: I2C controller is not user creatable
The I2C controller is a subunit of the processor. Make it so and avoid
QEMU crashes.

  $ build/qemu-system-ppc64 -S -machine powernv9 -device pnv-i2c
  qemu-system-ppc64: ../hw/ppc/pnv_i2c.c:521: pnv_i2c_realize: Assertion `i2c->chip' failed.
  Aborted (core dumped)

Fixes: 263b81ee15af ("ppc/pnv: Add an I2C controller model")
Cc: Glenn Miles <milesg@linux.vnet.ibm.com>
Reported-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Glenn Miles <milesg@linux.vnet.ibm.com>
Signed-off-by: Cédric Le Goater <clg@redhat.com>
-rw-r--r--hw/ppc/pnv_i2c.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/ppc/pnv_i2c.c b/hw/ppc/pnv_i2c.c
index 4581cc5e5d..eec5047ce8 100644
--- a/hw/ppc/pnv_i2c.c
+++ b/hw/ppc/pnv_i2c.c
@@ -557,6 +557,9 @@ static void pnv_i2c_class_init(ObjectClass *klass, void *data)
 
     xscomc->dt_xscom = pnv_i2c_dt_xscom;
 
+    /* Reason: This device is part of the CPU and cannot be used separately */
+    dc->user_creatable = false;
+
     dc->desc = "PowerNV I2C";
     dc->realize = pnv_i2c_realize;
     device_class_set_props(dc, pnv_i2c_properties);