From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0xax-0003kJ-He for qemu-devel@nongnu.org; Sun, 30 Oct 2016 17:24:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0xau-0007AD-DM for qemu-devel@nongnu.org; Sun, 30 Oct 2016 17:24:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34046) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c0xau-0007A7-84 for qemu-devel@nongnu.org; Sun, 30 Oct 2016 17:24:44 -0400 Date: Sun, 30 Oct 2016 23:24:41 +0200 From: "Michael S. Tsirkin" Message-ID: <1477850917-1214-29-git-send-email-mst@redhat.com> References: <1477850917-1214-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1477850917-1214-1-git-send-email-mst@redhat.com> Subject: [Qemu-devel] [PULL 28/47] acpi nvdimm: fix wrong buffer size returned by DSM method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Xiao Guangrong , Igor Mammedov From: Xiao Guangrong Currently, 'RLEN' is the totally buffer size written by QEMU and it is ACPI internally used only. The buffer size returned to guest should not include 'RLEN' itself Signed-off-by: Xiao Guangrong Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/acpi/nvdimm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c index e486128..24a2b3b 100644 --- a/hw/acpi/nvdimm.c +++ b/hw/acpi/nvdimm.c @@ -862,7 +862,8 @@ static void nvdimm_build_common_dsm(Aml *dev) aml_append(method, aml_store(dsm_mem, aml_name("NTFI"))); result_size = aml_local(1); - aml_append(method, aml_store(aml_name("RLEN"), result_size)); + /* RLEN is not included in the payload returned to guest. */ + aml_append(method, aml_subtract(aml_name("RLEN"), aml_int(4), result_size)); aml_append(method, aml_store(aml_shiftleft(result_size, aml_int(3)), result_size)); aml_append(method, aml_create_field(aml_name("ODAT"), aml_int(0), -- MST