acpi: rename cpu_hotplug_defs.h to acpi_defs.h

to make it more generic, so it could be used for memory hotplug
as well.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi: memory hotplug ACPI hardware implementation

- implements QEMU hardware part of memory hotplug protocol
  described at "docs/specs/acpi_mem_hotplug.txt"
- handles only memory add notification event for now

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
trace: add acpi memory hotplug IO region events

Add events for tracing accesses to memory hotplug IO ports.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
trace: pc: add DIMM slot & address allocation

Add mhp_pc_dimm_assigned_slot & mhp_pc_dimm_assigned_address
events to trace which address and slot where assigned to
plugged in DIMM device on target-i386 machine.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi:piix4: allow plug/unlug callbacks handle not only PCI devices

... and report error if plugged in device is not supported.
Later these callbacks will be used by memory hotplug.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi:piix4: add memory hotplug handling

Add memory hotplug initialization/handling to PIIX4_PM device
and enable it by default for post 2.0 machine types

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pc: ich9 lpc: make it work with global/compat properties

Propeties of object should be available after its instances_init()
callback is finished and not added in PCIDeviceClass.init which is
roughly corresponds to realize() method.
Moving properties adding into instances_init will fix missing
property error when global/compat property mechanism is used.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
acpi:ich9: add memory hotplug handling

Add memory hotplug initialization/handling to ICH9 LPC device
and enable it by default for post 2.0 machine types

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pc: migrate piix4 & ich9 MemHotplugState

Adds an optional subsection that allows to migrate current
state of acpi_memory_hotplug of ACPI PM device.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
  * use subsection, requested by pbonzini
pc: add acpi-device link to PCMachineState

the link will used later to access device implementing
ACPI functions instead of adhoc lookup in QOM tree.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pc: propagate memory hotplug event to ACPI device

Notify PIIX4_PM/ICH9LPC device about hotplug event,
so that it would send SCI to guest notifying about
newly added memory.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
  * fix memory leak, reported by pbonzini
  * use link to ACPI device instead of looking it up in QOM tree
pc: ACPI BIOS: implement memory hotplug interface

- provides static SSDT object for memory hotplug that can handle
  upto 4095 hotplugable memory slots
- SSDT template for memory devices and runtime generator
  of them in SSDT table.

Signed-off-by: Vasilis Liaskovitis <vasilis.liaskovitis@profitbricks.com>
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
 * use define for amount of supported slots, requested by Eduardo Habkost
 * use defines in ASL code to make names more decriptive, requested by Michael S. Tsirkin
 * drop unneeded "Serialized" attr in ASL code
 * put memory ctrl ACPI device under PCI bus to avoid punching holes in its _CRS
pc: ACPI BIOS: reserve SRAT entry for hotplug mem hole

Needed for Windows to use hotplugged memory device, otherwise
it complains that server is not configured for memory hotplug.
Tests shows that aftewards it uses dynamically provided
proximity value from _PXM() method if available.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pc: ACPI BIOS: make GPE.3 handle memory hotplug event on PIIX and Q35 machines

also make handler edge based to avoid losing events, the same as
it has been done for PCI and CPU hotplug handlers.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
---
v2:
 * use memory hotplug crtl located under PCI0