Skip to contentSkip to conversation

ndctl: Add ipmregion tool with ipmregion list and reconfigure-region commands

PATCH New James Anandraj 1 participant 5 messages Jul 20, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover ndctl: Add ipmregion tool with ipmregion list and reconfigure-region commands

From: James Sushanth Anandraj <[email protected]>

The Intel Optane Persistent Memory OS provisioning specification describes how to support basic provisioning for Intel Optane persistent memory 100 and 200 series for use in different operating modes using OS software.

This patch set introduces a new utility ipmregion that implements basic provisioning as described in the provisioning specification document at https://cdrdv2.intel.com/v1/dl/getContent/634430 .

The ipmregion utility provides enumeration and region reconfiguration commands for "nvdimm" subsystem devices (Non-volatile Memory). This is implemented as a separate tool rather than as a feature of ndctl as the steps for provisioning are specific to Intel Optane devices and are as follows.
1..Generate a new region configuration request using this utility.
2. Reset the platform.
3. Use this utility to list the status of operation.

Since v1:
* Change name of tool to ipmregion.
* Change reconfigure-region modes to fault-isolation-pmem and performance-pmem.

James Sushanth Anandraj (4):
Documentation/ipmregion: Add documentation for ipmregion tool and
commands
ipmregion/list: Add ipmregion-list command to enumerate 'nvdimm'
devices
ipmregion/reconfigure: Add ipmregion-reconfigure-region command ipmregion/reconfigure: Add support for different pmem region modes

 Documentation/ipmregion/Makefile.am           |   59 +
 .../ipmregion/asciidoctor-extensions.rb       |   30 +
 Documentation/ipmregion/ipmregion-list.txt    |   56 +
 .../ipmregion-reconfigure-region.txt          |   51 +
 Documentation/ipmregion/ipmregion.txt         |   40 +
 .../ipmregion/theory-of-operation.txt         |   29 +
 Makefile.am                                   |    4 +-
 configure.ac                                  |    2 +
 ipmregion/Makefile.am                         |   18 +
 ipmregion/builtin.h                           |    9 +
 ipmregion/ipmregion.c                         |   88 +
 ipmregion/list.c                              |  114 ++
 ipmregion/list.h                              |   11 +
 ipmregion/pcat.c                              |   59 +
 ipmregion/pcat.h                              |   13 +
 ipmregion/pcd.h                               |  381 +++++
 ipmregion/reconfigure.c                       | 1458 +++++++++++++++++
 ipmregion/reconfigure.h                       |   12 +
 util/main.h                                   |    1 +
 19 files changed, 2433 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/ipmregion/Makefile.am
 create mode 100644 Documentation/ipmregion/asciidoctor-extensions.rb
 create mode 100644 Documentation/ipmregion/ipmregion-list.txt
 create mode 100644 Documentation/ipmregion/ipmregion-reconfigure-region.txt
 create mode 100644 Documentation/ipmregion/ipmregion.txt
 create mode 100644 Documentation/ipmregion/theory-of-operation.txt
 create mode 100644 ipmregion/Makefile.am
 create mode 100644 ipmregion/builtin.h
 create mode 100644 ipmregion/ipmregion.c
 create mode 100644 ipmregion/list.c
 create mode 100644 ipmregion/list.h
 create mode 100644 ipmregion/pcat.c
 create mode 100644 ipmregion/pcat.h
 create mode 100644 ipmregion/pcd.h
 create mode 100644 ipmregion/reconfigure.c
 create mode 100644 ipmregion/reconfigure.h
Signature · 1 line
2.20.1
#1 lore raw

PATCH v2 1/4 Documentation/ipmregion: Add documentation for ipmregion tool and commands

From: James Sushanth Anandraj <[email protected]>

Add man page files for ipmregion tool, ipmregion-list and ipmregion-reconfigure-region commands. Ipmregion is a tool to help region reconfiguration for 'nvdimm' devices.
It modifies a portion of the pcd region on 'nvdimm' devices to reconfigure regions. The module Platform Configuration Data (PCD) refers to a section of the PMem module that is used to store metadata. The metadata stored in the PCD is the architected interface between software and platform firmware to support PMem provisioning

