forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'libnvdimm-for-4.18' of git://git.kernel.org/pub/scm/linux/…
…kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: "This adds a user for the new 'bytes-remaining' updates to memcpy_mcsafe() that you already received through Ingo via the x86-dax- for-linus pull. Not included here, but still targeting this cycle, is support for handling memory media errors (poison) consumed via userspace dax mappings. Summary: - DAX broke a fundamental assumption of truncate of file mapped pages. The truncate path assumed that it is safe to disconnect a pinned page from a file and let the filesystem reclaim the physical block. With DAX the page is equivalent to the filesystem block. Introduce dax_layout_busy_page() to enable filesystems to wait for pinned DAX pages to be released. Without this wait a filesystem could allocate blocks under active device-DMA to a new file. - DAX arranges for the block layer to be bypassed and uses dax_direct_access() + copy_to_iter() to satisfy read(2) calls. However, the memcpy_mcsafe() facility is available through the pmem block driver. In order to safely handle media errors, via the DAX block-layer bypass, introduce copy_to_iter_mcsafe(). - Fix cache management policy relative to the ACPI NFIT Platform Capabilities Structure to properly elide cache flushes when they are not necessary. The table indicates whether CPU caches are power-fail protected. Clarify that a deep flush is always performed on REQ_{FUA,PREFLUSH} requests" * tag 'libnvdimm-for-4.18' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: (21 commits) dax: Use dax_write_cache* helpers libnvdimm, pmem: Do not flush power-fail protected CPU caches libnvdimm, pmem: Unconditionally deep flush on *sync libnvdimm, pmem: Complete REQ_FLUSH => REQ_PREFLUSH acpi, nfit: Remove ecc_unit_size dax: dax_insert_mapping_entry always succeeds libnvdimm, e820: Register all pmem resources libnvdimm: Debug probe times linvdimm, pmem: Preserve read-only setting for pmem devices x86, nfit_test: Add unit test for memcpy_mcsafe() pmem: Switch to copy_to_iter_mcsafe() dax: Report bytes remaining in dax_iomap_actor() dax: Introduce a ->copy_to_iter dax operation uio, lib: Fix CONFIG_ARCH_HAS_UACCESS_MCSAFE compilation xfs, dax: introduce xfs_break_dax_layouts() xfs: prepare xfs_break_layouts() for another layout type xfs: prepare xfs_break_layouts() to be called with XFS_MMAPLOCK_EXCL mm, fs, dax: handle layout changes to pinned dax mappings mm: fix __gup_device_huge vs unmap mm: introduce MEMORY_DEVICE_FS_DAX and CONFIG_DEV_PAGEMAP_OPS ...
- Loading branch information
Showing
40 changed files
with
924 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
What: /sys/bus/nd/devices/regionX/nfit/ecc_unit_size | ||
Date: Aug, 2017 | ||
KernelVersion: v4.14 (Removed v4.18) | ||
Contact: [email protected] | ||
Description: | ||
(RO) Size of a write request to a DIMM that will not incur a | ||
read-modify-write cycle at the memory controller. | ||
|
||
When the nfit driver initializes it runs an ARS (Address Range | ||
Scrub) operation across every pmem range. Part of that process | ||
involves determining the ARS capabilities of a given address | ||
range. One of the capabilities that is reported is the 'Clear | ||
Uncorrectable Error Range Length Unit Size' (see: ACPI 6.2 | ||
section 9.20.7.4 Function Index 1 - Query ARS Capabilities). | ||
This property indicates the boundary at which the NVDIMM may | ||
need to perform read-modify-write cycles to maintain ECC (Error | ||
Correcting Code) blocks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,22 +212,3 @@ Description: | |
range. Used by NVDIMM Region Mapping Structure to uniquely refer | ||
to this structure. Value of 0 is reserved and not used as an | ||
index. | ||
|
||
|
||
What: /sys/bus/nd/devices/regionX/nfit/ecc_unit_size | ||
Date: Aug, 2017 | ||
KernelVersion: v4.14 | ||
Contact: [email protected] | ||
Description: | ||
(RO) Size of a write request to a DIMM that will not incur a | ||
read-modify-write cycle at the memory controller. | ||
|
||
When the nfit driver initializes it runs an ARS (Address Range | ||
Scrub) operation across every pmem range. Part of that process | ||
involves determining the ARS capabilities of a given address | ||
range. One of the capabilities that is reported is the 'Clear | ||
Uncorrectable Error Range Length Unit Size' (see: ACPI 6.2 | ||
section 9.20.7.4 Function Index 1 - Query ARS Capabilities). | ||
This property indicates the boundary at which the NVDIMM may | ||
need to perform read-modify-write cycles to maintain ECC (Error | ||
Correcting Code) blocks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* SPDX-License-Identifier: GPL-2.0 */ | ||
#ifndef _MCSAFE_TEST_H_ | ||
#define _MCSAFE_TEST_H_ | ||
|
||
#ifndef __ASSEMBLY__ | ||
#ifdef CONFIG_MCSAFE_TEST | ||
extern unsigned long mcsafe_test_src; | ||
extern unsigned long mcsafe_test_dst; | ||
|
||
static inline void mcsafe_inject_src(void *addr) | ||
{ | ||
if (addr) | ||
mcsafe_test_src = (unsigned long) addr; | ||
else | ||
mcsafe_test_src = ~0UL; | ||
} | ||
|
||
static inline void mcsafe_inject_dst(void *addr) | ||
{ | ||
if (addr) | ||
mcsafe_test_dst = (unsigned long) addr; | ||
else | ||
mcsafe_test_dst = ~0UL; | ||
} | ||
#else /* CONFIG_MCSAFE_TEST */ | ||
static inline void mcsafe_inject_src(void *addr) | ||
{ | ||
} | ||
|
||
static inline void mcsafe_inject_dst(void *addr) | ||
{ | ||
} | ||
#endif /* CONFIG_MCSAFE_TEST */ | ||
|
||
#else /* __ASSEMBLY__ */ | ||
#include <asm/export.h> | ||
|
||
#ifdef CONFIG_MCSAFE_TEST | ||
.macro MCSAFE_TEST_CTL | ||
.pushsection .data | ||
.align 8 | ||
.globl mcsafe_test_src | ||
mcsafe_test_src: | ||
.quad 0 | ||
EXPORT_SYMBOL_GPL(mcsafe_test_src) | ||
.globl mcsafe_test_dst | ||
mcsafe_test_dst: | ||
.quad 0 | ||
EXPORT_SYMBOL_GPL(mcsafe_test_dst) | ||
.popsection | ||
.endm | ||
|
||
.macro MCSAFE_TEST_SRC reg count target | ||
leaq \count(\reg), %r9 | ||
cmp mcsafe_test_src, %r9 | ||
ja \target | ||
.endm | ||
|
||
.macro MCSAFE_TEST_DST reg count target | ||
leaq \count(\reg), %r9 | ||
cmp mcsafe_test_dst, %r9 | ||
ja \target | ||
.endm | ||
#else | ||
.macro MCSAFE_TEST_CTL | ||
.endm | ||
|
||
.macro MCSAFE_TEST_SRC reg count target | ||
.endm | ||
|
||
.macro MCSAFE_TEST_DST reg count target | ||
.endm | ||
#endif /* CONFIG_MCSAFE_TEST */ | ||
#endif /* __ASSEMBLY__ */ | ||
#endif /* _MCSAFE_TEST_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.