~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/papr_pdsm.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/uapi/linux/papr_pdsm.h (Architecture ppc) and /include/uapi/linux/papr_pdsm.h (Architecture alpha)


  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux      1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 /*                                                  2 /*
  3  * PAPR nvDimm Specific Methods (PDSM) and str      3  * PAPR nvDimm Specific Methods (PDSM) and structs for libndctl
  4  *                                                  4  *
  5  * (C) Copyright IBM 2020                           5  * (C) Copyright IBM 2020
  6  *                                                  6  *
  7  * Author: Vaibhav Jain <vaibhav at linux.ibm.      7  * Author: Vaibhav Jain <vaibhav at linux.ibm.com>
  8  */                                                 8  */
  9                                                     9 
 10 #ifndef _UAPI_ASM_POWERPC_PAPR_PDSM_H_             10 #ifndef _UAPI_ASM_POWERPC_PAPR_PDSM_H_
 11 #define _UAPI_ASM_POWERPC_PAPR_PDSM_H_             11 #define _UAPI_ASM_POWERPC_PAPR_PDSM_H_
 12                                                    12 
 13 #include <linux/types.h>                           13 #include <linux/types.h>
 14 #include <linux/ndctl.h>                           14 #include <linux/ndctl.h>
 15                                                    15 
 16 /*                                                 16 /*
 17  * PDSM Envelope:                                  17  * PDSM Envelope:
 18  *                                                 18  *
 19  * The ioctl ND_CMD_CALL exchange data between     19  * The ioctl ND_CMD_CALL exchange data between user-space and kernel via
 20  * envelope which consists of 2 headers sectio     20  * envelope which consists of 2 headers sections and payload sections as
 21  * illustrated below:                              21  * illustrated below:
 22  *  +-----------------+---------------+-------     22  *  +-----------------+---------------+---------------------------+
 23  *  |   64-Bytes      |   8-Bytes     |            23  *  |   64-Bytes      |   8-Bytes     |       Max 184-Bytes       |
 24  *  +-----------------+---------------+-------     24  *  +-----------------+---------------+---------------------------+
 25  *  | ND-HEADER       |  PDSM-HEADER  |      P     25  *  | ND-HEADER       |  PDSM-HEADER  |      PDSM-PAYLOAD         |
 26  *  +-----------------+---------------+-------     26  *  +-----------------+---------------+---------------------------+
 27  *  | nd_family       |               |            27  *  | nd_family       |               |                           |
 28  *  | nd_size_out     | cmd_status    |            28  *  | nd_size_out     | cmd_status    |                           |
 29  *  | nd_size_in      | reserved      |     nd     29  *  | nd_size_in      | reserved      |     nd_pdsm_payload       |
 30  *  | nd_command      | payload   --> |            30  *  | nd_command      | payload   --> |                           |
 31  *  | nd_fw_size      |               |            31  *  | nd_fw_size      |               |                           |
 32  *  | nd_payload ---> |               |            32  *  | nd_payload ---> |               |                           |
 33  *  +---------------+-----------------+-------     33  *  +---------------+-----------------+---------------------------+
 34  *                                                 34  *
 35  * ND Header:                                      35  * ND Header:
 36  * This is the generic libnvdimm header descri     36  * This is the generic libnvdimm header described as 'struct nd_cmd_pkg'
 37  * which is interpreted by libnvdimm before pa     37  * which is interpreted by libnvdimm before passed on to papr_scm. Important
 38  * member fields used are:                         38  * member fields used are:
 39  * 'nd_family'          : (In) NVDIMM_FAMILY_P     39  * 'nd_family'          : (In) NVDIMM_FAMILY_PAPR_SCM
 40  * 'nd_size_in'         : (In) PDSM-HEADER + P     40  * 'nd_size_in'         : (In) PDSM-HEADER + PDSM-IN-PAYLOAD (usually 0)
 41  * 'nd_size_out'        : (In) PDSM-HEADER + P     41  * 'nd_size_out'        : (In) PDSM-HEADER + PDSM-RETURN-PAYLOAD
 42  * 'nd_command'         : (In) One of PAPR_PDS     42  * 'nd_command'         : (In) One of PAPR_PDSM_XXX
 43  * 'nd_fw_size'         : (Out) PDSM-HEADER +      43  * 'nd_fw_size'         : (Out) PDSM-HEADER + size of actual payload returned
 44  *                                                 44  *
 45  * PDSM Header:                                    45  * PDSM Header:
 46  * This is papr-scm specific header that prece     46  * This is papr-scm specific header that precedes the payload. This is defined
 47  * as nd_cmd_pdsm_pkg.  Following fields aare      47  * as nd_cmd_pdsm_pkg.  Following fields aare available in this header:
 48  *                                                 48  *
 49  * 'cmd_status'         : (Out) Errors if any      49  * 'cmd_status'         : (Out) Errors if any encountered while servicing PDSM.
 50  * 'reserved'           : Not used, reserved f     50  * 'reserved'           : Not used, reserved for future and should be set to 0.
 51  * 'payload'            : A union of all the p     51  * 'payload'            : A union of all the possible payload structs
 52  *                                                 52  *
 53  * PDSM Payload:                                   53  * PDSM Payload:
 54  *                                                 54  *
 55  * The layout of the PDSM Payload is defined b     55  * The layout of the PDSM Payload is defined by various structs shared between
 56  * papr_scm and libndctl so that contents of p     56  * papr_scm and libndctl so that contents of payload can be interpreted. As such
 57  * its defined as a union of all possible payl     57  * its defined as a union of all possible payload structs as
 58  * 'union nd_pdsm_payload'. Based on the value     58  * 'union nd_pdsm_payload'. Based on the value of 'nd_cmd_pkg.nd_command'
 59  * appropriate member of the union is accessed     59  * appropriate member of the union is accessed.
 60  */                                                60  */
 61                                                    61 
 62 /* Max payload size that we can handle */          62 /* Max payload size that we can handle */
 63 #define ND_PDSM_PAYLOAD_MAX_SIZE 184               63 #define ND_PDSM_PAYLOAD_MAX_SIZE 184
 64                                                    64 
 65 /* Max payload size that we can handle */          65 /* Max payload size that we can handle */
 66 #define ND_PDSM_HDR_SIZE \                         66 #define ND_PDSM_HDR_SIZE \
 67         (sizeof(struct nd_pkg_pdsm) - ND_PDSM_     67         (sizeof(struct nd_pkg_pdsm) - ND_PDSM_PAYLOAD_MAX_SIZE)
 68                                                    68 
 69 /* Various nvdimm health indicators */             69 /* Various nvdimm health indicators */
 70 #define PAPR_PDSM_DIMM_HEALTHY       0             70 #define PAPR_PDSM_DIMM_HEALTHY       0
 71 #define PAPR_PDSM_DIMM_UNHEALTHY     1             71 #define PAPR_PDSM_DIMM_UNHEALTHY     1
 72 #define PAPR_PDSM_DIMM_CRITICAL      2             72 #define PAPR_PDSM_DIMM_CRITICAL      2
 73 #define PAPR_PDSM_DIMM_FATAL         3             73 #define PAPR_PDSM_DIMM_FATAL         3
 74                                                    74 
 75 /* struct nd_papr_pdsm_health.extension_flags      75 /* struct nd_papr_pdsm_health.extension_flags field flags */
 76                                                    76 
 77 /* Indicate that the 'dimm_fuel_gauge' field i     77 /* Indicate that the 'dimm_fuel_gauge' field is valid */
 78 #define PDSM_DIMM_HEALTH_RUN_GAUGE_VALID 1         78 #define PDSM_DIMM_HEALTH_RUN_GAUGE_VALID 1
 79                                                    79 
 80 /* Indicate that the 'dimm_dsc' field is valid     80 /* Indicate that the 'dimm_dsc' field is valid */
 81 #define PDSM_DIMM_DSC_VALID 2                      81 #define PDSM_DIMM_DSC_VALID 2
 82                                                    82 
 83 /*                                                 83 /*
 84  * Struct exchanged between kernel & ndctl in      84  * Struct exchanged between kernel & ndctl in for PAPR_PDSM_HEALTH
 85  * Various flags indicate the health status of     85  * Various flags indicate the health status of the dimm.
 86  *                                                 86  *
 87  * extension_flags      : Any extension fields     87  * extension_flags      : Any extension fields present in the struct.
 88  * dimm_unarmed         : Dimm not armed. So c     88  * dimm_unarmed         : Dimm not armed. So contents wont persist.
 89  * dimm_bad_shutdown    : Previous shutdown di     89  * dimm_bad_shutdown    : Previous shutdown did not persist contents.
 90  * dimm_bad_restore     : Contents from previo     90  * dimm_bad_restore     : Contents from previous shutdown werent restored.
 91  * dimm_scrubbed        : Contents of the dimm     91  * dimm_scrubbed        : Contents of the dimm have been scrubbed.
 92  * dimm_locked          : Contents of the dimm     92  * dimm_locked          : Contents of the dimm cant be modified until CEC reboot
 93  * dimm_encrypted       : Contents of dimm are     93  * dimm_encrypted       : Contents of dimm are encrypted.
 94  * dimm_health          : Dimm health indicato     94  * dimm_health          : Dimm health indicator. One of PAPR_PDSM_DIMM_XXXX
 95  * dimm_fuel_gauge      : Life remaining of DI     95  * dimm_fuel_gauge      : Life remaining of DIMM as a percentage from 0-100
 96  */                                                96  */
 97 struct nd_papr_pdsm_health {                       97 struct nd_papr_pdsm_health {
 98         union {                                    98         union {
 99                 struct {                           99                 struct {
100                         __u32 extension_flags;    100                         __u32 extension_flags;
101                         __u8 dimm_unarmed;        101                         __u8 dimm_unarmed;
102                         __u8 dimm_bad_shutdown    102                         __u8 dimm_bad_shutdown;
103                         __u8 dimm_bad_restore;    103                         __u8 dimm_bad_restore;
104                         __u8 dimm_scrubbed;       104                         __u8 dimm_scrubbed;
105                         __u8 dimm_locked;         105                         __u8 dimm_locked;
106                         __u8 dimm_encrypted;      106                         __u8 dimm_encrypted;
107                         __u16 dimm_health;        107                         __u16 dimm_health;
108                                                   108 
109                         /* Extension flag PDSM    109                         /* Extension flag PDSM_DIMM_HEALTH_RUN_GAUGE_VALID */
110                         __u16 dimm_fuel_gauge;    110                         __u16 dimm_fuel_gauge;
111                                                   111 
112                         /* Extension flag PDSM    112                         /* Extension flag PDSM_DIMM_DSC_VALID */
113                         __u64 dimm_dsc;           113                         __u64 dimm_dsc;
114                 };                                114                 };
115                 __u8 buf[ND_PDSM_PAYLOAD_MAX_S    115                 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
116         };                                        116         };
117 };                                                117 };
118                                                   118 
119 /* Flags for injecting specific smart errors *    119 /* Flags for injecting specific smart errors */
120 #define PDSM_SMART_INJECT_HEALTH_FATAL            120 #define PDSM_SMART_INJECT_HEALTH_FATAL          (1 << 0)
121 #define PDSM_SMART_INJECT_BAD_SHUTDOWN            121 #define PDSM_SMART_INJECT_BAD_SHUTDOWN          (1 << 1)
122                                                   122 
123 struct nd_papr_pdsm_smart_inject {                123 struct nd_papr_pdsm_smart_inject {
124         union {                                   124         union {
125                 struct {                          125                 struct {
126                         /* One or more of PDSM    126                         /* One or more of PDSM_SMART_INJECT_ */
127                         __u32 flags;              127                         __u32 flags;
128                         __u8 fatal_enable;        128                         __u8 fatal_enable;
129                         __u8 unsafe_shutdown_e    129                         __u8 unsafe_shutdown_enable;
130                 };                                130                 };
131                 __u8 buf[ND_PDSM_PAYLOAD_MAX_S    131                 __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
132         };                                        132         };
133 };                                                133 };
134                                                   134 
135 /*                                                135 /*
136  * Methods to be embedded in ND_CMD_CALL reque    136  * Methods to be embedded in ND_CMD_CALL request. These are sent to the kernel
137  * via 'nd_cmd_pkg.nd_command' member of the i    137  * via 'nd_cmd_pkg.nd_command' member of the ioctl struct
138  */                                               138  */
139 enum papr_pdsm {                                  139 enum papr_pdsm {
140         PAPR_PDSM_MIN = 0x0,                      140         PAPR_PDSM_MIN = 0x0,
141         PAPR_PDSM_HEALTH,                         141         PAPR_PDSM_HEALTH,
142         PAPR_PDSM_SMART_INJECT,                   142         PAPR_PDSM_SMART_INJECT,
143         PAPR_PDSM_MAX,                            143         PAPR_PDSM_MAX,
144 };                                                144 };
145                                                   145 
146 /* Maximal union that can hold all possible pa    146 /* Maximal union that can hold all possible payload types */
147 union nd_pdsm_payload {                           147 union nd_pdsm_payload {
148         struct nd_papr_pdsm_health health;        148         struct nd_papr_pdsm_health health;
149         struct nd_papr_pdsm_smart_inject smart    149         struct nd_papr_pdsm_smart_inject smart_inject;
150         __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];       150         __u8 buf[ND_PDSM_PAYLOAD_MAX_SIZE];
151 } __packed;                                       151 } __packed;
152                                                   152 
153 /*                                                153 /*
154  * PDSM-header + payload expected with ND_CMD_    154  * PDSM-header + payload expected with ND_CMD_CALL ioctl from libnvdimm
155  * Valid member of union 'payload' is identifi    155  * Valid member of union 'payload' is identified via 'nd_cmd_pkg.nd_command'
156  * that should always precede this struct when    156  * that should always precede this struct when sent to papr_scm via CMD_CALL
157  * interface.                                     157  * interface.
158  */                                               158  */
159 struct nd_pkg_pdsm {                              159 struct nd_pkg_pdsm {
160         __s32 cmd_status;       /* Out: Sub-cm    160         __s32 cmd_status;       /* Out: Sub-cmd status returned back */
161         __u16 reserved[2];      /* Ignored and    161         __u16 reserved[2];      /* Ignored and to be set as '' */
162         union nd_pdsm_payload payload;            162         union nd_pdsm_payload payload;
163 } __packed;                                       163 } __packed;
164                                                   164 
165 #endif /* _UAPI_ASM_POWERPC_PAPR_PDSM_H_ */       165 #endif /* _UAPI_ASM_POWERPC_PAPR_PDSM_H_ */
166                                                   166 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php