From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH v5 3/5] nvdimm acpi: let qemu handle _DSM method Date: Fri, 4 Mar 2016 23:03:47 +0800 Message-ID: <56D9A3D3.3000506@linux.intel.com> References: <1456919441-101204-1-git-send-email-guangrong.xiao@linux.intel.com> <1456919441-101204-4-git-send-email-guangrong.xiao@linux.intel.com> <20160303151314-mutt-send-email-mst@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: pbonzini@redhat.com, imammedo@redhat.com, gleb@kernel.org, mtosatti@redhat.com, stefanha@redhat.com, rth@twiddle.net, ehabkost@redhat.com, dan.j.williams@intel.com, kvm@vger.kernel.org, qemu-devel@nongnu.org To: "Michael S. Tsirkin" Return-path: Received: from mga04.intel.com ([192.55.52.120]:24340 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759111AbcCDPEF (ORCPT ); Fri, 4 Mar 2016 10:04:05 -0500 In-Reply-To: <20160303151314-mutt-send-email-mst@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/03/2016 09:23 PM, Michael S. Tsirkin wrote: >> + * >> + * They are RAM mapping on host so that these accesses never cause >> + * VM-EXIT. >> + */ >> + field = aml_field("NRAM", AML_DWORD_ACC, AML_NOLOCK, AML_PRESERVE); >> + aml_append(field, aml_named_field("HDLE", >> + sizeof(typeof_field(NvdimmDsmIn, handle)) * BITS_PER_BYTE)); >> + aml_append(field, aml_named_field("REVS", >> + sizeof(typeof_field(NvdimmDsmIn, revision)) * BITS_PER_BYTE)); >> + aml_append(field, aml_named_field("FUNC", >> + sizeof(typeof_field(NvdimmDsmIn, function)) * BITS_PER_BYTE)); >> + aml_append(field, aml_named_field("ARG3", >> + (TARGET_PAGE_SIZE - offsetof(NvdimmDsmIn, arg3)) * >> + BITS_PER_BYTE)); > > drop the extra () here please, and align BITS_PER_BYTE with > TARGET_PAGE_SIZE. Michael, the () is necessary here, as it is calculating the number of bits: (PAGE_SIZE - offset_of_arg3) * BITS_PER_BYTE