xref: /linux/drivers/nvdimm/Kconfig (revision 79790b6818e96c58fe2bffee1b418c16e64e7b80)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
218da2c9eSDan Williamsmenuconfig LIBNVDIMM
3b94d5230SDan Williams	tristate "NVDIMM (Non-Volatile Memory Device) Support"
4b94d5230SDan Williams	depends on PHYS_ADDR_T_64BIT
529b9aa0aSDan Williams	depends on HAS_IOMEM
6b94d5230SDan Williams	depends on BLK_DEV
733dd7075SDan Williams	select MEMREGION
8b94d5230SDan Williams	help
9b94d5230SDan Williams	  Generic support for non-volatile memory devices including
10b94d5230SDan Williams	  ACPI-6-NFIT defined resources.  On platforms that define an
11b94d5230SDan Williams	  NFIT, or otherwise can discover NVDIMM resources, a libnvdimm
12b94d5230SDan Williams	  bus is registered to advertise PMEM (persistent memory)
13f8669f1dSDan Williams	  namespaces (/dev/pmemX). A PMEM namespace refers to a
145212e11fSVishal Verma	  memory resource that may span multiple DIMMs and support DAX
15f8669f1dSDan Williams	  (see CONFIG_DAX).
1618da2c9eSDan Williams
1718da2c9eSDan Williamsif LIBNVDIMM
1818da2c9eSDan Williams
1918da2c9eSDan Williamsconfig BLK_DEV_PMEM
2018da2c9eSDan Williams	tristate "PMEM: Persistent memory block device support"
2118da2c9eSDan Williams	default LIBNVDIMM
22afd586f0SChristoph Hellwig	select DAX
235212e11fSVishal Verma	select ND_BTT if BTT
24e1455744SDan Williams	select ND_PFN if NVDIMM_PFN
2518da2c9eSDan Williams	help
2618da2c9eSDan Williams	  Memory ranges for PMEM are described by either an NFIT
27*e4b0925fSPeter Robinson	  (NVDIMM Firmware Interface Table, see CONFIG_ACPI_NFIT), a
2818da2c9eSDan Williams	  non-standard OEM-specific E820 memory type (type-12, see
2918da2c9eSDan Williams	  CONFIG_X86_PMEM_LEGACY), or it is manually specified by the
3018da2c9eSDan Williams	  'memmap=nn[KMG]!ss[KMG]' kernel command line (see
318c27ceffSMauro Carvalho Chehab	  Documentation/admin-guide/kernel-parameters.rst).  This driver converts
3218da2c9eSDan Williams	  these persistent memory ranges into block devices that are
3318da2c9eSDan Williams	  capable of DAX (direct-access) file system mappings.  See
34ae4a0502SMauro Carvalho Chehab	  Documentation/driver-api/nvdimm/nvdimm.rst for more details.
3518da2c9eSDan Williams
3618da2c9eSDan Williams	  Say Y if you want to use an NVDIMM
3718da2c9eSDan Williams
38e1455744SDan Williamsconfig ND_CLAIM
39e1455744SDan Williams	bool
40e1455744SDan Williams
415212e11fSVishal Vermaconfig ND_BTT
425212e11fSVishal Verma	tristate
435212e11fSVishal Verma
448c2f7e86SDan Williamsconfig BTT
455212e11fSVishal Verma	bool "BTT: Block Translation Table (atomic sector updates)"
465212e11fSVishal Verma	default y if LIBNVDIMM
47e1455744SDan Williams	select ND_CLAIM
485212e11fSVishal Verma	help
495212e11fSVishal Verma	  The Block Translation Table (BTT) provides atomic sector
505212e11fSVishal Verma	  update semantics for persistent memory devices, so that
515212e11fSVishal Verma	  applications that rely on sector writes not being torn (a
525212e11fSVishal Verma	  guarantee that typical disks provide) can continue to do so.
535212e11fSVishal Verma	  The BTT manifests itself as an alternate personality for an
54f8669f1dSDan Williams	  NVDIMM namespace, i.e. a namespace can be in raw mode pmemX,
55f8669f1dSDan Williams	  or 'sectored' mode.
565212e11fSVishal Verma
575212e11fSVishal Verma	  Select Y if unsure
588c2f7e86SDan Williams
59e1455744SDan Williamsconfig ND_PFN
60e1455744SDan Williams	tristate
61e1455744SDan Williams
62e1455744SDan Williamsconfig NVDIMM_PFN
63e1455744SDan Williams	bool "PFN: Map persistent (device) memory"
64e1455744SDan Williams	default LIBNVDIMM
6532ab0a3fSDan Williams	depends on ZONE_DEVICE
66e1455744SDan Williams	select ND_CLAIM
67e1455744SDan Williams	help
68e1455744SDan Williams	  Map persistent memory, i.e. advertise it to the memory
69e1455744SDan Williams	  management sub-system.  By default persistent memory does
70e1455744SDan Williams	  not support direct I/O, RDMA, or any other usage that
71e1455744SDan Williams	  requires a 'struct page' to mediate an I/O request.  This
72e1455744SDan Williams	  driver allocates and initializes the infrastructure needed
73e1455744SDan Williams	  to support those use cases.
74e1455744SDan Williams
75e1455744SDan Williams	  Select Y if unsure
76e1455744SDan Williams
77cd03412aSDan Williamsconfig NVDIMM_DAX
78867dfe34SArnd Bergmann	bool "NVDIMM DAX: Raw access to persistent memory"
79cd03412aSDan Williams	default LIBNVDIMM
80cd03412aSDan Williams	depends on NVDIMM_PFN
81cd03412aSDan Williams	help
82cd03412aSDan Williams	  Support raw device dax access to a persistent memory
83cd03412aSDan Williams	  namespace.  For environments that want to hard partition
8483fc61a5SMasanari Iida	  persistent memory, this capability provides a mechanism to
85cd03412aSDan Williams	  sub-divide a namespace into character devices that can only be
86cd03412aSDan Williams	  accessed via DAX (mmap(2)).
87cd03412aSDan Williams
88cd03412aSDan Williams	  Select Y if unsure
89cd03412aSDan Williams
9071719760SOliver O'Halloranconfig OF_PMEM
91f22acf82SDan Williams	tristate "Device-tree support for persistent memory regions"
9271719760SOliver O'Halloran	depends on OF
9371719760SOliver O'Halloran	default LIBNVDIMM
9471719760SOliver O'Halloran	help
9571719760SOliver O'Halloran	  Allows regions of persistent memory to be described in the
9671719760SOliver O'Halloran	  device-tree.
9771719760SOliver O'Halloran
9871719760SOliver O'Halloran	  Select Y if unsure.
9971719760SOliver O'Halloran
1004c6926a2SDave Jiangconfig NVDIMM_KEYS
1014c6926a2SDave Jiang	def_bool y
1024c6926a2SDave Jiang	depends on ENCRYPTED_KEYS
1034c6926a2SDave Jiang	depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m
1044c6926a2SDave Jiang
105c91d7136SDan Williamsconfig NVDIMM_KMSAN
106c91d7136SDan Williams	bool
107c91d7136SDan Williams	depends on KMSAN
108c91d7136SDan Williams	help
109c91d7136SDan Williams	  KMSAN, and other memory debug facilities, increase the size of
110c91d7136SDan Williams	  'struct page' to contain extra metadata. This collides with
111c91d7136SDan Williams	  the NVDIMM capability to store a potentially
112c91d7136SDan Williams	  larger-than-"System RAM" size 'struct page' array in a
113c91d7136SDan Williams	  reservation of persistent memory rather than limited /
114c91d7136SDan Williams	  precious DRAM. However, that reservation needs to persist for
115c91d7136SDan Williams	  the life of the given NVDIMM namespace. If you are using KMSAN
116c91d7136SDan Williams	  to debug an issue unrelated to NVDIMMs or DAX then say N to this
117c91d7136SDan Williams	  option. Otherwise, say Y but understand that any namespaces
118c91d7136SDan Williams	  (with the page array stored pmem) created with this build of
119c91d7136SDan Williams	  the kernel will permanently reserve and strand excess
120c91d7136SDan Williams	  capacity compared to the CONFIG_KMSAN=n case.
121c91d7136SDan Williams
122c91d7136SDan Williams	  Select N if unsure.
123c91d7136SDan Williams
12462974fc3SDan Williamsconfig NVDIMM_TEST_BUILD
12562974fc3SDan Williams	tristate "Build the unit test core"
12662974fc3SDan Williams	depends on m
12762974fc3SDan Williams	depends on COMPILE_TEST && X86_64
12862974fc3SDan Williams	default m if COMPILE_TEST
12962974fc3SDan Williams	help
13062974fc3SDan Williams	  Build the core of the unit test infrastructure. The result of
13162974fc3SDan Williams	  this build is non-functional for unit test execution, but it
13262974fc3SDan Williams	  otherwise helps catch build errors induced by changes to the
13362974fc3SDan Williams	  core devm_memremap_pages() implementation and other
13462974fc3SDan Williams	  infrastructure.
13562974fc3SDan Williams
13615a83487SDave Jiangconfig NVDIMM_SECURITY_TEST
13715a83487SDave Jiang	bool "Enable NVDIMM security unit tests"
13815a83487SDave Jiang	depends on NVDIMM_KEYS
13915a83487SDave Jiang	help
14015a83487SDave Jiang	  The NVDIMM and CXL subsystems support unit testing of their device
14115a83487SDave Jiang	  security state machines. The NVDIMM_SECURITY_TEST option disables CPU
14215a83487SDave Jiang	  cache maintenance operations around events like secure erase and
14315a83487SDave Jiang	  overwrite.  Also, when enabled, the NVDIMM subsystem core helps the unit
14415a83487SDave Jiang	  test implement a mock state machine.
14515a83487SDave Jiang
14615a83487SDave Jiang	  Select N if unsure.
14715a83487SDave Jiang
14818da2c9eSDan Williamsendif
149