Re: [PATCH v5 28/33] nvdimm acpi: support Get Namespace Label Size function

2015-10-28 Thread Stefan Hajnoczi
On Wed, Oct 28, 2015 at 10:26:26PM +, 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.

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?


signature.asc
Description: PGP signature


Re: [PATCH v5 28/33] nvdimm acpi: support Get Namespace Label Size function

2015-10-28 Thread Xiao Guangrong



On 10/29/2015 12:41 AM, Stefan Hajnoczi wrote:

On Wed, Oct 28, 2015 at 10:26:26PM +, 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 X */
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_BITS12
target-xtensa/cpu.h:#define TARGET_PAGE_BITS 12


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html