linux/drivers/nvdimm
Dan Williams 96601adb74 x86, pmem: clarify that ARCH_HAS_PMEM_API implies PMEM mapped WB
Given that a write-back (WB) mapping plus non-temporal stores is
expected to be the most efficient way to access PMEM, update the
definition of ARCH_HAS_PMEM_API to imply arch support for
WB-mapped-PMEM.  This is needed as a pre-requisite for adding PMEM to
the direct map and mapping it with struct page.

The above clarification for X86_64 means that memcpy_to_pmem() is
permitted to use the non-temporal arch_memcpy_to_pmem() rather than
needlessly fall back to default_memcpy_to_pmem() when the pcommit
instruction is not available.  When arch_memcpy_to_pmem() is not
guaranteed to flush writes out of cache, i.e. on older X86_32
implementations where non-temporal stores may just dirty cache,
ARCH_HAS_PMEM_API is simply disabled.

The default fall back for persistent memory handling remains.  Namely,
map it with the WT (write-through) cache-type and hope for the best.

arch_has_pmem_api() is updated to only indicate whether the arch
provides the proper helpers to meet the minimum "writes are visible
outside the cache hierarchy after memcpy_to_pmem() + wmb_pmem()".  Code
that cares whether wmb_pmem() actually flushes writes to pmem must now
call arch_has_wmb_pmem() directly.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
[hch: set ARCH_HAS_PMEM_API=n on x86_32]
Reviewed-by: Christoph Hellwig <hch@lst.de>
[toshi: x86_32 compile fixes]
Signed-off-by: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2015-08-27 19:40:59 -04:00
..
blk.c libnvdimm, nfit: handle unarmed dimms, mark namespaces read-only 2015-06-26 11:23:38 -04:00
btt_devs.c libnvdimm, btt: write and validate parent_uuid 2015-08-14 13:43:04 -04:00
btt.c libnvdimm, btt: write and validate parent_uuid 2015-08-14 13:43:04 -04:00
btt.h libnvdimm, btt: consolidate arena validation 2015-08-14 13:43:04 -04:00
bus.c nvdimm: Fix return value of nvdimm_bus_init() if class_create() fails 2015-06-30 14:30:34 -04:00
core.c libnvdimm: enable iostat 2015-06-26 11:23:38 -04:00
dimm_devs.c nvdimm: change to use generic kvfree() 2015-08-27 19:35:48 -04:00
dimm.c libnvdimm: pmem label sets and namespace instantiation. 2015-06-24 21:24:10 -04:00
e820.c libnvdimm, e820: make CONFIG_X86_PMEM_LEGACY a tristate option 2015-08-19 00:34:34 -04:00
Kconfig libnvdimm, nfit, nd_blk: driver for BLK-mode access persistent memory 2015-06-26 11:23:38 -04:00
label.c libnvdimm: infrastructure for btt devices 2015-06-25 04:20:04 -04:00
label.h libnvdimm: write blk label set 2015-06-24 21:24:10 -04:00
Makefile libnvdimm, e820: make CONFIG_X86_PMEM_LEGACY a tristate option 2015-08-19 00:34:34 -04:00
namespace_devs.c libnvdimm, btt: write and validate parent_uuid 2015-08-14 13:43:04 -04:00
nd-core.h libnvdimm, nfit, nd_blk: driver for BLK-mode access persistent memory 2015-06-26 11:23:38 -04:00
nd.h libnvdimm, btt: write and validate parent_uuid 2015-08-14 13:43:04 -04:00
pmem.c x86, pmem: clarify that ARCH_HAS_PMEM_API implies PMEM mapped WB 2015-08-27 19:40:59 -04:00
region_devs.c libnvdimm: fix namespace seed creation 2015-07-25 09:57:56 -07:00
region.c libnvdimm, nfit, nd_blk: driver for BLK-mode access persistent memory 2015-06-26 11:23:38 -04:00