<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/dax, branch v4.9</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v4.9</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.9'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-12-07T01:42:37Z</updated>
<entry>
<title>device-dax: fix private mapping restriction, permit read-only</title>
<updated>2016-12-07T01:42:37Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-12-07T01:03:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=325896ffdf90f7cbd59fb873b7ba20d60d1ddf3c'/>
<id>urn:sha1:325896ffdf90f7cbd59fb873b7ba20d60d1ddf3c</id>
<content type='text'>
Hugh notes in response to commit 4cb19355ea19 "device-dax: fail all
private mapping attempts":

  "I think that is more restrictive than you intended: haven't tried, but I
  believe it rejects a PROT_READ, MAP_SHARED, O_RDONLY fd mmap, leaving no
  way to mmap /dev/dax without write permission to it."

Indeed it does restrict read-only mappings, switch to checking
VM_MAYSHARE, not VM_SHARED.

Cc: &lt;stable@vger.kernel.org&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Cc: Pawel Lebioda &lt;pawel.lebioda@intel.com&gt;
Fixes: 4cb19355ea19 ("device-dax: fail all private mapping attempts")
Reported-by: Hugh Dickins &lt;hughd@google.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>device-dax: fail all private mapping attempts</title>
<updated>2016-11-16T17:00:38Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-11-16T17:00:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4cb19355ea19995941ccaad115dbfac6b75215ca'/>
<id>urn:sha1:4cb19355ea19995941ccaad115dbfac6b75215ca</id>
<content type='text'>
The device-dax implementation originally tried to be tricky and allow
private read-only mappings, but in the process allowed writable
MAP_PRIVATE + MAP_NORESERVE mappings.  For simplicity and predictability
just fail all private mapping attempts since device-dax memory is
statically allocated and will never support overcommit.

Cc: &lt;stable@vger.kernel.org&gt;
Cc: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Fixes: dee410792419 ("/dev/dax, core: file operations and dax-mmap")
Reported-by: Pawel Lebioda &lt;pawel.lebioda@intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>device-dax: check devm_nsio_enable() return value</title>
<updated>2016-10-28T21:35:25Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-10-28T21:34:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6a84fb4b4e439a8ef0ce19ec7e7661ad76f655c9'/>
<id>urn:sha1:6a84fb4b4e439a8ef0ce19ec7e7661ad76f655c9</id>
<content type='text'>
If the dax_pmem driver is passed a resource that is already busy the
driver probe attempt should fail with a message like the following:

  dax_pmem dax0.1: could not reserve region [mem 0x100000000-0x11fffffff]

