From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlq8k-0000qy-5M for qemu-devel@nongnu.org; Mon, 12 Oct 2015 23:20:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zlq8g-000440-Ng for qemu-devel@nongnu.org; Mon, 12 Oct 2015 23:20:37 -0400 Received: from mga14.intel.com ([192.55.52.115]:45351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zlq8g-00042V-HR for qemu-devel@nongnu.org; Mon, 12 Oct 2015 23:20:34 -0400 References: <1444535584-18220-1-git-send-email-guangrong.xiao@linux.intel.com> <561B3816.4020102@linux.intel.com> From: Xiao Guangrong Message-ID: <561C770D.8010606@linux.intel.com> Date: Tue, 13 Oct 2015 11:14:21 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 00/32] implement vNVDIMM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Dan Williams Cc: ehabkost@redhat.com, KVM list , "Michael S. Tsirkin" , Gleb Natapov , mtosatti@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, Paolo Bonzini , imammedo@redhat.com, rth@twiddle.net On 10/13/2015 12:36 AM, Dan Williams wrote: > On Sun, Oct 11, 2015 at 9:33 PM, Xiao Guangrong > wrote: >> >> >> On 10/11/2015 05:17 AM, Dan Williams wrote: >>> >>> On Sat, Oct 10, 2015 at 8:52 PM, Xiao Guangrong >>> wrote: >>> [..] >>>> >>>> ====== Test ====== >>>> In host >>>> 1) create memory backed file, e.g # dd if=zero of=/tmp/nvdimm bs=1G >>>> count=10 >>>> 2) append "-object memory-backend-file,share,id=mem1, >>>> mem-path=/tmp/nvdimm -device nvdimm,memdev=mem1,reserve-label-data, >>>> id=nv1" in QEMU command line >>>> >>>> In guest, download the latest upsteam kernel (4.2 merge window) and >>>> enable >>>> ACPI_NFIT, LIBNVDIMM and BLK_DEV_PMEM. >>>> 1) insmod drivers/nvdimm/libnvdimm.ko >>>> 2) insmod drivers/acpi/nfit.ko >>>> 3) insmod drivers/nvdimm/nd_btt.ko >>>> 4) insmod drivers/nvdimm/nd_pmem.ko >>>> You can see the whole nvdimm device used as a single namespace and >>>> /dev/pmem0 >>>> appears. You can do whatever on /dev/pmem0 including DAX access. >>>> >>>> Currently Linux NVDIMM driver does not support namespace operation on >>>> this >>>> kind of PMEM, apply below changes to support dynamical namespace: >>>> >>>> @@ -798,7 +823,8 @@ static int acpi_nfit_register_dimms(struct >>>> acpi_nfit_desc *a >>>> continue; >>>> } >>>> >>>> - if (nfit_mem->bdw && nfit_mem->memdev_pmem) >>>> + //if (nfit_mem->bdw && nfit_mem->memdev_pmem) >>>> + if (nfit_mem->memdev_pmem) >>>> flags |= NDD_ALIASING; >>> >>> >>> This is just for testing purposes, right? I expect guests can >> >> >> It's used to validate NVDIMM _DSM method and static namespace following >> NVDIMM specs... > > Static namespaces can be emitted without a label. Linux needs this to > support existing "label-less" bare metal NVDIMMs. This is Linux specific? As i did not see it has been documented in the spec... > >>> sub-divide persistent memory capacity by partitioning the resulting >>> block device(s). >> >> >> I understand that it's a Linux design... Hmm, can the same expectation >> apply to PBLK? > > BLK-mode is a bit different as those namespaces have both configurable > sector-size and an optional BTT. It is possible to expect multiple > BLK namespaces per a given region with different settings. Okay, thanks for your nice explanation, Dan!