@samitouri / QOSamiQemu / commits / 7624894549

hw/hppa: Avoid leaking a diva-gsp device

Create a Diva-gsp unconditionally on all 64-bit PCI machines. The A400 usually comes with a Diva card. The C3700 has a built-in SUPERIO chip, which we haven't implemented yet, so running with an emulated Diva is the best we can do for now. Signed-off-by: Helge Deller <deller@gmx.de> Suggested-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-ID: <20260307195243.8813-2-deller@kernel.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Helge Deller committed Mar 7, 2026 at 20:52 UTC 7624894549804de5bf9ca389fa5e933dfb93e48d
1 file changed +8 -11
hw/hppa/machine.c
+8 -11
@@ -382,18 +382,15 @@ static void machine_HP_common_init_tail(MachineState *machine, PCIBus *pci_bus,
382
383 if (pci_bus && hppa_is_pa20(&cpu[0]->env)) {
384 /* BMC board: HP Diva GSP PCI card */
385 - dev = qdev_new("diva-gsp");
386 - if (dev && !object_property_get_bool(OBJECT(dev), "disable", NULL)) {
387 - pci_dev = pci_new_multifunction(PCI_DEVFN(2, 0), "diva-gsp");
388 - if (!lasi_dev) {
389 - /* bind default keyboard/serial to Diva card */
390 - qdev_prop_set_chr(DEVICE(pci_dev), "chardev1", serial_hd(0));
391 - qdev_prop_set_chr(DEVICE(pci_dev), "chardev2", serial_hd(1));
392 - qdev_prop_set_chr(DEVICE(pci_dev), "chardev3", serial_hd(2));
393 - qdev_prop_set_chr(DEVICE(pci_dev), "chardev4", serial_hd(3));
394 - }
395 - pci_realize_and_unref(pci_dev, pci_bus, &error_fatal);
385 + pci_dev = pci_new_multifunction(PCI_DEVFN(2, 0), "diva-gsp");
386 + if (!lasi_dev) {
387 + /* bind default keyboard/serial to Diva card */
388 + qdev_prop_set_chr(DEVICE(pci_dev), "chardev1", serial_hd(0));
389 + qdev_prop_set_chr(DEVICE(pci_dev), "chardev2", serial_hd(1));
390 + qdev_prop_set_chr(DEVICE(pci_dev), "chardev3", serial_hd(2));
391 + qdev_prop_set_chr(DEVICE(pci_dev), "chardev4", serial_hd(3));
392 }
393 + pci_realize_and_unref(pci_dev, pci_bus, &error_fatal);
394 }
395
396 /* create USB OHCI controller for USB keyboard & mouse on Astro machines */