From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrn8D-00033m-VT for qemu-devel@nongnu.org; Mon, 11 May 2015 08:48:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yrn8A-0002cl-LI for qemu-devel@nongnu.org; Mon, 11 May 2015 08:48:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yrn8A-0002cd-Go for qemu-devel@nongnu.org; Mon, 11 May 2015 08:48:22 -0400 Date: Mon, 11 May 2015 14:48:19 +0200 From: "Michael S. Tsirkin" Message-ID: <1431329108-2605-22-git-send-email-mst@redhat.com> References: <1431329108-2605-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1431329108-2605-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 21/28] acpi: fix "Memory device control fields" register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Zhu Guihua , Paolo Bonzini , Richard Henderson , Igor Mammedov From: Zhu Guihua 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 Signed-off-by: Zhu Guihua Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/i386/acpi-build.c | 2 +- docs/specs/acpi_mem_hotplug.txt | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 085dc6d..4202d76 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -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)); diff --git a/docs/specs/acpi_mem_hotplug.txt b/docs/specs/acpi_mem_hotplug.txt index dcc4808..68daa14 100644 --- a/docs/specs/acpi_mem_hotplug.txt +++ b/docs/specs/acpi_mem_hotplug.txt @@ -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 -- MST