On 01/31/18 14:25 -0800, Dan Williams wrote: > On Tue, Jan 30, 2018 at 10:02 PM, Haozhong Zhang > <haozhong.zh...@intel.com> wrote: > > Linux 4.15 introduces a new mmap flag MAP_SYNC, which can be used to > > guarantee the write persistence to mmap'ed files supporting DAX (e.g., > > files on ext4/xfs file system mounted with '-o dax'). > > Wait, MAP_SYNC does not guarantee persistence. It makes sure that the > metadata is in sync after a fault. However, that does not make > filesystem-DAX safe for use with QEMU, because we still need to > coordinate DMA with fileystem operations. There is no way to do that > coordination from within a guest. QEMU needs to use device-dax if the > guest might ever perform DMA to a virtual-pmem range. See this patch > set for more details on the DAX vs DMA problem [1]. I think we need to > enforce this in the host kernel. I.e. do not allow file backed DAX > pages to be mapped in EPT entries unless / until we have a solution to > the DMA synchronization problem. Apologies for not noticing this > earlier.
QEMU does not truncate or punch holes of the file once it has been mmap()'ed. Does the problem [1] still exist in such case? Thanks, Haozhong > > [1]: https://lists.01.org/pipermail/linux-nvdimm/2017-December/013704.html