On 16/10/2017 12:20, Xiao Guangrong wrote: > >> Qemu does not need pin NVDIMM memory for VFIO device during VFIO >> hotplug, what's more, if there is no NVDIMM hw in the test machine, >> the VFIO hotplug operation will need at least 10 minutes to pin RAM >> as the NVDIMM, this time is not accepted. So we add "nopin=on" option >> in the memory-backed-file, which can avoid to pin RAM memory for NVDIMM. > > No. > > memory-backed-file does not dedicate for nvdimm only, it can be mapped > as normal memory as well. Rather more, this is no way to stop guest to > use it as DMA.
Right, so a better name for the object property could be "dma" rather than "nopin". I'll let others comment on whether MemoryBackend (not just memory-backend-file) is the right place for the option. I am also not sure whether VFIO is not the right place for the "other side" of the hook. If you add the memory region to the CPU address space and not the PCI address space, you can hide it from all PCI devices. Paolo