New version, new week, and unfortunate new ping... :(
On 12/02/2015 03:20 PM, Xiao Guangrong wrote:
This patchset can be found at:
https://github.com/xiaogr/qemu.git nvdimm-v9
It is based on pci branch on Michael's tree and the top commit is:
commit 0c73277af7 (vhost-user-test: fix crash with glib < 2.36).
Changelog in v9:
- the changes address Michael's comments:
1) move the control parameter to -machine and it is off on default, then
it can be enabled by, for example, -machine pc,nvdimm
2) introduce a macro to define "NCAL"
3) abstract the function, nvdimm_build_device_dsm(), to clean up the
code
4) adjust the code style of dsm method
5) add spec reference in the code comment
other:
pick up Stefan's Reviewed-by
Changelog in v8:
We split the long patch series into the small parts, as you see now, this
is the first part which enables NVDIMM without label data support.
The command line has been changed because some patches simplifying the
things have not been included into this series, you should specify the
file size exactly using the parameters as follows:
memory-backend-file,id=mem1,share,mem-path=/tmp/nvdimm1,size=10G \
-device nvdimm,memdev=mem1,id=nv1
Changelog in v7:
- changes from Vladimir Sementsov-Ogievskiy's comments:
1) let gethugepagesize() realize if fstat is failed instead of get
normal page size
2) rename open_file_path to open_ram_file_path
3) better log the error message by using error_setg_errno
4) update commit in the commit log to explain hugepage detection on
Windows
- changes from Eduardo Habkost's comments:
1) use 'Error**' to collect error message for qemu_file_get_page_size()
2) move gethugepagesize() replacement to the same patch to make it
better for review
3) introduce qemu_get_file_size to unity the code with raw_getlength()
- changes from Stefan's comments:
1) check the memory region is large enough to contain DSM output
buffer
- changes from Eric Blake's comments:
1) update the shell command in the commit log to generate the patch
which drops 'pc-dimm' prefix
- others:
pick up Reviewed-by from Stefan, Vladimir Sementsov-Ogievskiy, and
Eric Blake.
Changelog in v6:
- changes from Stefan's comments:
1) fix code style of struct naming by CamelCase way
2) fix offset + length overflow when read/write label data
3) compile hw/acpi/nvdimm.c for per target so that TARGET_PAGE_SIZE can
be used to replace getpagesize()
Changelog in v5:
- changes from Michael's comments:
1) prefix nvdimm_ to everything in NVDIMM source files
2) make parsing _DSM Arg3 more clear
3) comment style fix
5) drop single used definition
6) fix dirty dsm buffer lost due to memory write happened on host
7) check dsm buffer if it is big enough to contain input data
8) use build_append_int_noprefix to store single value to GArray
- changes from Michael's and Igor's comments:
1) introduce 'nvdimm-support' parameter to control nvdimm
enablement and it is disabled for 2.4 and its earlier versions
to make live migration compatible
2) only reserve 1 RAM page and 4 bytes IO Port for NVDIMM ACPI
virtualization
- changes from Stefan's comments:
1) do endian adjustment for the buffer length
- changes from Bharata B Rao's comments:
1) fix compile on ppc
- others:
1) the buffer length is directly got from IO read rather than got
from dsm memory
2) fix dirty label data lost due to memory write happened on host
Changelog in v4:
- changes from Michael's comments:
1) show the message, "Memory is not allocated from HugeTlbfs", if file
based memory is not allocated from hugetlbfs.
2) introduce function, acpi_get_nvdimm_state(), to get NVDIMMState
from Machine.
3) statically define UUID and make its operation more clear
4) use GArray to build device structures to avoid potential buffer
overflow
4) improve comments in the code
5) improve code style
- changes from Igor's comments:
1) add NVDIMM ACPI spec document
2) use serialized method to avoid Mutex
3) move NVDIMM ACPI's code to hw/acpi/nvdimm.c
4) introduce a common ASL method used by _DSM for all devices to reduce
ACPI size
5) handle UUID in ACPI AML code. BTW, i'd keep handling revision in QEMU
it's better to upgrade QEMU to support Rev2 in the future
- changes from Stefan's comments:
1) copy input data from DSM memory to local buffer to avoid potential
issues as DSM memory is visible to guest. Output data is handled
in a similar way
- changes from Dan's comments:
1) drop static namespace as Linux has already supported label-less
nvdimm devices
- changes from Vladimir's comments:
1) print better message, "failed to get file size for %s, can't create
backend on it", if any file operation filed to obtain file size
- others:
create a git repo on github.com for better