From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755586AbcHSSau (ORCPT ); Fri, 19 Aug 2016 14:30:50 -0400 Received: from mga09.intel.com ([134.134.136.24]:17376 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753665AbcHSSat (ORCPT ); Fri, 19 Aug 2016 14:30:49 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,545,1464678000"; d="scan'208";a="1038661986" Date: Fri, 19 Aug 2016 12:30:47 -0600 From: Ross Zwisler To: Dan Williams Cc: Xiao Guangrong , Yumei Huang , KVM , "linux-nvdimm@lists.01.org" , "qemu-devel@nongnu.org" , LKML , Linux ACPI , Stefan Hajnoczi Subject: Re: DAX can not work on virtual nvdimm device Message-ID: <20160819183047.GA7216@linux.intel.com> References: <436d7526-bf06-633d-afce-4333552d9e31@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 19, 2016 at 07:59:29AM -0700, Dan Williams wrote: > On Fri, Aug 19, 2016 at 4:19 AM, Xiao Guangrong > wrote: > > > > Hi Dan, > > > > Recently, Redhat reported that nvml test suite failed on QEMU/KVM, > > more detailed info please refer to: > > https://bugzilla.redhat.com/show_bug.cgi?id=1365721 > > > > The reason for this bug is that the memory region created by mmap() > > on the dax-based file was gone so that the region can not be found > > in /proc/self/smaps during the runtime. > > > > This is a simple way to trigger this issue: > > mount -o dax /dev/pmem0 /mnt/pmem/ > > vim /mnt/pmem/xxx > > then 'vim' is crashed due to segment fault. > > > > This bug can be reproduced on your tree, the top commit is > > 10d7902fa0e82b (dax: unmap/truncate on device shutdown), the kernel > > configure file is attached. > > > > Your thought or comment is highly appreciated. > > I'm going to be offline until Tuesday, but I will investigate when I'm > back. In the meantime if Ross or Vishal had an opportunity to take a > look I wouldn't say "no" :). I haven't been able to reproduce this vim segfault. I'm using QEMU v2.6.0, and the kernel commit you mentioned, and your kernel config. Here's my QEMU command line: sudo ~/qemu/bin/qemu-system-x86_64 /var/lib/libvirt/images/alara.qcow2 \ -machine pc,nvdimm -m 8G,maxmem=100G,slots=100 -object \ memory-backend-file,id=mem1,share,mem-path=/dev/pmem0,size=8G -device \ nvdimm,memdev=mem1,id=nv1 -smp 6 -machine pc,accel=kvm With this I'm able to mkfs the guest's /dev/pmem0, mount it with -o dax, and write a file with vim. Can you reproduce your results with a pmem device created via a memmap kernel command line parameter in the guest? You'll need to update your kernel config to enable CONFIG_X86_PMEM_LEGACY and CONFIG_X86_PMEM_LEGACY_DEVICE.