blob: b7d1eb38b27d464f15b610908ae1a7d8ac39b6a3 [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Dan Williams18da2c92015-06-09 14:13:37 -04002menuconfig LIBNVDIMM
Dan Williamsb94d5232015-05-19 22:54:31 -04003 tristate "NVDIMM (Non-Volatile Memory Device) Support"
4 depends on PHYS_ADDR_T_64BIT
Dan Williams29b9aa02016-06-06 17:42:38 -07005 depends on HAS_IOMEM
Dan Williamsb94d5232015-05-19 22:54:31 -04006 depends on BLK_DEV
Dan Williams33dd7072019-11-06 17:43:31 -08007 select MEMREGION
Dan Williamsb94d5232015-05-19 22:54:31 -04008 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)
13 namespaces (/dev/pmemX) and BLK (sliding mmio window(s))
Vishal Verma5212e112015-06-25 04:20:32 -040014 namespaces (/dev/ndblkX.Y). A PMEM namespace refers to a
15 memory resource that may span multiple DIMMs and support DAX
16 (see CONFIG_DAX). A BLK namespace refers to an NVDIMM control
17 region which exposes an mmio register set for windowed access
18 mode to non-volatile memory.
Dan Williams18da2c92015-06-09 14:13:37 -040019
20if LIBNVDIMM
21
22config BLK_DEV_PMEM
23 tristate "PMEM: Persistent memory block device support"
24 default LIBNVDIMM
Dan Williams2080e882018-03-29 17:20:39 -070025 select DAX_DRIVER
Vishal Verma5212e112015-06-25 04:20:32 -040026 select ND_BTT if BTT
Dan Williamse1455742015-07-30 17:57:47 -040027 select ND_PFN if NVDIMM_PFN
Dan Williams18da2c92015-06-09 14:13:37 -040028 help
29 Memory ranges for PMEM are described by either an NFIT
30 (NVDIMM Firmware Interface Table, see CONFIG_NFIT_ACPI), a
31 non-standard OEM-specific E820 memory type (type-12, see
32 CONFIG_X86_PMEM_LEGACY), or it is manually specified by the
33 'memmap=nn[KMG]!ss[KMG]' kernel command line (see
Mauro Carvalho Chehab8c27ceff32016-10-18 10:12:27 -020034 Documentation/admin-guide/kernel-parameters.rst). This driver converts
Dan Williams18da2c92015-06-09 14:13:37 -040035 these persistent memory ranges into block devices that are
36 capable of DAX (direct-access) file system mappings. See
Mauro Carvalho Chehabae4a0502019-06-18 16:32:31 -030037 Documentation/driver-api/nvdimm/nvdimm.rst for more details.
Dan Williams18da2c92015-06-09 14:13:37 -040038
39 Say Y if you want to use an NVDIMM
40
Ross Zwisler047fc8a2015-06-25 04:21:02 -040041config ND_BLK
42 tristate "BLK: Block data window (aperture) device support"
43 default LIBNVDIMM
44 select ND_BTT if BTT
45 help
46 Support NVDIMMs, or other devices, that implement a BLK-mode
47 access capability. BLK-mode access uses memory-mapped-i/o
48 apertures to access persistent media.
49
50 Say Y if your platform firmware emits an ACPI.NFIT table
51 (CONFIG_ACPI_NFIT), or otherwise exposes BLK-mode
52 capabilities.
53
Dan Williamse1455742015-07-30 17:57:47 -040054config ND_CLAIM
55 bool
56
Vishal Verma5212e112015-06-25 04:20:32 -040057config ND_BTT
58 tristate
59
Dan Williams8c2f7e82015-06-25 04:20:04 -040060config BTT
Vishal Verma5212e112015-06-25 04:20:32 -040061 bool "BTT: Block Translation Table (atomic sector updates)"
62 default y if LIBNVDIMM
Dan Williamse1455742015-07-30 17:57:47 -040063 select ND_CLAIM
Vishal Verma5212e112015-06-25 04:20:32 -040064 help
65 The Block Translation Table (BTT) provides atomic sector
66 update semantics for persistent memory devices, so that
67 applications that rely on sector writes not being torn (a
68 guarantee that typical disks provide) can continue to do so.
69 The BTT manifests itself as an alternate personality for an
70 NVDIMM namespace, i.e. a namespace can be in raw mode (pmemX,
71 ndblkX.Y, etc...), or 'sectored' mode, (pmemXs, ndblkX.Ys,
72 etc...).
73
74 Select Y if unsure
Dan Williams8c2f7e82015-06-25 04:20:04 -040075
Dan Williamse1455742015-07-30 17:57:47 -040076config ND_PFN
77 tristate
78
79config NVDIMM_PFN
80 bool "PFN: Map persistent (device) memory"
81 default LIBNVDIMM
Dan Williams32ab0a3f2015-08-01 02:16:37 -040082 depends on ZONE_DEVICE
Dan Williamse1455742015-07-30 17:57:47 -040083 select ND_CLAIM
84 help
85 Map persistent memory, i.e. advertise it to the memory
86 management sub-system. By default persistent memory does
87 not support direct I/O, RDMA, or any other usage that
88 requires a 'struct page' to mediate an I/O request. This
89 driver allocates and initializes the infrastructure needed
90 to support those use cases.
91
92 Select Y if unsure
93
Dan Williamscd034122016-03-11 10:15:36 -080094config NVDIMM_DAX
Arnd Bergmann867dfe32016-10-25 17:52:04 +020095 bool "NVDIMM DAX: Raw access to persistent memory"
Dan Williamscd034122016-03-11 10:15:36 -080096 default LIBNVDIMM
97 depends on NVDIMM_PFN
98 help
99 Support raw device dax access to a persistent memory
100 namespace. For environments that want to hard partition
Masanari Iida83fc61a2017-09-26 12:47:59 +0900101 persistent memory, this capability provides a mechanism to
Dan Williamscd034122016-03-11 10:15:36 -0800102 sub-divide a namespace into character devices that can only be
103 accessed via DAX (mmap(2)).
104
105 Select Y if unsure
106
Oliver O'Halloran71719762018-04-06 15:21:14 +1000107config OF_PMEM
Dan Williamsf22acf82018-04-19 15:07:42 -0700108 tristate "Device-tree support for persistent memory regions"
Oliver O'Halloran71719762018-04-06 15:21:14 +1000109 depends on OF
110 default LIBNVDIMM
111 help
112 Allows regions of persistent memory to be described in the
113 device-tree.
114
115 Select Y if unsure.
116
Dave Jiang4c6926a2018-12-06 12:40:01 -0800117config NVDIMM_KEYS
118 def_bool y
119 depends on ENCRYPTED_KEYS
120 depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m
121
Dan Williams62974fc2019-09-04 15:43:31 -0700122config NVDIMM_TEST_BUILD
123 tristate "Build the unit test core"
124 depends on m
125 depends on COMPILE_TEST && X86_64
126 default m if COMPILE_TEST
127 help
128 Build the core of the unit test infrastructure. The result of
129 this build is non-functional for unit test execution, but it
130 otherwise helps catch build errors induced by changes to the
131 core devm_memremap_pages() implementation and other
132 infrastructure.
133
Dan Williams18da2c92015-06-09 14:13:37 -0400134endif