Re: [Qemu-devel] [PATCH v6 19/33] dimm: keep the state of the whole backend memory

2015-10-31 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: QEMU keeps the state of memory of dimm device during live migration, however, it is not enough for nvdimm device as its memory does not contain its label data, so that we should protect the whole backend memory instead Signed-off-by: Xiao Guangrong ---

Re: [Qemu-devel] [PATCH v6 20/33] dimm: introduce realize callback

2015-10-31 Thread Vladimir Sementsov-Ogievskiy
ion *(*get_memory_region)(DIMMDevice *dimm); } DIMMDeviceClass; Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the

Re: [PATCH v7 20/35] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 12:13, Xiao Guangrong wrote: Curretly, the memory region of backed memory is directly mapped to guest's address space, however, it is not true for nvdimm device This patch let dimm device realize this fact and use DIMMDeviceClass->get_memory_region method to get the mapped memory r

Re: [PATCH v7 07/35] util: introduce qemu_file_get_page_size()

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
when others return long. long is more common practice here, but this doesn't really matter, so with or without size_t <-> long changes: Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenien

Re: [PATCH v7 20/35] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 16:08, Xiao Guangrong wrote: On 11/02/2015 08:19 PM, Vladimir Sementsov-Ogievskiy wrote: On 02.11.2015 12:13, Xiao Guangrong wrote: Curretly, the memory region of backed memory is directly mapped to guest's address space, however, it is not true for nvdimm device This

Re: [PATCH v7 08/35] exec: allow memory to be allocated from any kind of path

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 12:13, Xiao Guangrong wrote: Currently file_ram_alloc() is designed for hugetlbfs, however, the memory of nvdimm can come from either raw pmem device eg, /dev/pmem, or the file locates at DAX enabled filesystem So this patch let it work on any kind of path No, this patch doesn't

Re: [PATCH v7 09/35] exec: allow file_ram_alloc to work on file

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
on't bother bailing out on errors. - * If anything goes wrong with it under other filesystems, - * mmap will fail. - */ -if (ftruncate(fd, memory)) { - perror("ftruncate"); -} area = qemu_ram_mmap(fd, memory, pagesize, block->flags & RAM_SHARED);

Re: [PATCH v7 11/35] util: introduce qemu_file_getlength()

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
r_setg_errno(errp, -size, "can't get size of file %s", file); +size = 0; +} + +qemu_close(fd); +return size; +} Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience. --

Re: [PATCH v7 08/35] exec: allow memory to be allocated from any kind of path

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 18:22, Xiao Guangrong wrote: On 11/02/2015 10:51 PM, Vladimir Sementsov-Ogievskiy wrote: On 02.11.2015 12:13, Xiao Guangrong wrote: Currently file_ram_alloc() is designed for hugetlbfs, however, the memory of nvdimm can come from either raw pmem device eg, /dev/pmem, or the

Re: [Qemu-devel] [PATCH v7 09/35] exec: allow file_ram_alloc to work on file

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 18:25, Xiao Guangrong wrote: On 11/02/2015 11:12 PM, Vladimir Sementsov-Ogievskiy wrote: On 02.11.2015 12:13, Xiao Guangrong wrote: Currently, file_ram_alloc() only works on directory - it creates a file under @path and do mmap on it This patch tries to allow it to work on

Re: [PATCH v7 12/35] util: let qemu_fd_getlength support block device

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
return size; +} +#endif + size = lseek(fd, 0, SEEK_END); if (size < 0) { return -errno; Reviewed-by: Vladimir Sementsov-Ogievskiy just a question: is there any use for stat.st_size ? Is it always worse then lseek? Does it work for blk? also, "This patch

Re: [PATCH v7 20/35] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 18:06, Xiao Guangrong wrote: On 11/02/2015 10:26 PM, Vladimir Sementsov-Ogievskiy wrote: On 02.11.2015 16:08, Xiao Guangrong wrote: On 11/02/2015 08:19 PM, Vladimir Sementsov-Ogievskiy wrote: On 02.11.2015 12:13, Xiao Guangrong wrote: Curretly, the memory region of backed

Re: [PATCH v7 13/35] hostmem-file: use whole file size if possible

2015-11-02 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 12:13, Xiao Guangrong wrote: Use the whole file size if @size is not specified which is useful if we want to directly pass a file to guest Signed-off-by: Xiao Guangrong --- backends/hostmem-file.c | 22 ++ 1 file changed, 18 insertions(+), 4 deletions(-) di

Re: [PATCH v7 20/35] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

2015-11-05 Thread Vladimir Sementsov-Ogievskiy
On 03.11.2015 17:47, Xiao Guangrong wrote: On 11/03/2015 12:16 AM, Vladimir Sementsov-Ogievskiy wrote: On 02.11.2015 18:06, Xiao Guangrong wrote: On 11/02/2015 10:26 PM, Vladimir Sementsov-Ogievskiy wrote: On 02.11.2015 16:08, Xiao Guangrong wrote: On 11/02/2015 08:19 PM, Vladimir

Re: [PATCH v7 23/35] nvdimm: implement NVDIMM device abstract

2015-11-13 Thread Vladimir Sementsov-Ogievskiy
On 02.11.2015 12:13, Xiao Guangrong wrote: Introduce "nvdimm" device which is based on dimm device type 128K memory region which is the minimum namespace label size required by NVDIMM Namespace Spec locates at the end of backend memory device is reserved for label data We can use "-m 1G,maxmem=