---
 Documentation/ipmregion/Makefile.am           | 59 +++++++++++++++++++
 .../ipmregion/asciidoctor-extensions.rb       | 30 ++++++++++
 Documentation/ipmregion/ipmregion-list.txt    | 56 ++++++++++++++++++
 .../ipmregion-reconfigure-region.txt          | 51 ++++++++++++++++
 Documentation/ipmregion/ipmregion.txt         | 40 +++++++++++++
 .../ipmregion/theory-of-operation.txt         | 29 +++++++++
 Makefile.am                                   |  2 +-
 configure.ac                                  |  1 +
 8 files changed, 267 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/ipmregion/Makefile.am
 create mode 100644 Documentation/ipmregion/asciidoctor-extensions.rb
 create mode 100644 Documentation/ipmregion/ipmregion-list.txt
 create mode 100644 Documentation/ipmregion/ipmregion-reconfigure-region.txt
 create mode 100644 Documentation/ipmregion/ipmregion.txt
 create mode 100644 Documentation/ipmregion/theory-of-operation.txt
Documentation/ipmregion/Makefile.am new file +59 -0
new file mode 100644
index 0000000..baadad5
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (C) 2015-2020 Intel Corporation. All rights reserved.
+
+if USE_ASCIIDOCTOR
+
+do_subst = sed -e 's,@Utility@,Ipmregion,g' -e's,@utility@,ipmregion,g'
+CONFFILE = asciidoctor-extensions.rb
+asciidoctor-extensions.rb: ../asciidoctor-extensions.rb.in
+	$(AM_V_GEN) $(do_subst) < $< > $@
+
+else
+
+do_subst = sed -e 's,UTILITY,ipmregion,g'
+CONFFILE = asciidoc.conf
+asciidoc.conf: ../asciidoc.conf.in
+	$(AM_V_GEN) $(do_subst) < $< > $@
+
+endif
+
+man1_MANS = \
+	ipmregion.1 \
+	ipmregion-list.1 \
+	ipmregion-reconfigure-region.1
+
+EXTRA_DIST = $(man1_MANS)
+
+CLEANFILES = $(man1_MANS)
+
+XML_DEPS = \
+	../../version.m4 \
+	../copyright.txt \
+	Makefile \
+	$(CONFFILE)
+
+RM ?= rm -f
+
+if USE_ASCIIDOCTOR
+
+%.1: %.txt $(XML_DEPS)
+	$(AM_V_GEN)$(RM) $@+ $@ && \
+		$(ASCIIDOC) -b manpage -d manpage -acompat-mode \
+		-I. -rasciidoctor-extensions \
+		-amansource=ipmregion -amanmanual="ipmregion Manual" \
+		-andctl_version=$(VERSION) -o $@+ $< && \
+		mv $@+ $@
+
+else
+
+%.xml: %.txt $(XML_DEPS)
+	$(AM_V_GEN)$(RM) $@+ $@ && \
+		$(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
+		--unsafe -aipmregion_version=$(VERSION) -o $@+ $< && \
+		mv $@+ $@
+
+%.1: %.xml $(XML_DEPS)
+	$(AM_V_GEN)$(RM) $@ && \
+		$(XMLTO) -o . -m ../manpage-normal.xsl man $<
+
+endif
Documentation/ipmregion/asciidoctor-extensions.rb new file +30 -0
new file mode 100644
index 0000000..fa9b9f6
@@ -0,0 +1,30 @@
+require 'asciidoctor'
+require 'asciidoctor/extensions'
+
+module Ipmregion
+  module Documentation
+    class LinkIpmregionProcessor < Asciidoctor::Extensions::InlineMacroProcessor
+      use_dsl
+
+      named :chrome
+
+      def process(parent, target, attrs)
+        if parent.document.basebackend? 'html'
+          prefix = parent.document.attr('ipmregion-relative-html-prefix')
+          %(<a href="#{prefix}#{target}.html">#{target}(#{attrs[1]})</a>\n)
+        elsif parent.document.basebackend? 'manpage'
+          "#{target}(#{attrs[1]})"
+        elsif parent.document.basebackend? 'docbook'
+          "<citerefentry>\n" \
+            "<refentrytitle>#{target}</refentrytitle>" \
+            "<manvolnum>#{attrs[1]}</manvolnum>\n" \
+          "</citerefentry>\n"
+        end
+      end
+    end
+  end
+end
+
+Asciidoctor::Extensions.register do
+  inline_macro Ipmregion::Documentation::LinkIpmregionProcessor, :linkipmregion
+end
Documentation/ipmregion/ipmregion-list.txt new file +56 -0

56 lines not on this page · raw message

Documentation/ipmregion/ipmregion-reconfigure-region.txt new file +51 -0

51 lines not on this page · raw message

Documentation/ipmregion/ipmregion.txt new file +40 -0
new file mode 100644
index 0000000..a3e10b0
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-2.0
+
+ipmregion(1)
+============
+
+NAME
+----
+ipmregion - Provides enumeration and region reconfiguraion commands for "nvdimm"
+subsystem devices (Non-volatile Memory)
+
+include::theory-of-operation.txt[]
+
+SYNOPSIS
+--------
+[verse]
+'ipmregion' [--version] [--help] COMMAND [ARGS]
+
+OPTIONS
+-------
+-v::
+--version::
+  Display ipmregion version.
+
+-h::
+--help::
+  Run ipmregion help command.
+
+DESCRIPTION
+-----------
+The ipmregion utility provides enumeration and region reconfiguration commands for
+"nvdimm" subsystem devices (Non-volatile Memory). Operations
+supported by the tool include region reconfiguration and enumeration of the
+devices and their region reconfiguration status.
+
+include::../copyright.txt[]
+
+SEE ALSO
+--------
+linkipmregion:ipmregion-list[1],
+linkipmregion:ipmregion-reconfigure-region[1]
Documentation/ipmregion/theory-of-operation.txt new file +29 -0
new file mode 100644
index 0000000..7af5267
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+
+THEORY OF OPERATION
+-------------------
+A region is persistent memory from one or more non-volatile memory devices that
+is mapped into the system physical address (SPA) space. For some device vendors,
+reconfiguring regions is a multi-step process as follows.
+1. Generate a new region configuration request using this command.
+2. Reset the platform.
+3. Platform firmware (BIOS) processes the region configuration request and
+presents the new region configuration via ACPI NFIT tables. The status of this
+BIOS operation can be retrieved using the ipmregion-list command.
+
+Region types are as follows:
+1. Performance Persistent Memory Region (performance-pmem)
+This is a persistent memory region that utilizes hardware interleaving across
+non-volatile memory devices. This configuration maximizes bandwidth.
+2. Fault Isolation Persistent Memory Region (fault-isolation-pmem)
+This is a persistent memory region that does not utilize hardware interleaving
+across non-volatile memory devices. This configuration maximizes the isolation
+and resilency to faults in individual modules.
+3. Volatile Memory Region (ram)
+The portion of persistent memory in the system that is used in a volatile
+memory region is treated as volatile 'system-ram' to expand the overall system
+memory. This type of region is entirely managed by platform firmware (BIOS) and
+is no longer visible in 'ndctl' nor is it usable by applications as persistent
+storage. Additionally, in this mode, some portion of DRAM in the system is
+'consumed' by the platform firmware to act as a cache that fronts the
+persistent memory.
Makefile.am +1 -1
index 60a1998..f9fec0c 100644
@@ -3,7 +3,7 @@ include Makefile.am.in
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
 SUBDIRS = . daxctl/lib ndctl/lib ndctl daxctl
 if ENABLE_DOCS
-SUBDIRS += Documentation/ndctl Documentation/daxctl
+SUBDIRS += Documentation/ndctl Documentation/daxctl Documentation/ipmregion
 endif
 SUBDIRS += test
 
configure.ac +1 -0
index 5ec8d2f..9f16b01 100644
@@ -228,6 +228,7 @@ AC_CONFIG_FILES([
         test/Makefile
         Documentation/ndctl/Makefile
         Documentation/daxctl/Makefile
+        Documentation/ipmregion/Makefile
 ])
 
 AC_OUTPUT
Signature · 1 line
2.20.1
#2 lore raw

PATCH v2 2/4 ipmregion/list: Add ipmregion-list command to enumerate 'nvdimm' devices

In reply to James Anandraj

From: James Sushanth Anandraj <[email protected]>

Add ipmregion-list command to enumerate 'nvdimm' devices. The command reads pcd data from the 'nvdimm' devices to display information related to region reconfiguration such as, pending reconfiguration request and the status of last request.

---
 Makefile.am             |   2 +-
 configure.ac            |   1 +
 ipmregion/Makefile.am   |  17 ++
 ipmregion/builtin.h     |   8 +
 ipmregion/ipmregion.c   |  87 +++++++++
 ipmregion/list.c        | 114 ++++++++++++
 ipmregion/list.h        |  11 ++
 ipmregion/pcd.h         | 160 +++++++++++++++++
 ipmregion/reconfigure.c | 379 ++++++++++++++++++++++++++++++++++++++++
 ipmregion/reconfigure.h |  12 ++
 util/main.h             |   1 +
 11 files changed, 791 insertions(+), 1 deletion(-)
 create mode 100644 ipmregion/Makefile.am
 create mode 100644 ipmregion/builtin.h
 create mode 100644 ipmregion/ipmregion.c
 create mode 100644 ipmregion/list.c
 create mode 100644 ipmregion/list.h
 create mode 100644 ipmregion/pcd.h
 create mode 100644 ipmregion/reconfigure.c
 create mode 100644 ipmregion/reconfigure.h
Makefile.am +1 -1
index f9fec0c..3ef2a98 100644
@@ -1,7 +1,7 @@
 include Makefile.am.in
 
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-SUBDIRS = . daxctl/lib ndctl/lib ndctl daxctl
+SUBDIRS = . daxctl/lib ndctl/lib ndctl daxctl ipmregion
 if ENABLE_DOCS
 SUBDIRS += Documentation/ndctl Documentation/daxctl Documentation/ipmregion
 endif
configure.ac +1 -0
index 9f16b01..222eda2 100644
@@ -225,6 +225,7 @@ AC_CONFIG_FILES([
         ndctl/lib/Makefile
         ndctl/Makefile
         daxctl/Makefile
+        ipmregion/Makefile
         test/Makefile
         Documentation/ndctl/Makefile
         Documentation/daxctl/Makefile
ipmregion/Makefile.am new file +17 -0
new file mode 100644
index 0000000..4a17a69
@@ -0,0 +1,17 @@
+include $(top_srcdir)/Makefile.am.in
+
+bin_PROGRAMS = ipmregion
+
+ipmregion_SOURCES =\
+		ipmregion.c \
+		list.c \
+		reconfigure.c \
+		../util/json.c \
+		builtin.h
+
+ipmregion_LDADD =\
+	../ndctl/lib/libndctl.la \
+	../libutil.a \
+	$(UUID_LIBS) \
+	$(KMOD_LIBS) \
+	$(JSON_LIBS)
ipmregion/builtin.h new file +8 -0
new file mode 100644
index 0000000..4ea5650
@@ -0,0 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/* Copyright (C) 2015-2021 Intel Corporation. All rights reserved. */
+#ifndef _IPMREGION_BUILTIN_H_
+#define _IPMREGION_BUILTIN_H_
+
+struct ndctl_ctx;
+int cmd_list(int argc, const char **argv, struct ndctl_ctx *ctx);
+#endif /* _IPMREGION_BUILTIN_H_ */
ipmregion/ipmregion.c new file +87 -0

87 lines not on this page · raw message

ipmregion/list.c new file +114 -0

114 lines not on this page · raw message

ipmregion/list.h new file +11 -0
new file mode 100644
index 0000000..eabd710
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0*/
+/* Copyright(c) 2021 Intel Corporation. All rights reserved.*/
+
+#ifndef _LIST_H_
+#define _LIST_H_
+
+#include <ndctl/lib/private.h>
+#include <ndctl/libndctl.h>
+#include <util/json.h>
+struct json_object *ipmregion_list_dimm_to_json(struct ndctl_dimm *dimm);
+#endif /* _LIST_H_ */
ipmregion/pcd.h new file +160 -0

160 lines not on this page · raw message

ipmregion/reconfigure.c new file +379 -0

379 lines not on this page · raw message

ipmregion/reconfigure.h new file +12 -0
new file mode 100644
index 0000000..84b3340
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0*/
+/* Copyright(c) 2021 Intel Corporation. All rights reserved.*/
+
+#ifndef _RECONFIGURE_H_
+#define _RECONFIGURE_H_
+
+#include <ndctl/lib/private.h>
+#include <ndctl/libndctl.h>
+bool ipmregion_dimm_reconfigure_region_pending(struct ndctl_dimm *dimm);
+const char *ipmregion_dimm_reconfigure_status_string(struct ndctl_dimm *dimm);
+int ipmregion_dimm_reconfigure_status(struct ndctl_dimm *dimm);
+#endif /* _RECONFIGURE_H_ */
util/main.h +1 -0
index c89a843..f723c6e 100644
@@ -10,6 +10,7 @@
 enum program {
 	PROG_NDCTL,
 	PROG_DAXCTL,
+	PROG_ipmregion
 };
 
 struct ndctl_ctx;
Signature · 1 line
2.20.1
#3 lore raw

PATCH v2 3/4 ipmregion/reconfigure: Add ipmregion-reconfigure-region command

In reply to James Anandraj

From: James Sushanth Anandraj <[email protected]>

Add ipmregion-reconfigure-region command and helper functions. The command reads pcd data from the 'nvdimm' devices and writes a new pcd reflecting the region reconfiguration request. In this patch functions to reconfigure region into volatile regions(ram) are implemented.

---
 ipmregion/Makefile.am   |   1 +
 ipmregion/builtin.h     |   1 +
 ipmregion/ipmregion.c   |   1 +
 ipmregion/pcat.c        |  59 ++++++
 ipmregion/pcat.h        |  13 ++
 ipmregion/pcd.h         |  58 ++++++
 ipmregion/reconfigure.c | 390 +++++++++++++++++++++++++++++++++++++++-
 7 files changed, 515 insertions(+), 8 deletions(-)
 create mode 100644 ipmregion/pcat.c
 create mode 100644 ipmregion/pcat.h
ipmregion/Makefile.am +1 -0
index 4a17a69..ad18103 100644
@@ -6,6 +6,7 @@ ipmregion_SOURCES =\
 		ipmregion.c \
 		list.c \
 		reconfigure.c \
+		pcat.c \
 		../util/json.c \
 		builtin.h
 
ipmregion/builtin.h +1 -0
index 4ea5650..c31fc48 100644
@@ -5,4 +5,5 @@
 
 struct ndctl_ctx;
 int cmd_list(int argc, const char **argv, struct ndctl_ctx *ctx);
+int cmd_reconfigure_region(int argc, const char **argv, struct ndctl_ctx *ctx);
 #endif /* _IPMREGION_BUILTIN_H_ */
ipmregion/ipmregion.c +1 -0
index 7726974..1541348 100644
@@ -51,6 +51,7 @@ static int cmd_help(int argc, const char **argv, struct ndctl_ctx *ctx)
 static struct cmd_struct commands[] = {
 	{ "version", { cmd_version } },
 	{ "list", { cmd_list } },
+	{ "reconfigure-region", { cmd_reconfigure_region } },
 	{ "help", { cmd_help } },
 };
 
ipmregion/pcat.c new file +59 -0

59 lines not on this page · raw message

ipmregion/pcat.h new file +13 -0
new file mode 100644
index 0000000..3f6f8ae
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: GPL-2.0*/
+/* Copyright(c) 2021 Intel Corporation. All rights reserved.*/
+
+#ifndef _PCAT_H_
+#define _PCAT_H_
+#include <stdint.h>
+#include <ccan/short_types/short_types.h>
+#define PCAT_REV_0_2 ((u8)0x02)
+#define PCAT_REV_1_2 ((u8)0x12)
+
+int validate_pcat_rev(void);
+u8 get_pcat_rev(void);
+#endif /* _LIST_H_ */
ipmregion/pcd.h +58 -0

86 lines not on this page · raw message

ipmregion/reconfigure.c +382 -8

437 lines not on this page · raw message

Signature · 1 line
2.20.1
#4 lore raw

PATCH v2 4/4 ipmregion/reconfigure: Add support for different pmem region modes

In reply to James Anandraj

From: James Sushanth Anandraj <[email protected]>

Implement ipmregion-reconfigure-region fault-isolation-pmem and performance-pmem support. This patch adds helper functions to support processing of different pmem reconfigure-region requests. The fault-isolation-pmem reconfigure-region request results in regions that does not utilize hardware interleaving across non-volatile memory devices. The performance-pmem request results in regions that utilize hardware interleaving. The command reads pcd data from the 'nvdimm' devices and writes a new pcd reflecting the new region reconfiguration request.

---
 ipmregion/pcd.h         | 163 +++++++++
 ipmregion/reconfigure.c | 709 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 870 insertions(+), 2 deletions(-)
ipmregion/pcd.h +163 -0
index e16c1e0..dccc03e 100644
@@ -26,6 +26,11 @@
  *	 │		+---------------------+    +---------------+
  *	 +------------->│Configuration Output +--->│Extension table│
  *			+---------------------+    +---------------+
+ *
+ * The extension table for Configuration Input is determined by the region
+ * reconfiguration request. See section 5 in provisioning document for examples
+ * for each request type.
+ *
  * Glossary
  * --------
  * PCD - Platform Configuration Data
@@ -34,6 +39,11 @@
  * CIN - Configuration Input
  * COUT - Configuration Output
  * PSCT - Partition Size Change Table
+ * IIT - Interleave Information Table
+ * MIIIS - Module Identification Information for Interleave Set
+ * MUI - Module Unique Identifier
+ * ML - Module location
+ * MPIO - Module partition information output
  */
 /**
  * struct pcd_config_header - configuration header
@@ -130,6 +140,136 @@ struct pcd_psct {
 	u32 status;
 	u64 size;
 } __attribute__((packed));
+/**
+ * struct pcd_mui - module unique identifier
+ * @id: subsystem vendor id
+ * @location: manufacturing location
+ * @date: manufacturing date
+ * @serial: serial number
+ * The module unique identifier is a field in module identification information
+ * for interleave set. The field and its sub-fields are described in section
+ * 3.8.1.1 Table 311 in the provisioning specification document.
+ */
+struct pcd_mui {
+	u16 id;
+	u8 location;
+	u16 date;
+	u32 serial;
+} __attribute__((packed));
+/**
+ * struct pcd_ml - module location
+ * @socket_id: module socket id
+ * @die_id: module die id
+ * @mem_controller_id: module memory controller id
+ * @channel_id: memory channel number
+ * @slot_id: dimm number
+ * @r: reserved
+ * The module location is a field in module identification information for
+ * interleave set. The field and its sub-fields are described in section
+ * 3.8.1.1 Table 311 in the provisioning specification document.
+ */
+struct pcd_ml {
+	u8 socket_id;
+	u8 die_id;
+	u8 mem_controller_id;
+	u8 channel_id;
+	u8 slot_id;
+	u8 r[3];
+} __attribute__((packed));
+/**
+ * struct pcd_miiis - module identification information for interleave set
+ * @mui: module unique identifier
+ * @ml: module location only used in pcat v1.2
+ * @r: reserved
+ * @offset: partition offset
+ * @size: partition size
+ * The module identification information for interleave set is used for
+ * identifying the modules that are present in the interleave set.
+ * The structure and fields of table are described in section 3.8.1.1 Table 310
+ * and Table 311 in the provisioning specification document.
+ */
+struct pcd_miiis {
+	struct pcd_mui mui;
+	struct pcd_ml ml;
+	u8 r[15];
+	u64 offset;
+	u64 size;
+} __attribute__((packed));
+/**
+ * struct pcd_iit - interleave information table (type 5)
+ * @type: table type
+ * @length: length in bytes for the entire table
+ * @index: interleave set index
+ * @modules: number of modules in interleave set
+ * @itype: interleave memory type
+ * @isize: interleave size
+ * @iways: interleave ways - this field is ignore for pcat v1.2
+ * @r1: reserved
+ * @status: interleave change status
+ * @r2: reserved
+ * The interleave information table describes a interleave set. The structure
+ * and fields of the table are described in section 3.8 Table 38 and 39 in the
+ * provisioning specification document
+ */
+struct pcd_iit {
+	u16 type;
+	u16 length;
+	u16 index;
+	u8 modules;
+	u8 itype;
+	u16 isize;
+	u16 iways;
+	u8 r1;
+	u8 status;
+	u8 r2[10];
+} __attribute__((packed));
+/**
+ * struct nfit_handle - nfit handle
+ * @dimm: dimm number
+ * @mem_chnl: memory channel number
+ * @mem_ctrlr: memory controller id
+ * @socket_id: socket id
+ * @node: node id
+ * @r: reserved
+ * @value: unsigned value
+ * This structure is used to unpack the subfields of the dimm handle.
+ */
+struct nfit_handle {
+	union {
+		struct {
+			u8 dimm : 4;
+			u8 mem_chnl : 4;
+			u8 mem_ctrlr : 4;
+			u8 socket_id : 4;
+			u16 node : 12;
+			u8 r : 4;
+		} __attribute__((packed));
+		u32 value;
+	};
+} __attribute__((packed));
+/**
+ * struct pcd_mpio - module partition information output payload
+ * @volatile_capacity: volatile capacity
+ * @r1: reserved
+ * @volatile_start: volatile start location
+ * @persistent_capacity: persistent capacity
+ * @r2: reserved
+ * @persistent_start: persistent start location
+ * @raw_capacity: raw capacity
+ * The structure represents the output parameters of get module partition
+ * information vendor specific command. The structure and its fields are
+ * described in section 4.3 and Table 48 in the provisioning specification
+ * document.
+ */
+struct pcd_mpio {
+	u32 volatile_capacity;
+	u8 r1[4];
+	u64 volatile_start;
+	u32 persistent_capacity;
+	u8 r2[4];
+	u64 persistent_start;
+	u32 raw_capacity;
+} __attribute__((packed));
 /**
  * struct pcd_get_pcd_input - get pcd input
  * @partition_id: partition id
@@ -203,6 +343,12 @@ static const char *const pcd_status_str[] = {
  * in section 4.2 Table 45 of provisioning document.
  */
 #define PCD_OPCODE_SET_PCD ((u16)0x0701)
+/**
+ * The opcode value for get module partition information vendor specific
+ * command. The value is mentioned in section 4.3 Table 447 of provisioning
+ * document.
+ */
+#define PCD_OPCODE_GET_MPI ((u16)0x0602)
 /**
  * Defines for PCD revision values
  */
@@ -215,4 +361,21 @@ static const char *const pcd_status_str[] = {
  * mentioned in Table 37 of provisioning document.
  */
 #define PSCT_TYPE ((u16)0x4)
+/**
+ * Define for header type value for Interleave Information Table. The value is
+ * mentioned in Table 38 of provisioning document.
+ */
+#define IIT_TYPE ((u16)0x5)
+/**
+ * Define for interleave memory type field app direct mode value in Interleave
+ * information table. The value is mentioned in Table 38 of provisioning
+ * document.
+ */
+#define APP_DIRECT_MODE ((u8)0x2)
+/**
+ * Define for interleave size field value in Interleave information table.
+ * The value is mentioned in Table 38 of provisioning document.
+ */
+#define INTERLEAVE_SIZE ((u16)0x4040)
+
 #endif /* _PCD_H_ */
ipmregion/reconfigure.c +707 -2

753 lines not on this page · raw message

Signature · 1 line
2.20.1