From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abrHI-0003Ar-CE for qemu-devel@nongnu.org; Fri, 04 Mar 2016 10:04:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abrHC-0002Zv-RS for qemu-devel@nongnu.org; Fri, 04 Mar 2016 10:04:28 -0500 Received: from mga03.intel.com ([134.134.136.65]:14863) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abrHC-0002Zl-BU for qemu-devel@nongnu.org; Fri, 04 Mar 2016 10:04:22 -0500 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> From: Xiao Guangrong Message-ID: <56D9A3D3.3000506@linux.intel.com> Date: Fri, 4 Mar 2016 23:03:47 +0800 MIME-Version: 1.0 In-Reply-To: <20160303151314-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 3/5] nvdimm acpi: let qemu handle _DSM method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: ehabkost@redhat.com, kvm@vger.kernel.org, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, imammedo@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, rth@twiddle.net 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