acpi: add hardware implementation for memory hot unplug

- implements QEMU hardware part of memory hot unplug protocol
  described at "docs/spec/acpi_mem_hotplug.txt"
- handles memory remove notification event
- handles device eject notification

Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Zhu Guihua 2015-04-27 16:47:21 +08:00 committed by Michael S. Tsirkin
parent 660e8ec700
commit c06b2ffb02
8 changed files with 61 additions and 5 deletions

View file

@ -879,6 +879,12 @@ build_ssdt(GArray *table_data, GArray *linker,
aml_append(field,
/*(read) 1 if has a insert event. (write) 1 to clear event */
aml_named_field(stringify(MEMORY_SLOT_INSERT_EVENT), 1));
aml_append(field,
/* (read) 1 if has a remove event. (write) 1 to clear event */
aml_named_field(stringify(MEMORY_SLOT_REMOVE_EVENT), 1));
aml_append(field,
/* initiates device eject, write only */
aml_named_field(stringify(MEMORY_SLOT_EJECT), 1));
aml_append(scope, field);
field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_dword_acc,
@ -923,6 +929,12 @@ build_ssdt(GArray *table_data, GArray *linker,
)));
aml_append(dev, method);
method = aml_method("_EJ0", 1);
s = BASEPATH stringify(MEMORY_SLOT_EJECT_METHOD);
aml_append(method, aml_return(aml_call2(
s, aml_name("_UID"), aml_arg(0))));
aml_append(dev, method);
aml_append(sb_scope, dev);
}