dimm: add busy slot check and slot auto-allocation

- if slot property is not specified on -device/device_add command,
treat default value as request for assigning DimmDevice to
the first free slot.

- if slot is provided with -device/device_add command, attempt to
use it or fail command if it's already occupied.

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

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

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: make plug/unlug callbacks generic

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

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

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

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

Adds optional vmstate field that allows to migrate current
state of acpi_memory_hotplug of ACPI PM device.

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

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
pc: ACPI BIOS: implement memory hotplug interface

- provides static SSDT object for memory hotplug
- 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>
pc: ACPI BIOS: use enum for defining memory affinity flags

replace magic numbers with enum describing Flags field of
memory affinity in SRAT table.

MemoryAffinityFlags enum will define flags decribed by:
 ACPI spec 5.0, "5.2.16.2 Memory Affinity Structure",
 "Table 5-69 Flags - Memory Affinity Structure"

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
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

Signed-off-by: Igor Mammedov <imammedo@redhat.com>