qemu-e2k/include/hw/acpi
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
..
acpi_dev_interface.h qom: make interface types abstract 2018-12-11 15:45:22 -02:00
acpi-defs.h hw/arm/virt-acpi-build: Set COHACC override flag in IORT SMMUv3 node 2019-01-21 10:23:11 +00:00
acpi.h hw/acpi: remove unused function acpi_table_add_builtin() 2019-03-06 10:22:38 +01:00
aml-build.h hw: acpi: Export and share the ARM RSDP build 2018-12-19 16:48:16 -05:00
bios-linker-loader.h vmgenid: replace x-write-pointer-available hack 2017-09-08 16:15:17 +03:00
cpu_hotplug.h Clean up header guards that don't match their file name 2016-07-12 16:19:16 +02:00
cpu.h typo: apci->acpi 2019-01-30 10:16:58 +01:00
ich9.h i386, acpi: check acpi_memory_hotplug capacity in pre_plug 2019-03-12 22:31:21 -04:00
ipmi.h hw: remove "qemu/osdep.h" from header files 2017-12-18 17:07:02 +03:00
memory_hotplug.h migration: Remove unneeded includes of migration/vmstate.h 2017-06-01 18:49:22 +02:00
pc-hotplug.h memhp: don't generate memory hotplug AML if it's not enabled/supported 2017-01-10 07:03:24 +02:00
pcihp.h pci/pcihp: perform unplug via the hotplug handler 2018-12-20 11:19:12 -05:00
piix4.h
tco.h
tpm.h acpi: build TPM Physical Presence interface 2019-01-17 21:10:57 -05:00
vmgenid.h vmgenid: replace x-write-pointer-available hack 2017-09-08 16:15:17 +03:00