Merge tag 'dma-mapping-6.8-2024-01-18' of git://git.infradead.org/users/hch/dma-mapping
[linux-block.git] / drivers / nvdimm / Kconfig
CommitLineData
ec8f24b7 1# SPDX-License-Identifier: GPL-2.0-only
18da2c9e 2menuconfig LIBNVDIMM
b94d5230
DW
3 tristate "NVDIMM (Non-Volatile Memory Device) Support"
4 depends on PHYS_ADDR_T_64BIT
29b9aa0a 5 depends on HAS_IOMEM
b94d5230 6 depends on BLK_DEV
33dd7075 7 select MEMREGION
b94d5230
DW
8 help
9 Generic support for non-volatile memory devices including
10 ACPI-6-NFIT defined resources. On platforms that define an
11 NFIT, or otherwise can discover NVDIMM resources, a libnvdimm
12 bus is registered to advertise PMEM (persistent memory)
f8669f1d 13 namespaces (/dev/pmemX). A PMEM namespace refers to a
5212e11f 14 memory resource that may span multiple DIMMs and support DAX
f8669f1d 15 (see CONFIG_DAX).
18da2c9e
DW
16
17if LIBNVDIMM
18
19config BLK_DEV_PMEM
20 tristate "PMEM: Persistent memory block device support"
21 default LIBNVDIMM
afd586f0 22 select DAX
5212e11f 23 select ND_BTT if BTT
e1455744 24 select ND_PFN if NVDIMM_PFN
18da2c9e
DW
25 help
26 Memory ranges for PMEM are described by either an NFIT
27 (NVDIMM Firmware Interface Table, see CONFIG_NFIT_ACPI), a
28 non-standard OEM-specific E820 memory type (type-12, see
29 CONFIG_X86_PMEM_LEGACY), or it is manually specified by the
30 'memmap=nn[KMG]!ss[KMG]' kernel command line (see
8c27ceff 31 Documentation/admin-guide/kernel-parameters.rst). This driver converts
18da2c9e
DW
32 these persistent memory ranges into block devices that are
33 capable of DAX (direct-access) file system mappings. See
ae4a0502 34 Documentation/driver-api/nvdimm/nvdimm.rst for more details.
18da2c9e
DW
35
36 Say Y if you want to use an NVDIMM
37
e1455744
DW
38config ND_CLAIM
39 bool
40
5212e11f
VV
41config ND_BTT
42 tristate
43
8c2f7e86 44config BTT
5212e11f
VV
45 bool "BTT: Block Translation Table (atomic sector updates)"
46 default y if LIBNVDIMM
e1455744 47 select ND_CLAIM
5212e11f
VV
48 help
49 The Block Translation Table (BTT) provides atomic sector
50 update semantics for persistent memory devices, so that
51 applications that rely on sector writes not being torn (a
52 guarantee that typical disks provide) can continue to do so.
53 The BTT manifests itself as an alternate personality for an
f8669f1d
DW
54 NVDIMM namespace, i.e. a namespace can be in raw mode pmemX,
55 or 'sectored' mode.
5212e11f
VV
56
57 Select Y if unsure
8c2f7e86 58
e1455744
DW
59config ND_PFN
60 tristate
61
62config NVDIMM_PFN
63 bool "PFN: Map persistent (device) memory"
64 default LIBNVDIMM
32ab0a3f 65 depends on ZONE_DEVICE
e1455744
DW
66 select ND_CLAIM
67 help
68 Map persistent memory, i.e. advertise it to the memory
69 management sub-system. By default persistent memory does
70 not support direct I/O, RDMA, or any other usage that
71 requires a 'struct page' to mediate an I/O request. This
72 driver allocates and initializes the infrastructure needed
73 to support those use cases.
74
75 Select Y if unsure
76
cd03412a 77config NVDIMM_DAX
867dfe34 78 bool "NVDIMM DAX: Raw access to persistent memory"
cd03412a
DW
79 default LIBNVDIMM
80 depends on NVDIMM_PFN
81 help
82 Support raw device dax access to a persistent memory
83 namespace. For environments that want to hard partition
83fc61a5 84 persistent memory, this capability provides a mechanism to
cd03412a
DW
85 sub-divide a namespace into character devices that can only be
86 accessed via DAX (mmap(2)).
87
88 Select Y if unsure
89
71719760 90config OF_PMEM
f22acf82 91 tristate "Device-tree support for persistent memory regions"
71719760
OH
92 depends on OF
93 default LIBNVDIMM
94 help
95 Allows regions of persistent memory to be described in the
96 device-tree.
97
98 Select Y if unsure.
99
4c6926a2
DJ
100config NVDIMM_KEYS
101 def_bool y
102 depends on ENCRYPTED_KEYS
103 depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m
104
c91d7136
DW
105config NVDIMM_KMSAN
106 bool
107 depends on KMSAN
108 help
109 KMSAN, and other memory debug facilities, increase the size of
110 'struct page' to contain extra metadata. This collides with
111 the NVDIMM capability to store a potentially
112 larger-than-"System RAM" size 'struct page' array in a
113 reservation of persistent memory rather than limited /
114 precious DRAM. However, that reservation needs to persist for
115 the life of the given NVDIMM namespace. If you are using KMSAN
116 to debug an issue unrelated to NVDIMMs or DAX then say N to this
117 option. Otherwise, say Y but understand that any namespaces
118 (with the page array stored pmem) created with this build of
119 the kernel will permanently reserve and strand excess
120 capacity compared to the CONFIG_KMSAN=n case.
121
122 Select N if unsure.
123
62974fc3
DW
124config NVDIMM_TEST_BUILD
125 tristate "Build the unit test core"
126 depends on m
127 depends on COMPILE_TEST && X86_64
128 default m if COMPILE_TEST
129 help
130 Build the core of the unit test infrastructure. The result of
131 this build is non-functional for unit test execution, but it
132 otherwise helps catch build errors induced by changes to the
133 core devm_memremap_pages() implementation and other
134 infrastructure.
135
15a83487
DJ
136config NVDIMM_SECURITY_TEST
137 bool "Enable NVDIMM security unit tests"
138 depends on NVDIMM_KEYS
139 help
140 The NVDIMM and CXL subsystems support unit testing of their device
141 security state machines. The NVDIMM_SECURITY_TEST option disables CPU
142 cache maintenance operations around events like secure erase and
143 overwrite. Also, when enabled, the NVDIMM subsystem core helps the unit
144 test implement a mock state machine.
145
146 Select N if unsure.
147
18da2c9e 148endif