qemu-e2k/hw/isa
Wei Yang 9040e6dfa8 i386, acpi: check acpi_memory_hotplug capacity in pre_plug
Currently we do device realization like below:

   hotplug_handler_pre_plug()
   dc->realize()
   hotplug_handler_plug()

Before we do device realization and plug, we should allocate necessary
resources and check if memory-hotplug-support property is enabled.

At the piix4 and ich9, the memory-hotplug-support property is checked at
plug stage. This means that device has been realized and mapped into guest
address space 'pc_dimm_plug()' by the time acpi plug handler is called,
where it might fail and crash QEMU due to reaching g_assert_not_reached()
(piix4) or error_abort (ich9).

Fix it by checking if memory hotplug is enabled at pre_plug stage
where we can gracefully abort hotplug request.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
CC: Igor Mammedov <imammedo@redhat.com>
CC: Eric Blake <eblake@redhat.com>
Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

Message-Id: <20190301033548.6691-1-richardw.yang@linux.intel.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2019-03-12 22:31:21 -04:00
..
apm.c acpi: move ACPI_PORT_SMI_CMD define to header it belongs to 2018-03-13 23:09:50 +02:00
i82378.c hw/timer/mc146818: rename rtc_init() -> mc146818_rtc_init() 2017-12-18 17:07:02 +03:00
isa-bus.c hw/isa: Move parallel_hds_isa_init() to hw/char/parallel-isa.c 2018-03-12 16:12:47 +01:00
isa-superio.c char: allow specifying a GMainContext at opening time 2019-02-13 14:23:39 +01:00
Kconfig isa: express SuperIO dependencies with Kconfig 2019-03-07 21:45:53 +01:00
lpc_ich9.c i386, acpi: check acpi_memory_hotplug capacity in pre_plug 2019-03-12 22:31:21 -04:00
Makefile.objs configs: Add a CONFIG_SMC37C669 switch for the "smc37c669-superio" device 2018-10-24 07:33:44 +01:00
pc87312.c hw/isa/superio: Factor out the IDE code from pc87312.c 2018-03-12 16:12:49 +01:00
piix4.c pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices 2017-10-15 05:54:43 +03:00
smc37c669-superio.c hw/isa/smc37c669: Change the parallel I/O base to 378H 2018-06-16 19:46:54 -10:00
trace-events hw/isa/superio: Factor out the IDE code from pc87312.c 2018-03-12 16:12:49 +01:00
vt82c686.c i2c: Split smbus into parts 2019-02-27 21:06:08 -06:00