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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 01:06 AM, Eric Blake wrote: On 10/29/2015 11:56 PM, 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

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

2015-10-31 Thread Xiao Guangrong
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 should be fixed to handle error) Indeed. I

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

2015-10-31 Thread Xiao Guangrong
On 10/30/2015 10:04 PM, Vladimir Sementsov-Ogievskiy wrote: 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

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

2015-10-31 Thread Xiao Guangrong
On 10/30/2015 11:27 PM, Vladimir Sementsov-Ogievskiy wrote: 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 ---

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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 12:10 AM, Vladimir Sementsov-Ogievskiy wrote: 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

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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 01:30 AM, Eduardo Habkost wrote: On Fri, Oct 30, 2015 at 01:56:05PM +0800, 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 ---

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

2015-10-31 Thread Xiao Guangrong
On 10/30/2015 10:25 PM, Vladimir Sementsov-Ogievskiy wrote: 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

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: [PATCH v6 07/33] util: introduce qemu_file_get_page_size()

2015-10-31 Thread Xiao Guangrong
On 10/30/2015 11:54 PM, Eduardo Habkost wrote: On Fri, Oct 30, 2015 at 01:56:01PM +0800, Xiao Guangrong wrote: There are three places use the some logic to get the page size on the file path or file fd This patch introduces qemu_file_get_page_size() to unify the code Signed-off-by: Xiao

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
On 30.10.2015 08:56, Xiao Guangrong wrote: Rename: pc-dimm.c => dimm.c pc-dimm.h => dimm.h It prepares the work which abstracts dimm device type for both pc-dimm and nvdimm Signed-off-by: Xiao Guangrong --- hw/Makefile.objs | 2 +-

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

2015-10-31 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: nvdimm need check if the backend memory is large enough to contain label data and init its memory region when the device is realized, so introduce realize callback which is called after common dimm has been realize Signed-off-by: Xiao Guangrong

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

2015-10-31 Thread Vladimir Sementsov-Ogievskiy
On 30.10.2015 08:56, Xiao Guangrong wrote: A base device, dimm, is abstracted from pc-dimm, so that we can build nvdimm device based on dimm in the later patch Signed-off-by: Xiao Guangrong --- default-configs/i386-softmmu.mak | 1 +

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

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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 06:52 PM, Vladimir Sementsov-Ogievskiy wrote: 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

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

2015-10-31 Thread Eduardo Habkost
On Sat, Oct 31, 2015 at 04:09:56PM +0800, Xiao Guangrong wrote: > On 10/30/2015 11:54 PM, Eduardo Habkost wrote: > >On Fri, Oct 30, 2015 at 01:56:01PM +0800, Xiao Guangrong wrote: > >>There are three places use the some logic to get the page size on > >>the file path or file fd > >> > >>This patch

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

2015-10-31 Thread Eduardo Habkost
On Sat, Oct 31, 2015 at 04:46:05PM +0800, Xiao Guangrong wrote: > On 10/31/2015 01:30 AM, Eduardo Habkost wrote: > >On Fri, Oct 30, 2015 at 01:56:05PM +0800, 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

Re: [PATCH 0/3] KVM: x86: simplify RSM into 64-bit protected mode

2015-10-31 Thread Laszlo Ersek
On 10/30/15 16:36, Radim Krčmář wrote: > This series bases on "KVM: x86: fix RSM into 64-bit protected mode, > round 2" and reverts it in [3/3]. To avoid regressions after doing so, > [1/2] introduces a helper that is used in [2/2] to hopefully get the > same behavior. > > I'll set up test

[PATCH] kvmtool/run: set a default cmdline if not set

2015-10-31 Thread William Dauchy
when starting with custom kernel and disk options, kernel_cmdline is NULL; it results in a segfault while trying to look for a string using `strstr`: __strstr_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strstr-sse2-unaligned.S:40 0x004056bf in kvm_cmd_run_init (argc=, argv=) at

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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 07:05 PM, Vladimir Sementsov-Ogievskiy wrote: 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

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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 05:37 PM, Vladimir Sementsov-Ogievskiy wrote: 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

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

2015-10-31 Thread Eduardo Habkost
On Sat, Oct 31, 2015 at 03:44:39PM +0800, Xiao Guangrong wrote: > On 10/30/2015 10:04 PM, Vladimir Sementsov-Ogievskiy wrote: > >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

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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 10:11 PM, Eduardo Habkost wrote: On Sat, Oct 31, 2015 at 04:09:56PM +0800, Xiao Guangrong wrote: On 10/30/2015 11:54 PM, Eduardo Habkost wrote: On Fri, Oct 30, 2015 at 01:56:01PM +0800, Xiao Guangrong wrote: There are three places use the some logic to get the page size on the

Re: [PATCH] KVM: x86: fix RSM into 64-bit protected mode, round 2

2015-10-31 Thread Laszlo Ersek
On 10/30/15 16:40, Radim Krčmář wrote: > 2015-10-26 17:32+0100, Paolo Bonzini: >> On 26/10/2015 16:43, Laszlo Ersek wrote: The code would be cleaner if we had a different approach, but this works too and is safer for stable. In case you prefer to leave the rewrite for a future

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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 09:55 PM, Eduardo Habkost wrote: On Sat, Oct 31, 2015 at 03:44:39PM +0800, Xiao Guangrong wrote: On 10/30/2015 10:04 PM, Vladimir Sementsov-Ogievskiy wrote: On 30.10.2015 08:56, Xiao Guangrong wrote: Currently file_ram_alloc() is designed for hugetlbfs, however, the memory of

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

2015-10-31 Thread Xiao Guangrong
On 10/31/2015 09:45 PM, Eduardo Habkost wrote: On Sat, Oct 31, 2015 at 04:46:05PM +0800, Xiao Guangrong wrote: On 10/31/2015 01:30 AM, Eduardo Habkost wrote: On Fri, Oct 30, 2015 at 01:56:05PM +0800, Xiao Guangrong wrote: Use the whole file size if @size is not specified which is useful if