# SPDX-License-Identifier: GPL-2.0-only
menuconfig [31mCONFIG_LIBNVDIMM[0m
tristate "NVDIMM (Non-Volatile Memory Device) Support"
depends on [31mCONFIG_PHYS_ADDR_T_64BIT[0m
depends on [31mCONFIG_HAS_IOMEM[0m
depends on [31mCONFIG_BLK_DEV[0m
help
Generic support for non-volatile memory devices including
[31mCONFIG_ACPI[0m-6-NFIT defined resources. On platforms that define an
NFIT, or otherwise can discover NVDIMM resources, a libnvdimm
bus is registered to advertise PMEM (persistent memory)
namespaces (/dev/pmemX) and BLK (sliding mmio window(s))
namespaces (/dev/ndblkX.Y). [31mCONFIG_A[0m PMEM namespace refers to a
memory resource that may span multiple DIMMs and support [31mCONFIG_DAX[0m
(see CONFIG_DAX). [31mCONFIG_A[0m BLK namespace refers to an NVDIMM control
region which exposes an mmio register set for windowed access
mode to non-volatile memory.
if [31mCONFIG_LIBNVDIMM[0m
config [31mCONFIG_BLK_DEV_PMEM[0m
tristate "PMEM: Persistent memory block device support"
default [31mCONFIG_LIBNVDIMM[0m
select [31mCONFIG_DAX_DRIVER[0m
select [31mCONFIG_ND_BTT[0m if [31mCONFIG_BTT[0m
select [31mCONFIG_ND_PFN[0m if [31mCONFIG_NVDIMM_PFN[0m
help
Memory ranges for PMEM are described by either an NFIT
(NVDIMM Firmware Interface Table, see CONFIG_NFIT_ACPI), a
non-standard OEM-specific E820 memory type (type-12, see
CONFIG_X86_PMEM_LEGACY), or it is manually specified by the
'memmap=nn[KMG]!ss[KMG]' kernel command line (see
Documentation/admin-guide/kernel-parameters.rst). This driver converts
these persistent memory ranges into block devices that are
capable of [31mCONFIG_DAX[0m (direct-access) file system mappings. See
Documentation/driver-api/nvdimm/nvdimm.rst for more details.
Say Y if you want to use an NVDIMM
config [31mCONFIG_ND_BLK[0m
tristate "BLK: Block data window (aperture) device support"
default [31mCONFIG_LIBNVDIMM[0m
select [31mCONFIG_ND_BTT[0m if [31mCONFIG_BTT[0m
help
Support NVDIMMs, or other devices, that implement a BLK-mode
access capability. BLK-mode access uses memory-mapped-i/o
apertures to access persistent media.
Say Y if your platform firmware emits an [31mCONFIG_ACPI[0m.NFIT table
(CONFIG_ACPI_NFIT), or otherwise exposes BLK-mode
capabilities.
config [31mCONFIG_ND_CLAIM[0m
bool
config [31mCONFIG_ND_BTT[0m
tristate
config [31mCONFIG_BTT[0m
bool "BTT: Block Translation Table (atomic sector updates)"
default y if [31mCONFIG_LIBNVDIMM[0m
select [31mCONFIG_ND_CLAIM[0m
help
The Block Translation Table ([31mCONFIG_BTT[0m) provides atomic sector
update semantics for persistent memory devices, so that
applications that rely on sector writes not being torn (a
guarantee that typical disks provide) can continue to do so.
The [31mCONFIG_BTT[0m manifests itself as an alternate personality for an
NVDIMM namespace, i.e. a namespace can be in raw mode (pmemX,
ndblkX.Y, etc...), or 'sectored' mode, (pmemXs, ndblkX.Ys,
etc...).
Select Y if unsure
config [31mCONFIG_ND_PFN[0m
tristate
config [31mCONFIG_NVDIMM_PFN[0m
bool "PFN: Map persistent (device) memory"
default [31mCONFIG_LIBNVDIMM[0m
depends on [31mCONFIG_ZONE_DEVICE[0m
select [31mCONFIG_ND_CLAIM[0m
help
Map persistent memory, i.e. advertise it to the memory
management sub-system. By default persistent memory does
not support direct I/O, RDMA, or any other usage that
requires a 'struct page' to mediate an I/O request. This
driver allocates and initializes the infrastructure needed
to support those use cases.
Select Y if unsure
config [31mCONFIG_NVDIMM_DAX[0m
bool "NVDIMM DAX: Raw access to persistent memory"
default [31mCONFIG_LIBNVDIMM[0m
depends on [31mCONFIG_NVDIMM_PFN[0m
help
Support raw device dax access to a persistent memory
namespace. For environments that want to hard partition
persistent memory, this capability provides a mechanism to
sub-divide a namespace into character devices that can only be
accessed via [31mCONFIG_DAX[0m (mmap(2)).
Select Y if unsure
config [31mCONFIG_OF_PMEM[0m
tristate "Device-tree support for persistent memory regions"
depends on [31mCONFIG_OF[0m
default [31mCONFIG_LIBNVDIMM[0m
help
Allows regions of persistent memory to be described in the
device-tree.
Select Y if unsure.
config [31mCONFIG_NVDIMM_KEYS[0m
def_bool y
depends on [31mCONFIG_ENCRYPTED_KEYS[0m
depends on ([31mCONFIG_LIBNVDIMM[0m=[31mCONFIG_ENCRYPTED_KEYS[0m) || [31mCONFIG_LIBNVDIMM[0m=m
config [31mCONFIG_NVDIMM_TEST_BUILD[0m
tristate "Build the unit test core"
depends on m
depends on [31mCONFIG_COMPILE_TEST[0m && [31mCONFIG_X86_64[0m
default m if [31mCONFIG_COMPILE_TEST[0m
help
Build the core of the unit test infrastructure. The result of
this build is non-functional for unit test execution, but it
otherwise helps catch build errors induced by changes to the
core devm_memremap_pages() implementation and other
infrastructure.
endif