qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 28/33] nvdimm acpi: support Get Namespace Lab


From: Xiao Guangrong
Subject: Re: [Qemu-devel] [PATCH v5 28/33] nvdimm acpi: support Get Namespace Label Size function
Date: Thu, 29 Oct 2015 10:16:14 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0



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)
address@hidden 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]