blob: 082f636fbf22132259b93ff6c08ec14c25262ee2 [file] [log] [blame]
Lawrence Tang3c878352022-07-08 14:04:50 +01001\documentclass{report}
2\usepackage{hyperref}
3\usepackage{adjustbox}
4\usepackage{placeins}
5
6% Metadata.
7\title{CPER-JSON Specification}
8\author{\parbox{\linewidth}{\centering%
9Lawrence Tang\endgraf
10Lawrence.Tang@arm.com\endgraf\medskip}}
11\date{\parbox{\linewidth}{\centering%
12Revision v0.0.1 (\today)\endgraf
13First revision released [DATE].}}
14
15% Commands.
16\newcommand*{\thead}[1]{\multicolumn{1}{|c|}{\bfseries #1}}
17\newcommand*{\jsontable}[1]{
18 \begin{table}[!ht]
19 \label{#1}
20 \centering
21 \begin{adjustbox}{center}
22 \begin{tabular}{|l|c|p{8cm}|}
23 \hline
24 \thead{Field Name} & \thead{Type} & \thead{Description} \\
25 \hline
26}
27\newcommand*{\jsontableend}[1]{
28 \hline
29 \end{tabular}
30 \end{adjustbox}
31 \caption{#1}
32 \label{table:headerrevstructure}
33 \end{table}
34 \FloatBarrier
35}
36
37\begin{document}
38\maketitle
39\tableofcontents
40\listoftables
41
42% Introductory section.
43\chapter{Preface}
44\section{Introduction \& Summary}
45This document lays out a structure for representing UEFI CPER records, as described in UEFI Appendix N
46\footnote{Version referenced is \href{https://uefi.org/sites/default/files/resources/UEFI_Spec_2_9_2021_03_18.pdf}{UEFI Specification 2021/03/18}.},
47 in a human-readable JSON format, intended to be interoperable with standard CPER binary.
48\\\\
49The C library released with this specification allows for the conversion between UEFI CPER records, an intermediate format, and the JSON structures
50defined in this document.
51
52% Specification section.
53\chapter{Main Structure Specification}
54\section{Parent Structure}
55\label{section:parentstructure}
56This structure contains descriptions of the CPER log header, as well as the section descriptors and
57section structures themselves within arrays. This is the structure returned by \texttt{cper\_to\_ir(FILE* cper\_file)} as JSON IR.
58
59% Parent structure table.
60\jsontable{table:parentstructure}
61header & object & A CPER header structure as defined in Section \ref{section:headerstructure}. \\
62\hline
63sectionDescriptors & array & An array of section descriptor objects as defined in Section \ref{section:sectiondescriptorstructure}. \\
64\hline
65sections & array & An array of section objects as defined in Chapter \ref{chapter:sectionchapter}. These sections are at the same index as their corresponding section descriptor within the \texttt{sectionDescriptors} array.\\
66\jsontableend{Parent structure field table.}
67
68% Header structure.
69\section{Header Structure}
70\label{section:headerstructure}
71This structure describes the JSON format of the standard CPER header as defined in section N.2.1 of the
72UEFI specification.
73
74% Header structure table.
75\jsontable{table:headerstructure}
76revision & object & A CPER revision object structure as defined in Subsection \ref{subsection:revisionstructure}. \\
77\hline
78sectionCount & int & The number of sections that are described by the CPER record.\\
79\hline
80severity & object & An error severity structure as described in \ref{subsection:headererrorseveritystructure}.\\
81\hline
82validationBits & object & A CPER header validation bitfield as described in Subsection \ref{subsection:headervalidbitfieldstructure}.\\
83\hline
84recordLength & uint64 & The total length of the binary CPER record, including the header, in bytes.\\
85\hline
86timestamp & string (\textbf{optional}) & The attached record timestamp, if the validity field is set. Formatted identically to \texttt{Date.toJson()} (ISO 8601), minus the trailing timezone letter. Timezone is local to the machine creating the record.\\
87\hline
88timestampIsPrecise & boolean (\textbf{optional}) & If a timestamp is attached, indicates whether the provided timestamp is precise.\\
89\hline
90platformID & string (\textbf{optional}) & If validation bit is set, uniquely identifying GUID of the platform. Platform SMBIOS UUID should be used to populate this field.\\
91\hline
92partitionID & string (\textbf{optional}) & If validation bit is set, GUID identifying the partition on which the error occurred.\\
93\hline
94creatorID & string & A GUID identifying the creator of the error record. May be overwritten by subsequent owners of the record.\\
95\hline
96notificationType & object & A CPER notification type structure as described in Subsection \ref{subsection:notificationtypestructure}.\\
97\hline
98recordID & uint64 & A unique value which, when combined with the \texttt{creatorID} field, uniquely identifies this error record on a given system.\\
99\hline
100flags & object & A CPER header flags structure, as defined in Subsection \ref{subsection:headerflagsstructure}.\\
101\hline
102persistenceInfo & uint64 & Produced and consumed by the creator of the error record identified by \texttt{creatorID}. Format undefined.\\
103\jsontableend{Header structure field table.}
104
105% Header error severity.
106\subsection{Header Error Severity Structure}
107\label{subsection:headererrorseveritystructure}
108This structure describes the error severity of a single CPER record.
109\jsontable{table:headererrorseveritystructure}
110name & string & The human readable name of this error severity, if known. \\
111\hline
112code & uint64 & The integer value of this error severity. \\
113\jsontableend{Header error severity structure field table.}
114
115% Header validation bitfield.
116\subsection{Header Validation Bitfield Structure}
117\label{subsection:headervalidbitfieldstructure}
118This structure describes a bitfield for validating the fields of the header of a single CPER record.
119\jsontable{table:headervalidbitfieldstructure}
120platformIDValid & boolean & Whether the "platformID" field in the header structure (\ref{section:headerstructure}) is valid. \\
121\hline
122timestampValid & boolean & Whether the "timestamp" field in the header structure (\ref{section:headerstructure}) is valid. \\
123\hline
124partitionIDValid & boolean & Whether the "partitionID" field in the header structure (\ref{section:headerstructure}) is valid.\\
125\jsontableend{Header validation bitfield structure field table.}
126
127% Header notification type.
128\subsection{Notification Type Structure}
129\label{subsection:notificationtypestructure}
130This structure describes the notification type of a single CPER record.
131\jsontable{table:notificationtypestructure}
132guid & string & The GUID of this notification type. Assigned GUIDs for types of CPER records are defined in UEFI Specification section N.2.1.1.\\
133\hline
134type & string & A human readable name, if available, of the notification type for the given GUID.\\
135\jsontableend{Notification type structure field table.}
136
137% Header flags.
138\subsection{Header Flags Structure}
139\label{subsection:headerflagsstructure}
140This structure describes the enabled flag on a given CPER record header.
141\jsontable{table:headerflagsstructure}
142name & string & A human readable name, if available, of this flag.\\
143\hline
144value & uint64 & The integer value of this flag.\\
145\jsontableend{Header flags structure field table.}
146
147%Section descriptor structure.
148\section{Section Descriptor Structure}
149\label{section:sectiondescriptorstructure}
150This section describes the JSON format of a single CPER record section descriptor as defined by section N.2.2 of the UEFI specification. An array of these structures is contained within the parent structure as defined in Section \ref{section:parentstructure}.
151
152%Section descriptor structure table.
153\jsontable{table:sectiondescriptorstructure}
154sectionOffset & uint64 & The offset (in bytes) of the section body this section descriptor describes from the base of the record header.\\
155\hline
156sectionLength & uint64 & The length (in bytes) of the section body.\\
157\hline
158revision & object & A CPER revision structure as defined in Subsection \ref{subsection:revisionstructure}.\\
159\hline
160validationBits.fruIDValid & boolean & Whether the "fruID" field on this section descriptor contains valid data.\\
161validationBits.fruStringValid & boolean & Whether the "fruString" field on this section descriptor contains valid data.\\
162\hline
163flags & object & A CPER section descriptor flags structure as described in Subsection \ref{subsection:sectiondescriptorflagsstructure}.\\
164\hline
165sectionType.data & string & GUID data for the type of section body.\\
166sectionType.type & string & The human readable name, if possible, for the type of section body. GUIDs for types of sectoin body are defined in UEFI specification section N.2.2 Table N-5 and section N.2.4.\\
167\hline
168fruID & string (\textbf{optional}) & If validation field set, the FRU ID of the section reporting the error.\\
169\hline
170severity.code & uint64 & The integer value of the severity of the described section.\\
171severity.name & string & If available, the human readable name for the severity of the described section.\\
172\hline
173fruText & string (\textbf{optional}) & If validation field set, ASCII string identifying the FRU hardware.\\
174\jsontableend{Section descriptor structure field table.}
175
176% Section descriptor flags.
177\subsection{Section Descriptor Flags Structure}
178\label{subsection:sectiondescriptorflagsstructure}
179This structure describes the enabled flags on a given CPER section descriptor.
180\jsontable{table:sectiondescriptorflagsstructure}
181primary & boolean & If true, indicates the section body should be associated with the error condition.\\
182\hline
183containmentWarning & boolean & If true, the error was not contained within the processor or memory heirarchy, and may have propagated elsewhere.\\
184\hline
185reset & boolean & If true, indicates the component has been reset and must be re-initialised or re-enabled by the operating system.\\
186\hline
187errorThresholdExceeded & boolean & If true, indicates the operating system may choose to discontinue use of this resource.\\
188\hline
189resourceNotAccessible & boolean & If true, the resource could not be queried for error information due to conflicts with other system software or resources. Some fields of the section will be invalid.\\
190\hline
191latentError & boolean & If true, indicates that action has been taken to ensure error containment, but the error has not been fully corrected. System software may choose to take further action before the data is consumed.\\
192\hline
193propagated & boolean & If true, indicates that the error has been propagated due to hardware poisoning.\\
194\hline
195overflow & boolean & If true, overflow of data structures used to manage errors has been detected. Some error records may be lost.\\
196\jsontableend{Section descriptor flags structure field table.}
197
198% Generic CPER structures.
199\section{Generic CPER Structures}
200This section describes generic CPER structures that are re-used throughout the specification.
201
202% Revision.
203\subsection{Revision Structure}
204\label{subsection:revisionstructure}
205This structure describes the revision of a single CPER record or sub-structure.
206\jsontable{table:revisionstructure}
207major & int & The major version number. An increase in this revision indicates the changes are not backward compatible. \\
208\hline
209minor & int & The minor version number. Incremented on additions of new GUID types, errata fixes, or clarifications. Backwards compatible with the same major version number. \\
210\jsontableend{CPER revision structure field table.}
211
212%Sections.
213\chapter{Section Specification}
214\label{chapter:sectionchapter}
215This chapter defines section body formats for all of the sections defined within UEFI Specification section N.2.4.
216
217% Generic processor error section.
218\section{Generic Processor Error Section}
219\label{section:genericprocessorerrorsection}
220This section describes the JSON format for a single Generic Processor Error Section from a CPER record. The GUID used for Generic Processor Error Sections is \texttt{\{x9876CCAD, 0x47B4, 0x4bdb, \{0xB6, 0x5E, 0x16, 0xF1, 0x93, 0xC4, 0xF3, 0xDB\}\}}.
221\jsontable{table:genericprocessorerrorsection}
Lawrence Tang12c1f652022-07-08 15:29:37 +0100222validationBits & object & A Generic Processor Error Validation Structure, as described in Subsection \ref{subsection:genericprocessorvalidationstructure}.\\
223\hline
224processorType.name & string & If available, the human readable name of the processor type.\\
225processorType.value & uint64 & The integer value of the processor type.\\
226\hline
227processorISA.name & string & If available, the human readable name of the processor ISA.\\
228processorISA.value & uint64 & The integer value corresponding to the processor ISA.\\
229\hline
230errorType.name & string & If available, the human readable name of the type of processor error this section describes.\\
231errorType.value & uint64 & The integer value corresponding to the processor error type.\\
232\hline
233operation.name & string & If available, the human readable name of the operation.\\
234operation.value & uint64 & The integer value corresponding to the operation.\\
235\hline
236flags & object & Flag information for the Generic Processor Error as described in Subsection \ref{subsection:genericprocessorflagsstructure}.\\
237\hline
238level & int & The level of the structure at which the error occurred.\\
239\hline
240cpuVersionInfo & uint64 & The CPU version information as reported by CPUID with EAX=1. On ARM, this is MIDR\_EL1.\\
241\hline
242cpuBrandString & string & The ASCII brand string of the CPU. This field is optional on ARM.\\
243\hline
244processorID & uint64 & The unique identifier of the logical processor. On ARM, this is MPIDR\_EL1.\\
245\hline
246targetAddress & uint64 & The target address associated with the error.\\
247\hline
248requestorID & uint64 & ID of the requestor associated with the error.\\
249\hline
250responderID & uint64 & ID of the responder associated with the error.\\
251\hline
252instructionIP & uint64 & Identifies the instruction pointer at the point of error.\\
253\jsontableend{Generic Processor Error structure field table.}
Lawrence Tang3c878352022-07-08 14:04:50 +0100254
255% Generic processor error validation structure.
256\subsection{Generic Processor Error Validation Structure}
257\label{subsection:genericprocessorvalidationstructure}
Lawrence Tang12c1f652022-07-08 15:29:37 +0100258This structure describes the valdation bits structure of a General Processor Error CPER section.
Lawrence Tang3c878352022-07-08 14:04:50 +0100259\jsontable{table:genericprocessorvalidationstructure}
260processorTypeValid & boolean & Whether the "processorType" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
261\hline
262processorISAValid & boolean & Whether the "processorISA" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
263\hline
264errorTypeValid & boolean & Whether the "errorType" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
265\hline
266operationValid & boolean & Whether the "operation" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
267\hline
268flagsValid & boolean & Whether the "flags" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
269\hline
270levelValid & boolean & Whether the "levelValid" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
271\hline
272cpuVersionValid & boolean & Whether the "cpuVersion" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
273\hline
274cpuBrandInfoValid & boolean & Whether the "cpuBrandInfo" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
275\hline
276cpuIDValid & boolean & Whether the "cpuID" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
277\hline
278targetAddressValid & boolean & Whether the "targetAddress" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
279\hline
280requesterIDValid & boolean & Whether the "requesterID" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
281\hline
282responderIDValid & boolean & Whether the "responderID" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
283\hline
284instructionIPValid & boolean & Whether the "instructionIP" field of the Generic Processor Error section (\ref{section:genericprocessorerrorsection}) is valid.\\
Lawrence Tang12c1f652022-07-08 15:29:37 +0100285\jsontableend{Generic Processor Error validation structure field table.}
286
287% Generic processor error flags structure.
288\subsection{Generic Processor Error Flags Structure}
289\label{subsection:genericprocessorflagsstructure}
290This structure describes the flags structure of a General Processor Error CPER section.
291\jsontable{table:genericprocessorflagsstructure}
292restartable & boolean & Whether program execution can be restarted reliably after the error.\\
293\hline
294preciseIP & boolean & Whether the instruction IP captured is directly associated with the error.\\
295\hline
296overflow & boolean & Whether a machine check overflow occurred (multiple errors occurred at once).\\
297\hline
298corrected & boolean & Whether the error was corrected by hardware/firmware.\\
299\jsontableend{Generic Processor Error flags structure field table.}
300
301% IA32/x64 error section.
302\section{IA32/x64 Processor Error Section}
303\label{section:ia32x64errorsection}
304This section describes the JSON format for a single IA32/x64 Error Section from a CPER record. The GUID used for IA32/x64 Processor Error Sections is \texttt{\{0xDC3EA0B0, 0xA144, 0x4797, \{0xB9, 0x5B, 0x53, 0xFA, 0x24, 0x2B, 0x6E, 0x1D\}\}}.
305\jsontable{table:genericprocessorerrorsection}
306validationBits & object & IA32/x64 Processor Error Validation Structure as described in Subsection \ref{subsection:ia32x64processorflagsstructure}.\\
307\hline
308localAPICID & uint64 & The APIC ID of the processor.\\
309\hline
310cpuidInfo & object & IA32/x64 CPUINFO Structure as defined in Subsection \ref{subsection:ia32x64cpuinfostructure}.\\
311\hline
312processorErrorInfo & array & Array of IA32/x64 Processor Error Info Structures as described in Subsection \ref{subsection:ia32x64processorerrorinfostructure}.\\
313\hline
314processorContextInfo & array & Array of IA32/x64 Processor Context Info Structures as described in Subsection \ref{subsection:ia32x64processorcontextinfostructure}.\\
315\jsontableend{IA32/x64 Processor Error structure field table.}
316
317% IA32/x64 validation bitfield structure.
318\subsection{IA32/x64 Processor Error Validation Structure}
319\label{subsection:ia32x64processorflagsstructure}
320This structure describes the validation bitfield structure of an IA32/x64 Error CPER section.
321\jsontable{table:ia32x64processorflagsstructure}
322localAPICIDValid & boolean & Whether the "localAPICID" field of the IA32/x64 Error section (\ref{section:ia32x64errorsection}) is valid.\\
323\hline
324cpuIDInfoValid & boolean & Whether the "cpuIDInfo" field of the IA32/x64 Error section (\ref{section:ia32x64errorsection}) is valid.\\
325\hline
326processorErrorInfoNum & int & The number of IA32/x64 Processor Error Info Structures (\ref{subsection:ia32x64processorerrorinfostructure}) that are included with this error section.\\
327\hline
328processorContextInfoNum & int & The number of IA32/x64 Processor Context Info Structures (\ref{subsection:ia32x64processorcontextinfostructure}) that are included with this error section.\\
329\jsontableend{IA32/x64 Processor Error validation structure field table.}
330
331% IA32/x64 CPUINFO structure.
332\subsection{IA32/x64 CPUINFO Structure}
333\label{subsection:ia32x64cpuinfostructure}
334This structure describes the CPUINFO structure of an IA32/x64 Error CPER section.
335\jsontable{table:ia32x64cpuinfostructure}
336eax & uint64 & Value of the EAX register resulting from a call to CPUID with EAX=1.\\
337\hline
338ebx & uint64 & Value of the EBX register resulting from a call to CPUID with EAX=1.\\
339\hline
340ecx & uint64 & Value of the ECX register resulting from a call to CPUID with EAX=1.\\
341\hline
342edx & uint64 & Value of the EDX register resulting from a call to CPUID with EAX=1.\\
343\jsontableend{IA32/x64 CPUINFO structure field table.}
344
345% IA32/x64 Processor Error Info structure.
346\subsection{IA32/x64 Processor Error Info Structure}
347\label{subsection:ia32x64processorerrorinfostructure}
348This structure describes a single IA32/x64 Processor Error Info sub-section, which is part of the larger IA32/x64 record (\ref{section:ia32x64errorsection}).
349\jsontable{table:ia32x64processorerrorinfostructure}
350todo & todo & todo.\\
351\hline
352\jsontableend{IA32/x64 Processor Error Info structure field table.}
353
354% IA32/x64 Processor Context Info structure.
355\subsection{IA32/x64 Processor Context Info Structure}
356\label{subsection:ia32x64processorcontextinfostructure}
357This structure describes a single IA32/x64 Processor Context Info sub-section, which is part of the larger IA32/x64 record (\ref{section:ia32x64errorsection}).
358\jsontable{table:ia32x64processorcontextinfostructure}
359todo & todo & todo.\\
360\hline
361\jsontableend{IA32/x64 Processor Context Info structure field table.}
Lawrence Tang3c878352022-07-08 14:04:50 +0100362
363\end{document}