acpi: fix "Memory device control fields" register
authorZhu Guihua <zhugh.fnst@cn.fujitsu.com>
Mon, 27 Apr 2015 08:47:20 +0000 (16:47 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Apr 2015 19:09:07 +0000 (21:09 +0200)
0 bit in Memory device control fields must be cleared before writing to
register. But now this field isn't cleared when other fields are written.

To solve this bug, This patch fixes UpdateRule to WriteAsZeros in "Memory
device control fields" register.

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>
docs/specs/acpi_mem_hotplug.txt
hw/i386/acpi-build.c

index dcc480891862eb26f264ea5ffa77298fe00020cc..68daa1476408552e38013eb0ed0398bee01bc4ea 100644 (file)
@@ -31,7 +31,10 @@ Memory hot-plug interface (IO port 0xa00-0xa17, 1-4 byte access):
       [0xc-0x13] reserved, writes into it are ignored
       [0x14] Memory device control fields
           bits:
-              0: reserved, OSPM must clear it before writing to register
+              0: reserved, OSPM must clear it before writing to register.
+                 Due to BUG in versions prior 2.4 that field isn't cleared
+                 when other fields are written. Keep it reserved and don't
+                 try to reuse it.
               1: if set to 1 clears device insert event, set by OSPM
                  after it has emitted device check event for the
                  selected memory device
index 085dc6d9e551603ade7f8fd8aefb0192c675ae15..4202d76f93d98a3754786e783665edede7c0d205 100644 (file)
@@ -872,7 +872,7 @@ build_ssdt(GArray *table_data, GArray *linker,
         aml_append(scope, field);
 
         field = aml_field(stringify(MEMORY_HOTPLUG_IO_REGION), aml_byte_acc,
-                          aml_preserve);
+                          aml_write_as_zeros);
         aml_append(field, aml_reserved_field(160 /* bits, Offset(20) */));
         aml_append(field, /* 1 if enabled, read only */
             aml_named_field(stringify(MEMORY_SLOT_ENABLED), 1));