Re: [Qemu-devel] [PATCH v8 0/5] implement vNVDIMM

2015-12-04 Thread Vladimir Sementsov-Ogievskiy
On 16.11.2015 13:50, Xiao Guangrong wrote: NVDIMM (A Non-Volatile Dual In-line Memory Module) is going to be supported on Intel's platform. Hi. One question: do this mean, that your qemu emulated nvidimm - pmem solution will work only on Intel host? -- Best regards, Vladimir * now, @virtuo

Re: [Qemu-devel] [PATCH v3 11/32] hostmem-file: use whole file size if possible

2015-10-13 Thread Vladimir Sementsov-Ogievskiy
On 11.10.2015 06:52, Xiao Guangrong wrote: Use the whole file size if @size is not specified which is useful if we want to directly pass a file to guest Signed-off-by: Xiao Guangrong --- backends/hostmem-file.c | 47 +++ 1 file changed, 43 insertio

Re: [Qemu-devel] [PATCH v6 07/33] util: introduce qemu_file_get_page_size()

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
logic is changed: in old version gethugepagesize on statfs error generates exit(1) in new it returns getpagesize() in this case (through fd_getpagesize) (I think, fd_getpagesize should be fixed to handle error) also, in new version for windows we have getpagesize(), when in old version t

Re: [Qemu-devel] [PATCH v6 08/33] exec: allow memory to be allocated from any kind of path

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: Currently file_ram_alloc() is designed for hugetlbfs, however, the memory of nvdimm can come from either raw pmem device eg, /dev/pmem, or the file locates at DAX enabled filesystem So this patch let it work on any kind of path Signed-off-by: Xiao Guan

Re: [Qemu-devel] [PATCH v6 09/33] exec: allow file_ram_alloc to work on file

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: Currently, file_ram_alloc() only works on directory - it creates a file under @path and do mmap on it This patch tries to allow it to work on file directly, if @path is a directory it works as before, otherwise it treats @path as the target file then di

Re: [Qemu-devel] [PATCH v6 10/33] hostmem-file: clean up memory allocation

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
ckendClass) - ram_backend_memory_alloc - has not such check too. It's ok.. Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience. -- To unsubscribe from this list: send the line "unsubs

Re: [Qemu-devel] [PATCH v6 11/33] hostmem-file: use whole file size if possible

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: Use the whole file size if @size is not specified which is useful if we want to directly pass a file to guest Signed-off-by: Xiao Guangrong --- backends/hostmem-file.c | 48 1 file changed, 44 inserti

Re: [Qemu-devel] [PATCH v6 13/33] pc-dimm: make pc_existing_dimms_capacity static and rename it

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
MemoryRegion *mr, uint64_t align, Error **errp); void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms, Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir * now, @virtuozzo.com instead of @parallels.com. Sorry for this inconvenience. -- To unsubscribe

Re: [Qemu-devel] [PATCH v6 14/33] pc-dimm: drop the prefix of pc-dimm

2015-10-30 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: This patch is generated by this script: find ./ -name "*.[ch]" -o -name "*.json" -o -name "trace-events" -type f \ | xargs sed -i "s/PC_DIMM/DIMM/g" find ./ -name "*.[ch]" -o -name "*.json" -o -name "trace-events" -type f \ | xargs sed -i "s/PCDIMM/DIM

Re: [Qemu-devel] [PATCH v6 07/33] util: introduce qemu_file_get_page_size()

2015-10-31 Thread Vladimir Sementsov-Ogievskiy
On 31.10.2015 10:26, Xiao Guangrong wrote: On 10/30/2015 09:26 PM, Vladimir Sementsov-Ogievskiy wrote: logic is changed: in old version gethugepagesize on statfs error generates exit(1) in new it returns getpagesize() in this case (through fd_getpagesize) (I think, fd_getpagesize

Re: [Qemu-devel] [PATCH v6 16/33] pc-dimm: rename pc-dimm.c and pc-dimm.h

2015-10-31 Thread Vladimir Sementsov-Ogievskiy
ds.h" #include "qom/object_interfaces.h" -#include "hw/mem/pc-dimm.h" +#include "hw/mem/dimm.h" #include "hw/acpi/acpi_dev_interface.h" NameInfo *qmp_query_name(Error **errp) diff --git a/stubs/qmp_dimm_device_list.c b/stubs/qmp_dimm_device_list.c in

Re: [Qemu-devel] [PATCH v6 17/33] dimm: abstract dimm device from pc-dimm

2015-10-31 Thread Vladimir Sementsov-Ogievskiy
ce, (obj), TYPE_DIMM) #define DIMM_CLASS(oc) \ diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h new file mode 100644 index 000..50818c2 --- /dev/null +++ b/include/hw/mem/pc-dimm.h @@ -0,0 +1,7 @@ +#ifndef QEMU_PC_DIMM_H +#define QEMU_PC_DIMM_H + +#include "hw/mem/dimm.h

Re: [Qemu-devel] [PATCH v6 18/33] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

2015-10-31 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: Curretly, the memory region of backed memory is directly mapped to guest's address space, however, it is not true for nvdimm device This patch let dimm device realize this fact and use DIMMDeviceClass->get_memory_region method to get the mapped memory r