From patchwork Thu Apr 2 09:50:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Guihua X-Patchwork-Id: 457583 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B3A8A140082 for ; Thu, 2 Apr 2015 20:55:02 +1100 (AEDT) Received: from localhost ([::1]:57164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydbq0-0008U2-NN for incoming@patchwork.ozlabs.org; Thu, 02 Apr 2015 05:55:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdbnV-000412-A5 for qemu-devel@nongnu.org; Thu, 02 Apr 2015 05:52:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YdbnU-0007Vx-C6 for qemu-devel@nongnu.org; Thu, 02 Apr 2015 05:52:25 -0400 Received: from [59.151.112.132] (port=14976 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YdbnT-0007VH-Pg for qemu-devel@nongnu.org; Thu, 02 Apr 2015 05:52:24 -0400 X-IronPort-AV: E=Sophos;i="5.04,848,1406563200"; d="scan'208";a="90091213" Received: from unknown (HELO edo.cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 02 Apr 2015 17:48:35 +0800 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t329pGRt018743; Thu, 2 Apr 2015 17:51:16 +0800 Received: from G08FNSTD140041.g08.fujitsu.local (10.167.226.252) by G08CNEXCHPEKD02.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.181.6; Thu, 2 Apr 2015 17:52:21 +0800 From: Zhu Guihua To: , , , Date: Thu, 2 Apr 2015 17:50:22 +0800 Message-ID: <3c64aa4bdaabe7eef6c6469c3579434f5279f220.1427954659.git.zhugh.fnst@cn.fujitsu.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [10.167.226.252] X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 59.151.112.132 Cc: guz.fnst@cn.fujitsu.com, izumi.taku@jp.fujitsu.com, Zhu Guihua , tangchen@cn.fujitsu.com Subject: [Qemu-devel] [PATCH v6 6/8] acpi: fix "Memory device control fields" register X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org acpi_mem_hotplug.txt states that 0 bit in Memory device control fields must be cleared before writing to register. Now "Memory device control fields" is declared with "Preserve" update rule, so 0 bit isn't cleared when other fields are written. To solve this bug, This patch fixes UpdateRule to WriteAsZeros in "Memory device control fields" register. Signed-off-by: Zhu Guihua --- docs/specs/acpi_mem_hotplug.txt | 5 ++++- hw/i386/acpi-build.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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 diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index dc1b8e8..eb66fef 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -924,7 +924,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));