However, if we do not catch the error we crash for the obvious reason of
accessing memory that is not mapped.

 BUG: unable to handle kernel paging request at ffffc90020001000
 IP: [&lt;ffffffff81496712&gt;] __memcpy+0x12/0x20
 [..]
 Call Trace:
  [&lt;ffffffff815c4960&gt;] ? nsio_rw_bytes+0x60/0x180
  [&lt;ffffffff815c6045&gt;] nd_pfn_validate+0x75/0x320
  [&lt;ffffffff815c63a9&gt;] nvdimm_setup_pfn+0xb9/0x5d0
  [&lt;ffffffff815c48ef&gt;] ? devm_nsio_enable+0xff/0x110
  [&lt;ffffffff815cb699&gt;] dax_pmem_probe+0x59/0x260

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: ab68f2622136 ("/dev/dax, pmem: direct access to persistent memory")
Reported-by: Dave Hansen &lt;dave.hansen@linux.intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>device-dax: fix percpu_ref_exit ordering</title>
<updated>2016-10-28T00:04:05Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-10-28T00:04:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=52e73eb2872c9af6f382b2b22954ca8214397a4e'/>
<id>urn:sha1:52e73eb2872c9af6f382b2b22954ca8214397a4e</id>
<content type='text'>
We need to wait until the percpu_ref is released before exit. Otherwise,
we sometimes lose the race and trigger this new warning that was added
in v4.9 (commit a67823c1ed10 "percpu-refcount: init -&gt;confirm_switch
member properly"):

 WARNING: CPU: 0 PID: 3629 at lib/percpu-refcount.c:107 percpu_ref_exit+0x51/0x60
 [..]
 Call Trace:
  [&lt;ffffffff814bf093&gt;] dump_stack+0x85/0xc2
  [&lt;ffffffff810b15db&gt;] __warn+0xcb/0xf0
  [&lt;ffffffff810b170d&gt;] warn_slowpath_null+0x1d/0x20
  [&lt;ffffffff814d70c1&gt;] percpu_ref_exit+0x51/0x60
  [&lt;ffffffffa005706a&gt;] dax_pmem_percpu_exit+0x1a/0x50 [dax_pmem]
  [&lt;ffffffff81615f1f&gt;] devm_action_release+0xf/0x20

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: ab68f2622136 ("/dev/dax, pmem: direct access to persistent memory")
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>nvdimm: make CONFIG_NVDIMM_DAX 'bool'</title>
<updated>2016-10-27T23:16:21Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-10-25T15:52:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=867dfe342118b1ea0256a85f7c0d9ceb0ead032a'/>
<id>urn:sha1:867dfe342118b1ea0256a85f7c0d9ceb0ead032a</id>
<content type='text'>
A bugfix just tried to address a randconfig build problem and introduced
a variant of the same problem: with CONFIG_LIBNVDIMM=y and
CONFIG_NVDIMM_DAX=m, the nvdimm module now fails to link:

drivers/nvdimm/built-in.o: In function `to_nd_device_type':
bus.c:(.text+0x1b5d): undefined reference to `is_nd_dax'
drivers/nvdimm/built-in.o: In function `nd_region_notify_driver_action.constprop.2':
region_devs.c:(.text+0x6b6c): undefined reference to `is_nd_dax'
region_devs.c:(.text+0x6b8c): undefined reference to `to_nd_dax'
drivers/nvdimm/built-in.o: In function `nd_region_probe':
region.c:(.text+0x70f3): undefined reference to `nd_dax_create'
drivers/nvdimm/built-in.o: In function `mode_show':
namespace_devs.c:(.text+0xa196): undefined reference to `is_nd_dax'
drivers/nvdimm/built-in.o: In function `nvdimm_namespace_common_probe':
(.text+0xa55f): undefined reference to `is_nd_dax'
drivers/nvdimm/built-in.o: In function `nvdimm_namespace_common_probe':
(.text+0xa56e): undefined reference to `to_nd_dax'

This reverts the earlier fix, making NVDIMM_DAX a 'bool' option again
as it should be (it gets linked into the libnvdimm module). To fix
the original problem, I'm adding a dependency on LIBNVDIMM to
DEV_DAX_PMEM, which ensures we can't have that one built-in if the
rest is a module.

Fixes: 4e65e9381c7a ("/dev/dax: fix Kconfig dependency build breakage")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: Ross Zwisler &lt;ross.zwisler@linux.intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-4.9/dax' into libnvdimm-for-next</title>
<updated>2016-10-07T23:46:30Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-10-07T23:46:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e476f94482fc20a23b7b33b3d8e50f1953f71828'/>
<id>urn:sha1:e476f94482fc20a23b7b33b3d8e50f1953f71828</id>
<content type='text'>
</content>
</entry>
<entry>
<title>dax: use correct dev_t value</title>
<updated>2016-10-07T23:46:00Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-09-08T13:53:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc0a0fe94f33dd15edf2ed555bfc4d6dbb5e1995'/>
<id>urn:sha1:bc0a0fe94f33dd15edf2ed555bfc4d6dbb5e1995</id>
<content type='text'>
The dev_t variable in devm_create_dax_dev() is used before it's
first set:

drivers/dax/dax.c: In function 'devm_create_dax_dev':
drivers/dax/dax.c:205:39: error: 'dev_t' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  inode = iget5_locked(dax_superblock, hash_32(devt + DAXFS_MAGIC, 31),
                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/dax/dax.c:688:8: note: 'dev_t' was declared here

This reorders the code to how it looks correct to me.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Fixes: 3bc52c45bac2 ("dax: define a unified inode/address_space for device-dax mappings")
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dax: convert devm_create_dax_dev to PTR_ERR</title>
<updated>2016-10-07T23:45:59Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-07-20T00:51:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d76911ee933a64c9dfc453e580e7ad612b394e83'/>
<id>urn:sha1:d76911ee933a64c9dfc453e580e7ad612b394e83</id>
<content type='text'>
For sub-division support we need access to the dax_dev created by
devm_create_dax_dev().

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dax: fix mapping size check</title>
<updated>2016-09-03T17:40:57Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-09-03T17:36:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4c3cb6e9a9d94d1553807854a565cd27ff4c22aa'/>
<id>urn:sha1:4c3cb6e9a9d94d1553807854a565cd27ff4c22aa</id>
<content type='text'>
pgoff_to_phys() validates that both the starting address and the length
of the mapping against the resource list.  We need to check for a
mapping size of PMD_SIZE not PAGE_SIZE in the pmd fault path.

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
</content>
</entry>
<entry>
<title>dax: fix device-dax region base</title>
<updated>2016-08-27T00:39:35Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2016-08-25T22:17:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d0e5845561c238619de9f5b77e0d763f4c331ca5'/>
<id>urn:sha1:d0e5845561c238619de9f5b77e0d763f4c331ca5</id>
<content type='text'>
The data offset for a dax region needs to account for a reservation in
the resource range.  Otherwise, device-dax is allowing mappings directly
into the memmap or device-info-block area with crash signatures like the
following:

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
 IP: get_zone_device_page+0x11/0x30
 Call Trace:
   follow_devmap_pmd+0x298/0x2c0
   follow_page_mask+0x275/0x530
   __get_user_pages+0xe3/0x750
   __gfn_to_pfn_memslot+0x1b2/0x450 [kvm]
   tdp_page_fault+0x130/0x280 [kvm]
   kvm_mmu_page_fault+0x5f/0xf0 [kvm]
   handle_ept_violation+0x94/0x180 [kvm_intel]
   vmx_handle_exit+0x1d3/0x1440 [kvm_intel]
   kvm_arch_vcpu_ioctl_run+0x81d/0x16a0 [kvm]
   kvm_vcpu_ioctl+0x33c/0x620 [kvm]
   do_vfs_ioctl+0xa2/0x5d0
   SyS_ioctl+0x79/0x90
   entry_SYSCALL_64_fastpath+0x1a/0xa4

Fixes: ab68f2622136 ("/dev/dax, pmem: direct access to persistent memory")
Link: http://lkml.kernel.org/r/147205536732.1606.8994275381938837346.stgit@dwillia2-desk3.amr.corp.intel.com
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Reported-by: Abhilash Kumar Mulumudi &lt;m.abhilash-kumar@hpe.com&gt;
Reported-by: Toshi Kani &lt;toshi.kani@hpe.com&gt;
Tested-by: Toshi Kani &lt;toshi.kani@hpe.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
