From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrcre-00040i-94 for qemu-devel@nongnu.org; Wed, 28 Oct 2015 22:22:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zrcrb-0001Bj-6v for qemu-devel@nongnu.org; Wed, 28 Oct 2015 22:22:54 -0400 Received: from mga14.intel.com ([192.55.52.115]:52359) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zrcrb-0001Bc-0y for qemu-devel@nongnu.org; Wed, 28 Oct 2015 22:22:51 -0400 References: <1446071191-62591-1-git-send-email-guangrong.xiao@linux.intel.com> <1446071191-62591-29-git-send-email-guangrong.xiao@linux.intel.com> <20151028164136.GB1925@stefanha-x1.localdomain> From: Xiao Guangrong Message-ID: <5631816E.8000106@linux.intel.com> Date: Thu, 29 Oct 2015 10:16:14 +0800 MIME-Version: 1.0 In-Reply-To: <20151028164136.GB1925@stefanha-x1.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v5 28/33] nvdimm acpi: support Get Namespace Label Size function List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: ehabkost@redhat.com, kvm@vger.kernel.org, mst@redhat.com, gleb@kernel.org, mtosatti@redhat.com, qemu-devel@nongnu.org, imammedo@redhat.com, pbonzini@redhat.com, dan.j.williams@intel.com, rth@twiddle.net On 10/29/2015 12:41 AM, Stefan Hajnoczi wrote: > On Wed, Oct 28, 2015 at 10:26:26PM +0000, Xiao Guangrong wrote: >> +struct nvdimm_func_in_get_label_data { >> + uint32_t offset; /* the offset in the namespace label data area. */ >> + uint32_t length; /* the size of data is to be read via the function. */ >> +} QEMU_PACKED; >> +typedef struct nvdimm_func_in_get_label_data nvdimm_func_in_get_label_data; > > ./CODING_STYLE "3. Naming": > > Structured type names are in CamelCase; harder to type but standing > out. Did not realize it before. Will change its name to: NVDIMMFuncInGetLabelData And the same as others. > > I'm surprised that scripts/checkpatch.pl didn't warning about this. > >> +/* >> + * the max transfer size is the max size transferred by both a >> + * 'Get Namespace Label Data' function and a 'Set Namespace Label Data' >> + * function. >> + */ >> +static uint32_t nvdimm_get_max_xfer_label_size(void) >> +{ >> + nvdimm_dsm_in *in; >> + uint32_t max_get_size, max_set_size, dsm_memory_size = getpagesize(); > > Why is the host's page size relevant here? Did you mean > TARGET_PAGE_SIZE? Yes. NVDIMM is the common code, unfortunately TARGET_PAGE_SIZE is platform specified and QEMU lacks a place to include this kind of specified definition: $ git grep "#define TARGET_PAGE_SIZE" include/exec/cpu-all.h:#define TARGET_PAGE_SIZE (1 << TARGET_PAGE_BITS) [eric@xiaoreal1 qemu]$ git grep "#define TARGET_PAGE_BITS" target-alpha/cpu.h:#define TARGET_PAGE_BITS 13 target-arm/cpu.h:#define TARGET_PAGE_BITS 12 target-arm/cpu.h:#define TARGET_PAGE_BITS 10 target-cris/cpu.h:#define TARGET_PAGE_BITS 13 target-i386/cpu.h:#define TARGET_PAGE_BITS 12 target-lm32/cpu.h:#define TARGET_PAGE_BITS 12 target-m68k/cpu.h:#define TARGET_PAGE_BITS 13 target-m68k/cpu.h:#define TARGET_PAGE_BITS 10 target-microblaze/cpu.h:#define TARGET_PAGE_BITS 12 target-mips/mips-defs.h:#define TARGET_PAGE_BITS 12 target-moxie/cpu.h:#define TARGET_PAGE_BITS 12 /* 4k */ target-openrisc/cpu.h:#define TARGET_PAGE_BITS 13 target-ppc/cpu.h:#define TARGET_PAGE_BITS 12 target-ppc/cpu.h:#define TARGET_PAGE_BITS_64K 16 target-ppc/cpu.h:#define TARGET_PAGE_BITS_16M 24 target-ppc/cpu.h:#define TARGET_PAGE_BITS 12 target-ppc/cpu.h:#define TARGET_PAGE_BITS 10 target-ppc/cpu.h:#define TARGET_PAGE_BITS 12 target-s390x/cpu.h:#define TARGET_PAGE_BITS 12 target-sh4/cpu.h:#define TARGET_PAGE_BITS 12 /* 4k XXXXX */ target-sparc/cpu.h:#define TARGET_PAGE_BITS 12 /* 4k */ target-sparc/cpu.h:#define TARGET_PAGE_BITS 13 /* 8k */ target-tilegx/cpu.h:#define TARGET_PAGE_BITS 16 /* TILE-Gx uses 64KB page size */ target-tricore/tricore-defs.h:#define TARGET_PAGE_BITS 14 target-unicore32/cpu.h:#define TARGET_PAGE_BITS 12 target-xtensa/cpu.h:#define TARGET_PAGE_BITS 12