blob: 57e26571829196520e108e7c39ed22e9a7e4e1e0 [file] [log] [blame]
Ed Tanous9c7ba1d2024-09-25 13:15:26 -07001/** @file
2 GUIDs and definitions used for Common Platform Error Record.
3
4 Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>
5 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 @par Revision Reference:
9 GUIDs defined in UEFI 2.7 Specification.
10
John Chungf8fc7052024-05-03 20:05:29 +080011**/
John Chungf8fc7052024-05-03 20:05:29 +080012
13#ifndef __CPER_GUID_H__
14#define __CPER_GUID_H__
15
Karthik Rajagopalan255bd812024-09-06 14:36:34 -070016#include "BaseTypes.h"
Ed Tanous2d17ace2024-08-27 14:45:38 -070017#include "common-utils.h"
Karthik Rajagopalan255bd812024-09-06 14:36:34 -070018
19#ifdef __cplusplus
20extern "C" {
21#endif
22
Ed Tanousc6fead12024-06-18 13:15:58 -070023#pragma pack(push, 1)
John Chungf8fc7052024-05-03 20:05:29 +080024
25#define EFI_ERROR_RECORD_SIGNATURE_START SIGNATURE_32('C', 'P', 'E', 'R')
26#define EFI_ERROR_RECORD_SIGNATURE_END 0xFFFFFFFF
27
28#define EFI_ERROR_RECORD_REVISION 0x0101
29
30///
31/// Error Severity in Error Record Header and Error Section Descriptor
32///@{
33#define EFI_GENERIC_ERROR_RECOVERABLE 0x00000000
34#define EFI_GENERIC_ERROR_FATAL 0x00000001
35#define EFI_GENERIC_ERROR_CORRECTED 0x00000002
36#define EFI_GENERIC_ERROR_INFO 0x00000003
37///@}
38
39///
40/// The validation bit mask indicates the validity of the following fields
41/// in Error Record Header.
42///@{
43#define EFI_ERROR_RECORD_HEADER_PLATFORM_ID_VALID BIT0
44#define EFI_ERROR_RECORD_HEADER_TIME_STAMP_VALID BIT1
45#define EFI_ERROR_RECORD_HEADER_PARTITION_ID_VALID BIT2
46///@}
47
48///
49/// Timestamp is precise if this bit is set and correlates to the time of the
50/// error event.
51///
52#define EFI_ERROR_TIME_STAMP_PRECISE BIT0
53
54///
55/// The timestamp correlates to the time when the error information was collected
56/// by the system software and may not necessarily represent the time of the error
57/// event. The timestamp contains the local time in BCD format.
58///
59typedef struct {
60 UINT8 Seconds;
61 UINT8 Minutes;
62 UINT8 Hours;
63 UINT8 Flag;
64 UINT8 Day;
65 UINT8 Month;
66 UINT8 Year;
67 UINT8 Century;
68} EFI_ERROR_TIME_STAMP;
69
70///
71/// GUID value indicating the record association with an error event notification type.
72///@{
73#define EFI_EVENT_NOTIFICATION_TYEP_CMC_GUID \
74 { \
75 0x2DCE8BB1, 0xBDD7, 0x450e, \
76 { \
77 0xB9, 0xAD, 0x9C, 0xF4, 0xEB, 0xD4, 0xF8, 0x90 \
78 } \
79 }
80#define EFI_EVENT_NOTIFICATION_TYEP_CPE_GUID \
81 { \
82 0x4E292F96, 0xD843, 0x4a55, \
83 { \
84 0xA8, 0xC2, 0xD4, 0x81, 0xF2, 0x7E, 0xBE, 0xEE \
85 } \
86 }
87#define EFI_EVENT_NOTIFICATION_TYEP_MCE_GUID \
88 { \
89 0xE8F56FFE, 0x919C, 0x4cc5, \
90 { \
91 0xBA, 0x88, 0x65, 0xAB, 0xE1, 0x49, 0x13, 0xBB \
92 } \
93 }
94#define EFI_EVENT_NOTIFICATION_TYEP_PCIE_GUID \
95 { \
96 0xCF93C01F, 0x1A16, 0x4dfc, \
97 { \
98 0xB8, 0xBC, 0x9C, 0x4D, 0xAF, 0x67, 0xC1, 0x04 \
99 } \
100 }
101#define EFI_EVENT_NOTIFICATION_TYEP_INIT_GUID \
102 { \
103 0xCC5263E8, 0x9308, 0x454a, \
104 { \
105 0x89, 0xD0, 0x34, 0x0B, 0xD3, 0x9B, 0xC9, 0x8E \
106 } \
107 }
108#define EFI_EVENT_NOTIFICATION_TYEP_NMI_GUID \
109 { \
110 0x5BAD89FF, 0xB7E6, 0x42c9, \
111 { \
112 0x81, 0x4A, 0xCF, 0x24, 0x85, 0xD6, 0xE9, 0x8A \
113 } \
114 }
115#define EFI_EVENT_NOTIFICATION_TYEP_BOOT_GUID \
116 { \
117 0x3D61A466, 0xAB40, 0x409a, \
118 { \
119 0xA6, 0x98, 0xF3, 0x62, 0xD4, 0x64, 0xB3, 0x8F \
120 } \
121 }
122#define EFI_EVENT_NOTIFICATION_TYEP_DMAR_GUID \
123 { \
124 0x667DD791, 0xC6B3, 0x4c27, \
125 { \
126 0x8A, 0x6B, 0x0F, 0x8E, 0x72, 0x2D, 0xEB, 0x41 \
127 } \
128 }
129#define EFI_EVENT_NOTIFICATION_TYPE_DMAR_SEA \
130 { \
131 0x9A78788A, 0xBBE8, 0x11E4, \
132 { \
133 0x80, 0x9E, 0x67, 0x61, 0x1E, 0x5D, 0x46, 0xB0 \
134 } \
135 }
136#define EFI_EVENT_NOTIFICATION_TYPE_DMAR_SEI \
137 { \
138 0x5C284C81, 0xB0AE, 0x4E87, \
139 { \
140 0xA3, 0x22, 0xB0, 0x4C, 0x85, 0x62, 0x43, 0x23 \
141 } \
142 }
143#define EFI_EVENT_NOTIFICATION_TYPE_DMAR_PEI \
144 { \
145 0x09A9D5AC, 0x5204, 0x4214, \
146 { \
147 0x96, 0xE5, 0x94, 0x99, 0x2E, 0x75, 0x2B, 0xCD \
148 } \
149 }
150///@}
151
152///
153/// Error Record Header Flags
154///@{
155#define EFI_HW_ERROR_FLAGS_RECOVERED 0x00000001
156#define EFI_HW_ERROR_FLAGS_PREVERR 0x00000002
157#define EFI_HW_ERROR_FLAGS_SIMULATED 0x00000004
158///@}
159
160///
161/// Common error record header
162///
163typedef struct {
164 UINT32 SignatureStart;
165 UINT16 Revision;
166 UINT32 SignatureEnd;
167 UINT16 SectionCount;
168 UINT32 ErrorSeverity;
169 UINT32 ValidationBits;
170 UINT32 RecordLength;
171 EFI_ERROR_TIME_STAMP TimeStamp;
172 EFI_GUID PlatformID;
173 EFI_GUID PartitionID;
174 EFI_GUID CreatorID;
175 EFI_GUID NotificationType;
176 UINT64 RecordID;
177 UINT32 Flags;
178 UINT64 PersistenceInfo;
179 UINT8 Resv1[12];
180 ///
181 /// An array of SectionCount descriptors for the associated
182 /// sections. The number of valid sections is equivalent to the
183 /// SectionCount. The buffer size of the record may include
184 /// more space to dynamically add additional Section
185 /// Descriptors to the error record.
186 ///
187} EFI_COMMON_ERROR_RECORD_HEADER;
188
189#define EFI_ERROR_SECTION_REVISION 0x0100
190
191///
192/// Validity Fields in Error Section Descriptor.
193///
194#define EFI_ERROR_SECTION_FRU_ID_VALID BIT0
195#define EFI_ERROR_SECTION_FRU_STRING_VALID BIT1
196
197///
198/// Flag field contains information that describes the error section
199/// in Error Section Descriptor.
200///
201#define EFI_ERROR_SECTION_FLAGS_PRIMARY BIT0
202#define EFI_ERROR_SECTION_FLAGS_CONTAINMENT_WARNING BIT1
203#define EFI_ERROR_SECTION_FLAGS_RESET BIT2
204#define EFI_ERROR_SECTION_FLAGS_ERROR_THRESHOLD_EXCEEDED BIT3
205#define EFI_ERROR_SECTION_FLAGS_RESOURCE_NOT_ACCESSIBLE BIT4
206#define EFI_ERROR_SECTION_FLAGS_LATENT_ERROR BIT5
207
208///
209/// Error Sectition Type GUIDs in Error Section Descriptor
210///@{
211#define EFI_ERROR_SECTION_PROCESSOR_GENERIC_GUID \
212 { \
213 0x9876ccad, 0x47b4, 0x4bdb, \
214 { \
215 0xb6, 0x5e, 0x16, 0xf1, 0x93, 0xc4, 0xf3, 0xdb \
216 } \
217 }
218#define EFI_ERROR_SECTION_PROCESSOR_SPECIFIC_GUID \
219 { \
220 0xdc3ea0b0, 0xa144, 0x4797, \
221 { \
222 0xb9, 0x5b, 0x53, 0xfa, 0x24, 0x2b, 0x6e, 0x1d \
223 } \
224 }
225#define EFI_ERROR_SECTION_PROCESSOR_SPECIFIC_IA32X64_GUID \
226 { \
227 0xdc3ea0b0, 0xa144, 0x4797, \
228 { \
229 0xb9, 0x5b, 0x53, 0xfa, 0x24, 0x2b, 0x6e, 0x1d \
230 } \
231 }
232#define EFI_ERROR_SECTION_PROCESSOR_SPECIFIC_ARM_GUID \
233 { \
234 0xe19e3d16, 0xbc11, 0x11e4, \
235 { \
236 0x9c, 0xaa, 0xc2, 0x05, 0x1d, 0x5d, 0x46, 0xb0 \
237 } \
238 }
239#define EFI_ERROR_SECTION_PLATFORM_MEMORY_GUID \
240 { \
241 0xa5bc1114, 0x6f64, 0x4ede, \
242 { \
243 0xb8, 0x63, 0x3e, 0x83, 0xed, 0x7c, 0x83, 0xb1 \
244 } \
245 }
246#define EFI_ERROR_SECTION_PLATFORM_MEMORY2_GUID \
247 { \
248 0x61EC04FC, 0x48E6, 0xD813, \
249 { \
250 0x25, 0xC9, 0x8D, 0xAA, 0x44, 0x75, 0x0B, 0x12 \
251 } \
252 }
253#define EFI_ERROR_SECTION_PCIE_GUID \
254 { \
255 0xd995e954, 0xbbc1, 0x430f, \
256 { \
257 0xad, 0x91, 0xb4, 0x4d, 0xcb, 0x3c, 0x6f, 0x35 \
258 } \
259 }
260#define EFI_ERROR_SECTION_FW_ERROR_RECORD_GUID \
261 { \
262 0x81212a96, 0x09ed, 0x4996, \
263 { \
264 0x94, 0x71, 0x8d, 0x72, 0x9c, 0x8e, 0x69, 0xed \
265 } \
266 }
267#define EFI_ERROR_SECTION_PCI_PCIX_BUS_GUID \
268 { \
269 0xc5753963, 0x3b84, 0x4095, \
270 { \
271 0xbf, 0x78, 0xed, 0xda, 0xd3, 0xf9, 0xc9, 0xdd \
272 } \
273 }
274#define EFI_ERROR_SECTION_PCI_DEVICE_GUID \
275 { \
276 0xeb5e4685, 0xca66, 0x4769, \
277 { \
278 0xb6, 0xa2, 0x26, 0x06, 0x8b, 0x00, 0x13, 0x26 \
279 } \
280 }
281#define EFI_ERROR_SECTION_DMAR_GENERIC_GUID \
282 { \
283 0x5b51fef7, 0xc79d, 0x4434, \
284 { \
285 0x8f, 0x1b, 0xaa, 0x62, 0xde, 0x3e, 0x2c, 0x64 \
286 } \
287 }
288#define EFI_ERROR_SECTION_DIRECTED_IO_DMAR_GUID \
289 { \
290 0x71761d37, 0x32b2, 0x45cd, \
291 { \
292 0xa7, 0xd0, 0xb0, 0xfe, 0xdd, 0x93, 0xe8, 0xcf \
293 } \
294 }
295#define EFI_ERROR_SECTION_IOMMU_DMAR_GUID \
296 { \
297 0x036f84e1, 0x7f37, 0x428c, \
298 { \
299 0xa7, 0x9e, 0x57, 0x5f, 0xdf, 0xaa, 0x84, 0xec \
300 } \
301 }
302///@}
303
304///
305/// Error Section Descriptor
306///
307typedef struct {
308 UINT32 SectionOffset;
309 UINT32 SectionLength;
310 UINT16 Revision;
311 UINT8 SecValidMask;
312 UINT8 Resv1;
313 UINT32 SectionFlags;
314 EFI_GUID SectionType;
315 EFI_GUID FruId;
316 UINT32 Severity;
317 CHAR8 FruString[20];
318} EFI_ERROR_SECTION_DESCRIPTOR;
319
320///
321/// The validation bit mask indicates whether or not each of the following fields are
322/// valid in Proessor Generic Error section.
323///@{
324#define EFI_GENERIC_ERROR_PROC_TYPE_VALID BIT0
325#define EFI_GENERIC_ERROR_PROC_ISA_VALID BIT1
326#define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_VALID BIT2
327#define EFI_GENERIC_ERROR_PROC_OPERATION_VALID BIT3
328#define EFI_GENERIC_ERROR_PROC_FLAGS_VALID BIT4
329#define EFI_GENERIC_ERROR_PROC_LEVEL_VALID BIT5
330#define EFI_GENERIC_ERROR_PROC_VERSION_VALID BIT6
331#define EFI_GENERIC_ERROR_PROC_BRAND_VALID BIT7
332#define EFI_GENERIC_ERROR_PROC_ID_VALID BIT8
333#define EFI_GENERIC_ERROR_PROC_TARGET_ADDR_VALID BIT9
334#define EFI_GENERIC_ERROR_PROC_REQUESTER_ID_VALID BIT10
335#define EFI_GENERIC_ERROR_PROC_RESPONDER_ID_VALID BIT11
336#define EFI_GENERIC_ERROR_PROC_INST_IP_VALID BIT12
337///@}
338
339///
340/// The type of the processor architecture in Proessor Generic Error section.
341///@{
342#define EFI_GENERIC_ERROR_PROC_TYPE_IA32_X64 0x00
343#define EFI_GENERIC_ERROR_PROC_TYPE_IA64 0x01
344#define EFI_GENERIC_ERROR_PROC_TYPE_ARM 0x02
345///@}
346
347///
348/// The type of the instruction set executing when the error occurred in Proessor
349/// Generic Error section.
350///@{
351#define EFI_GENERIC_ERROR_PROC_ISA_IA32 0x00
352#define EFI_GENERIC_ERROR_PROC_ISA_IA64 0x01
353#define EFI_GENERIC_ERROR_PROC_ISA_X64 0x02
354#define EFI_GENERIC_ERROR_PROC_ISA_ARM_A32_T32 0x03
355#define EFI_GENERIC_ERROR_PROC_ISA_ARM_A64 0x04
356///@}
357
358///
359/// The type of error that occurred in Proessor Generic Error section.
360///@{
361#define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_UNKNOWN 0x00
362#define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_CACHE 0x01
363#define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_TLB 0x02
364#define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_BUS 0x04
365#define EFI_GENERIC_ERROR_PROC_ERROR_TYPE_MICRO_ARCH 0x08
366///@}
367
368///
369/// The type of operation in Proessor Generic Error section.
370///@{
371#define EFI_GENERIC_ERROR_PROC_OPERATION_GENERIC 0x00
372#define EFI_GENERIC_ERROR_PROC_OPERATION_DATA_READ 0x01
373#define EFI_GENERIC_ERROR_PROC_OPERATION_DATA_WRITE 0x02
374#define EFI_GENERIC_ERROR_PROC_OPERATION_INSTRUCTION_EXEC 0x03
375///@}
376
377///
378/// Flags bit mask indicates additional information about the error in Proessor Generic
379/// Error section
380///@{
381#define EFI_GENERIC_ERROR_PROC_FLAGS_RESTARTABLE BIT0
382#define EFI_GENERIC_ERROR_PROC_FLAGS_PRECISE_IP BIT1
383#define EFI_GENERIC_ERROR_PROC_FLAGS_OVERFLOW BIT2
384#define EFI_GENERIC_ERROR_PROC_FLAGS_CORRECTED BIT3
385///@}
386
387///
388/// Processor Generic Error Section
389/// describes processor reported hardware errors for logical processors in the system.
390///
391typedef struct {
392 UINT64 ValidFields;
393 UINT8 Type;
394 UINT8 Isa;
395 UINT8 ErrorType;
396 UINT8 Operation;
397 UINT8 Flags;
398 UINT8 Level;
399 UINT16 Resv1;
400 UINT64 VersionInfo;
401 CHAR8 BrandString[128];
402 UINT64 ApicId;
403 UINT64 TargetAddr;
404 UINT64 RequestorId;
405 UINT64 ResponderId;
406 UINT64 InstructionIP;
407} EFI_PROCESSOR_GENERIC_ERROR_DATA;
408
409///
410/// IA32 and x64 Specific definitions.
411///
412
413///
414/// GUID value indicating the type of Processor Error Information structure
415/// in IA32/X64 Processor Error Information Structure.
416///@{
417#define EFI_IA32_X64_ERROR_TYPE_CACHE_CHECK_GUID \
418 { \
419 0xA55701F5, 0xE3EF, 0x43de, \
420 { \
421 0xAC, 0x72, 0x24, 0x9B, 0x57, 0x3F, 0xAD, 0x2C \
422 } \
423 }
424#define EFI_IA32_X64_ERROR_TYPE_TLB_CHECK_GUID \
425 { \
426 0xFC06B535, 0x5E1F, 0x4562, \
427 { \
428 0x9F, 0x25, 0x0A, 0x3B, 0x9A, 0xDB, 0x63, 0xC3 \
429 } \
430 }
431#define EFI_IA32_X64_ERROR_TYPE_BUS_CHECK_GUID \
432 { \
433 0x1CF3F8B3, 0xC5B1, 0x49a2, \
434 { \
435 0xAA, 0x59, 0x5E, 0xEF, 0x92, 0xFF, 0xA6, 0x3C \
436 } \
437 }
438#define EFI_IA32_X64_ERROR_TYPE_MS_CHECK_GUID \
439 { \
440 0x48AB7F57, 0xDC34, 0x4f6c, \
441 { \
442 0xA7, 0xD3, 0xB0, 0xB5, 0xB0, 0xA7, 0x43, 0x14 \
443 } \
444 }
445extern EFI_GUID gEfiIa32x64ErrorTypeCacheCheckGuid;
446extern EFI_GUID gEfiIa32x64ErrorTypeTlbCheckGuid;
447extern EFI_GUID gEfiIa32x64ErrorTypeBusCheckGuid;
448extern EFI_GUID gEfiIa32x64ErrorTypeMsCheckGuid;
449
450///@}
451
452///
453/// The validation bit mask indicates which fields in the IA32/X64 Processor
454/// Error Record structure are valid.
455///@{
456#define EFI_IA32_X64_PROCESSOR_ERROR_APIC_ID_VALID BIT0
457#define EFI_IA32_X64_PROCESSOR_ERROR_CPU_ID_INFO_VALID BIT1
458///@}
459
460///
461/// IA32/X64 Processor Error Record
462///
463typedef struct {
464 UINT64 ValidFields;
465 UINT64 ApicId;
466 UINT8 CpuIdInfo[48];
467} EFI_IA32_X64_PROCESSOR_ERROR_RECORD;
468
469///
470/// The validation bit mask indicates which fields in the Cache Check structure
471/// are valid.
472///@{
473#define EFI_CACHE_CHECK_TRANSACTION_TYPE_VALID BIT0
474#define EFI_CACHE_CHECK_OPERATION_VALID BIT1
475#define EFI_CACHE_CHECK_LEVEL_VALID BIT2
476#define EFI_CACHE_CHECK_CONTEXT_CORRUPT_VALID BIT3
477#define EFI_CACHE_CHECK_UNCORRECTED_VALID BIT4
478#define EFI_CACHE_CHECK_PRECISE_IP_VALID BIT5
479#define EFI_CACHE_CHECK_RESTARTABLE_VALID BIT6
480#define EFI_CACHE_CHECK_OVERFLOW_VALID BIT7
481///@}
482
483///
484/// Type of cache error in the Cache Check structure
485///@{
486#define EFI_CACHE_CHECK_ERROR_TYPE_INSTRUCTION 0
487#define EFI_CACHE_CHECK_ERROR_TYPE_DATA_ACCESS 1
488#define EFI_CACHE_CHECK_ERROR_TYPE_GENERIC 2
489///@}
490
491///
492/// Type of cache operation that caused the error in the Cache
493/// Check structure
494///@{
495#define EFI_CACHE_CHECK_OPERATION_TYPE_GENERIC 0
496#define EFI_CACHE_CHECK_OPERATION_TYPE_GENERIC_READ 1
497#define EFI_CACHE_CHECK_OPERATION_TYPE_GENERIC_WRITE 2
498#define EFI_CACHE_CHECK_OPERATION_TYPE_DATA_READ 3
499#define EFI_CACHE_CHECK_OPERATION_TYPE_DATA_WRITE 4
500#define EFI_CACHE_CHECK_OPERATION_TYPE_INSTRUCTION_FETCH 5
501#define EFI_CACHE_CHECK_OPERATION_TYPE_PREFETCH 6
502#define EFI_CACHE_CHECK_OPERATION_TYPE_EVICTION 7
503#define EFI_CACHE_CHECK_OPERATION_TYPE_SNOOP 8
504///@}
505
506///
507/// IA32/X64 Cache Check Structure
508///
509typedef struct {
510 UINT64 ValidFields : 16;
511 UINT64 TransactionType : 2;
512 UINT64 Operation : 4;
513 UINT64 Level : 3;
514 UINT64 ContextCorrupt : 1;
515 UINT64 ErrorUncorrected : 1;
516 UINT64 PreciseIp : 1;
517 UINT64 RestartableIp : 1;
518 UINT64 Overflow : 1;
519 UINT64 Resv1 : 34;
520} EFI_IA32_X64_CACHE_CHECK_INFO;
521
522///
523/// The validation bit mask indicates which fields in the TLB Check structure
524/// are valid.
525///@{
526#define EFI_TLB_CHECK_TRANSACTION_TYPE_VALID BIT0
527#define EFI_TLB_CHECK_OPERATION_VALID BIT1
528#define EFI_TLB_CHECK_LEVEL_VALID BIT2
529#define EFI_TLB_CHECK_CONTEXT_CORRUPT_VALID BIT3
530#define EFI_TLB_CHECK_UNCORRECTED_VALID BIT4
531#define EFI_TLB_CHECK_PRECISE_IP_VALID BIT5
532#define EFI_TLB_CHECK_RESTARTABLE_VALID BIT6
533#define EFI_TLB_CHECK_OVERFLOW_VALID BIT7
534///@}
535
536///
537/// Type of cache error in the TLB Check structure
538///@{
539#define EFI_TLB_CHECK_ERROR_TYPE_INSTRUCTION 0
540#define EFI_TLB_CHECK_ERROR_TYPE_DATA_ACCESS 1
541#define EFI_TLB_CHECK_ERROR_TYPE_GENERIC 2
542///@}
543
544///
545/// Type of cache operation that caused the error in the TLB
546/// Check structure
547///@{
548#define EFI_TLB_CHECK_OPERATION_TYPE_GENERIC 0
549#define EFI_TLB_CHECK_OPERATION_TYPE_GENERIC_READ 1
550#define EFI_TLB_CHECK_OPERATION_TYPE_GENERIC_WRITE 2
551#define EFI_TLB_CHECK_OPERATION_TYPE_DATA_READ 3
552#define EFI_TLB_CHECK_OPERATION_TYPE_DATA_WRITE 4
553#define EFI_TLB_CHECK_OPERATION_TYPE_INST_FETCH 5
554#define EFI_TLB_CHECK_OPERATION_TYPE_PREFETCH 6
555///@}
556
557///
558/// IA32/X64 TLB Check Structure
559///
560typedef struct {
561 UINT64 ValidFields : 16;
562 UINT64 TransactionType : 2;
563 UINT64 Operation : 4;
564 UINT64 Level : 3;
565 UINT64 ContextCorrupt : 1;
566 UINT64 ErrorUncorrected : 1;
567 UINT64 PreciseIp : 1;
568 UINT64 RestartableIp : 1;
569 UINT64 Overflow : 1;
570 UINT64 Resv1 : 34;
571} EFI_IA32_X64_TLB_CHECK_INFO;
572
573///
574/// The validation bit mask indicates which fields in the MS Check structure
575/// are valid.
576///@{
577#define EFI_BUS_CHECK_TRANSACTION_TYPE_VALID BIT0
578#define EFI_BUS_CHECK_OPERATION_VALID BIT1
579#define EFI_BUS_CHECK_LEVEL_VALID BIT2
580#define EFI_BUS_CHECK_CONTEXT_CORRUPT_VALID BIT3
581#define EFI_BUS_CHECK_UNCORRECTED_VALID BIT4
582#define EFI_BUS_CHECK_PRECISE_IP_VALID BIT5
583#define EFI_BUS_CHECK_RESTARTABLE_VALID BIT6
584#define EFI_BUS_CHECK_OVERFLOW_VALID BIT7
585#define EFI_BUS_CHECK_PARTICIPATION_TYPE_VALID BIT8
586#define EFI_BUS_CHECK_TIME_OUT_VALID BIT9
587#define EFI_BUS_CHECK_ADDRESS_SPACE_VALID BIT10
588///@}
589
590///
591/// Type of cache error in the Bus Check structure
592///@{
593#define EFI_BUS_CHECK_ERROR_TYPE_INSTRUCTION 0
594#define EFI_BUS_CHECK_ERROR_TYPE_DATA_ACCESS 1
595#define EFI_BUS_CHECK_ERROR_TYPE_GENERIC 2
596///@}
597
598///
599/// Type of cache operation that caused the error in the Bus
600/// Check structure
601///@{
602#define EFI_BUS_CHECK_OPERATION_TYPE_GENERIC 0
603#define EFI_BUS_CHECK_OPERATION_TYPE_GENERIC_READ 1
604#define EFI_BUS_CHECK_OPERATION_TYPE_GENERIC_WRITE 2
605#define EFI_BUS_CHECK_OPERATION_TYPE_DATA_READ 3
606#define EFI_BUS_CHECK_OPERATION_TYPE_DATA_WRITE 4
607#define EFI_BUS_CHECK_OPERATION_TYPE_INST_FETCH 5
608#define EFI_BUS_CHECK_OPERATION_TYPE_PREFETCH 6
609///@}
610
611///
612/// Type of Participation
613///@{
614#define EFI_BUS_CHECK_PARTICIPATION_TYPE_REQUEST 0
615#define EFI_BUS_CHECK_PARTICIPATION_TYPE_RESPONDED 1
616#define EFI_BUS_CHECK_PARTICIPATION_TYPE_OBSERVED 2
617#define EFI_BUS_CHECK_PARTICIPATION_TYPE_GENERIC 3
618///@}
619
620///
621/// Type of Address Space
622///@{
623#define EFI_BUS_CHECK_ADDRESS_SPACE_TYPE_MEMORY 0
624#define EFI_BUS_CHECK_ADDRESS_SPACE_TYPE_RESERVED 1
625#define EFI_BUS_CHECK_ADDRESS_SPACE_TYPE_IO 2
626#define EFI_BUS_CHECK_ADDRESS_SPACE_TYPE_OTHER 3
627///@}
628
629///
630/// IA32/X64 Bus Check Structure
631///
632typedef struct {
633 UINT64 ValidFields : 16;
634 UINT64 TransactionType : 2;
635 UINT64 Operation : 4;
636 UINT64 Level : 3;
637 UINT64 ContextCorrupt : 1;
638 UINT64 ErrorUncorrected : 1;
639 UINT64 PreciseIp : 1;
640 UINT64 RestartableIp : 1;
641 UINT64 Overflow : 1;
642 UINT64 ParticipationType : 2;
643 UINT64 TimeOut : 1;
644 UINT64 AddressSpace : 2;
645 UINT64 Resv1 : 29;
646} EFI_IA32_X64_BUS_CHECK_INFO;
647
648///
649/// The validation bit mask indicates which fields in the MS Check structure
650/// are valid.
651///@{
652#define EFI_MS_CHECK_ERROR_TYPE_VALID BIT0
653#define EFI_MS_CHECK_CONTEXT_CORRUPT_VALID BIT1
654#define EFI_MS_CHECK_UNCORRECTED_VALID BIT2
655#define EFI_MS_CHECK_PRECISE_IP_VALID BIT3
656#define EFI_MS_CHECK_RESTARTABLE_VALID BIT4
657#define EFI_MS_CHECK_OVERFLOW_VALID BIT5
658///@}
659
660///
661/// Error type identifies the operation that caused the error.
662///@{
663#define EFI_MS_CHECK_ERROR_TYPE_NO 0
664#define EFI_MS_CHECK_ERROR_TYPE_UNCLASSIFIED 1
665#define EFI_MS_CHECK_ERROR_TYPE_MICROCODE_PARITY 2
666#define EFI_MS_CHECK_ERROR_TYPE_EXTERNAL 3
667#define EFI_MS_CHECK_ERROR_TYPE_FRC 4
668#define EFI_MS_CHECK_ERROR_TYPE_INTERNAL_UNCLASSIFIED 5
669///@}
670
671///
672/// IA32/X64 MS Check Field Description
673///
674typedef struct {
675 UINT64 ValidFields : 16;
676 UINT64 ErrorType : 3;
677 UINT64 ContextCorrupt : 1;
678 UINT64 ErrorUncorrected : 1;
679 UINT64 PreciseIp : 1;
680 UINT64 RestartableIp : 1;
681 UINT64 Overflow : 1;
682 UINT64 Resv1 : 40;
683} EFI_IA32_X64_MS_CHECK_INFO;
684
685///
686/// IA32/X64 Check Information Item
687///
688typedef union {
689 EFI_IA32_X64_CACHE_CHECK_INFO CacheCheck;
690 EFI_IA32_X64_TLB_CHECK_INFO TlbCheck;
691 EFI_IA32_X64_BUS_CHECK_INFO BusCheck;
692 EFI_IA32_X64_MS_CHECK_INFO MsCheck;
693 UINT64 Data64;
694} EFI_IA32_X64_CHECK_INFO_ITEM;
695
696///
697/// The validation bit mask indicates which fields in the IA32/X64 Processor Error
698/// Information Structure are valid.
699///@{
700#define EFI_IA32_X64_ERROR_PROC_CHECK_INFO_VALID BIT0
701#define EFI_IA32_X64_ERROR_PROC_TARGET_ADDR_VALID BIT1
702#define EFI_IA32_X64_ERROR_PROC_REQUESTER_ID_VALID BIT2
703#define EFI_IA32_X64_ERROR_PROC_RESPONDER_ID_VALID BIT3
704#define EFI_IA32_X64_ERROR_PROC_INST_IP_VALID BIT4
705///@}
706
707///
708/// IA32/X64 Processor Error Information Structure
709///
710typedef struct {
711 EFI_GUID ErrorType;
712 UINT64 ValidFields;
713 EFI_IA32_X64_CHECK_INFO_ITEM CheckInfo;
714 UINT64 TargetId;
715 UINT64 RequestorId;
716 UINT64 ResponderId;
717 UINT64 InstructionIP;
718} EFI_IA32_X64_PROCESS_ERROR_INFO;
719
720///
721/// IA32/X64 Processor Context Information Structure
722///
723typedef struct {
724 UINT16 RegisterType;
725 UINT16 ArraySize;
726 UINT32 MsrAddress;
727 UINT64 MmRegisterAddress;
728 //
729 // This field will provide the contents of the actual registers or raw data.
730 // The number of Registers or size of the raw data reported is determined
731 // by (Array Size / 8) or otherwise specified by the context structure type
732 // definition.
733 //
734} EFI_IA32_X64_PROCESSOR_CONTEXT_INFO;
735
736///
737/// Register Context Type
738///@{
739#define EFI_REG_CONTEXT_TYPE_UNCLASSIFIED 0x0000
740#define EFI_REG_CONTEXT_TYPE_MSR 0x0001
741#define EFI_REG_CONTEXT_TYPE_IA32 0x0002
742#define EFI_REG_CONTEXT_TYPE_X64 0x0003
743#define EFI_REG_CONTEXT_TYPE_FXSAVE 0x0004
744#define EFI_REG_CONTEXT_TYPE_DR_IA32 0x0005
745#define EFI_REG_CONTEXT_TYPE_DR_X64 0x0006
746#define EFI_REG_CONTEXT_TYPE_MEM_MAP 0x0007
747///@}
748
749///
750/// IA32 Register State
751///
752typedef struct {
753 UINT32 Eax;
754 UINT32 Ebx;
755 UINT32 Ecx;
756 UINT32 Edx;
757 UINT32 Esi;
758 UINT32 Edi;
759 UINT32 Ebp;
760 UINT32 Esp;
761 UINT16 Cs;
762 UINT16 Ds;
763 UINT16 Ss;
764 UINT16 Es;
765 UINT16 Fs;
766 UINT16 Gs;
767 UINT32 Eflags;
768 UINT32 Eip;
769 UINT32 Cr0;
770 UINT32 Cr1;
771 UINT32 Cr2;
772 UINT32 Cr3;
773 UINT32 Cr4;
774 UINT32 Gdtr[2];
775 UINT32 Idtr[2];
776 UINT16 Ldtr;
777 UINT16 Tr;
778} EFI_CONTEXT_IA32_REGISTER_STATE;
779
780///
781/// X64 Register State
782///
783typedef struct {
784 UINT64 Rax;
785 UINT64 Rbx;
786 UINT64 Rcx;
787 UINT64 Rdx;
788 UINT64 Rsi;
789 UINT64 Rdi;
790 UINT64 Rbp;
791 UINT64 Rsp;
792 UINT64 R8;
793 UINT64 R9;
794 UINT64 R10;
795 UINT64 R11;
796 UINT64 R12;
797 UINT64 R13;
798 UINT64 R14;
799 UINT64 R15;
800 UINT16 Cs;
801 UINT16 Ds;
802 UINT16 Ss;
803 UINT16 Es;
804 UINT16 Fs;
805 UINT16 Gs;
806 UINT32 Resv1;
807 UINT64 Rflags;
808 UINT64 Rip;
809 UINT64 Cr0;
810 UINT64 Cr1;
811 UINT64 Cr2;
812 UINT64 Cr3;
813 UINT64 Cr4;
814 UINT64 Cr8;
815 UINT64 Gdtr[2];
816 UINT64 Idtr[2];
817 UINT16 Ldtr;
818 UINT16 Tr;
819} EFI_CONTEXT_X64_REGISTER_STATE;
820
821///
822/// The validation bit mask indicates each of the following field is in IA32/X64
823/// Processor Error Section.
824///
825typedef struct {
826 UINT64 ApicIdValid : 1;
827 UINT64 CpuIdInforValid : 1;
828 UINT64 ErrorInfoNum : 6;
829 UINT64 ContextNum : 6;
830 UINT64 Resv1 : 50;
831} EFI_IA32_X64_VALID_BITS;
832
833///
834/// Error Status Fields
835///
836typedef struct {
837 UINT64 Resv1 : 8;
838 UINT64 Type : 8;
839 UINT64 AddressSignal : 1; ///< Error in Address signals or in Address portion of transaction
840 UINT64 ControlSignal : 1; ///< Error in Control signals or in Control portion of transaction
841 UINT64 DataSignal : 1; ///< Error in Data signals or in Data portion of transaction
842 UINT64 DetectedByResponder : 1; ///< Error detected by responder
843 UINT64 DetectedByRequester : 1; ///< Error detected by requestor
844 UINT64 FirstError : 1; ///< First Error in the sequence - option field
845 UINT64 OverflowNotLogged : 1; ///< Additional errors were not logged due to lack of resources
846 UINT64 Resv2 : 41;
847} EFI_GENERIC_ERROR_STATUS;
848
849///
850/// CPER Generic Error Codes
851///
852#define CPER_GENERIC_ERROR_TYPES_KEYS \
853 (int[]) \
854 { \
855 1, 16, 4, 5, 6, 7, 8, 9, 17, 18, 19, 20, 21, 22, 23, 24, 25, \
856 26 \
857 }
858#define CPER_GENERIC_ERROR_TYPES_VALUES \
859 (const char *[]) \
860 { \
861 "ERR_INTERNAL", "ERR_BUS", "ERR_MEM", "ERR_TLB", "ERR_CACHE", \
862 "ERR_FUNCTION", "ERR_SELFTEST", "ERR_FLOW", "ERR_MAP", \
863 "ERR_IMPROPER", "ERR_UNIMPL", "ERR_LOL", \
864 "ERR_RESPONSE", "ERR_PARITY", "ERR_PROTOCOL", \
865 "ERR_ERROR", "ERR_TIMEOUT", "ERR_POISONED" \
866 }
867#define CPER_GENERIC_ERROR_TYPES_DESCRIPTIONS \
868 (const char *[]) \
869 { \
870 "Error detected internal to the component.", \
871 "Error detected in the bus.", \
872 "Storage error in memory (DRAM).", \
873 "Storage error in TLB.", "Storage error in cache.", \
874 "Error in one or more functional units.", \
875 "Component failed self test.", \
876 "Overflow or underflow of internal queue.", \
877 "Virtual address not found on IO-TLB or IO-PDIR.", \
878 "Improper access error.", \
879 "Access to a memory address which is not mapped to any component.", \
880 "Loss of Lockstep error.", \
881 "Response not associated with a request.", \
882 "Bus parity error (must also set the A, C, or D bits).", \
883 "Detection of a protocol error.", \
884 "Detection of a PATH_ERROR.", \
885 "Bus operation timeout.", \
886 "A read was issued to data that has been poisoned." \
887 }
888
889///
890/// Error Type
891///
892typedef enum {
893 ///
894 /// General Internal errors
895 ///
896 ErrorInternal = 1,
897 ErrorBus = 16,
898 ///
899 /// Component Internal errors
900 ///
901 ErrorMemStorage = 4, // Error in memory device
902 ErrorTlbStorage = 5, // TLB error in cache
903 ErrorCacheStorage = 6,
904 ErrorFunctionalUnit = 7,
905 ErrorSelftest = 8,
906 ErrorOverflow = 9,
907 ///
908 /// Bus internal errors
909 ///
910 ErrorVirtualMap = 17,
911 ErrorAccessInvalid = 18, // Improper access
912 ErrorUnimplAccess = 19, // Unimplemented memory access
913 ErrorLossOfLockstep = 20,
914 ErrorResponseInvalid = 21, // Response not associated with request
915 ErrorParity = 22,
916 ErrorProtocol = 23,
917 ErrorPath = 24, // Detected path error
918 ErrorTimeout = 25, // Bus timeout
919 ErrorPoisoned = 26 // Read data poisoned
920} EFI_GENERIC_ERROR_STATUS_ERROR_TYPE;
921
922///
923/// Validation bit mask indicates which fields in the memory error record are valid
924/// in Memory Error section
925///@{
926#define EFI_PLATFORM_MEMORY_ERROR_STATUS_VALID BIT0
927#define EFI_PLATFORM_MEMORY_PHY_ADDRESS_VALID BIT1
928#define EFI_PLATFORM_MEMORY_PHY_ADDRESS_MASK_VALID BIT2
929#define EFI_PLATFORM_MEMORY_NODE_VALID BIT3
930#define EFI_PLATFORM_MEMORY_CARD_VALID BIT4
931#define EFI_PLATFORM_MEMORY_MODULE_VALID BIT5
932#define EFI_PLATFORM_MEMORY_BANK_VALID BIT6
933#define EFI_PLATFORM_MEMORY_DEVICE_VALID BIT7
934#define EFI_PLATFORM_MEMORY_ROW_VALID BIT8
935#define EFI_PLATFORM_MEMORY_COLUMN_VALID BIT9
936#define EFI_PLATFORM_MEMORY_BIT_POS_VALID BIT10
937#define EFI_PLATFORM_MEMORY_REQUESTOR_ID_VALID BIT11
938#define EFI_PLATFORM_MEMORY_RESPONDER_ID_VALID BIT12
939#define EFI_PLATFORM_MEMORY_TARGET_ID_VALID BIT13
940#define EFI_PLATFORM_MEMORY_ERROR_TYPE_VALID BIT14
941#define EFI_PLATFORM_MEMORY_ERROR_RANK_NUM_VALID BIT15
942#define EFI_PLATFORM_MEMORY_ERROR_CARD_HANDLE_VALID BIT16
943#define EFI_PLATFORM_MEMORY_ERROR_MODULE_HANDLE_VALID BIT17
944#define EFI_PLATFORM_MEMORY_ERROR_EXTENDED_ROW_BIT_16_17_VALID BIT18
945#define EFI_PLATFORM_MEMORY_ERROR_BANK_GROUP_VALID BIT19
946#define EFI_PLATFORM_MEMORY_ERROR_BANK_ADDRESS_VALID BIT20
947#define EFI_PLATFORM_MEMORY_ERROR_CHIP_IDENTIFICATION_VALID BIT21
948///@}
949
950///
951/// Memory Error Type identifies the type of error that occurred in Memory
952/// Error section
953///@{
954#define EFI_PLATFORM_MEMORY_ERROR_UNKNOWN 0x00
955#define EFI_PLATFORM_MEMORY_ERROR_NONE 0x01
956#define EFI_PLATFORM_MEMORY_ERROR_SINGLEBIT_ECC 0x02
957#define EFI_PLATFORM_MEMORY_ERROR_MLTIBIT_ECC 0x03
958#define EFI_PLATFORM_MEMORY_ERROR_SINGLESYMBOLS_CHIPKILL 0x04
959#define EFI_PLATFORM_MEMORY_ERROR_MULTISYMBOL_CHIPKILL 0x05
960#define EFI_PLATFORM_MEMORY_ERROR_MATER_ABORT 0x06
961#define EFI_PLATFORM_MEMORY_ERROR_TARGET_ABORT 0x07
962#define EFI_PLATFORM_MEMORY_ERROR_PARITY 0x08
963#define EFI_PLATFORM_MEMORY_ERROR_WDT 0x09
964#define EFI_PLATFORM_MEMORY_ERROR_INVALID_ADDRESS 0x0A
965#define EFI_PLATFORM_MEMORY_ERROR_MIRROR_FAILED 0x0B
966#define EFI_PLATFORM_MEMORY_ERROR_SPARING 0x0C
967#define EFI_PLATFORM_MEMORY_ERROR_SCRUB_CORRECTED 0x0D
968#define EFI_PLATFORM_MEMORY_ERROR_SCRUB_UNCORRECTED 0x0E
969#define EFI_PLATFORM_MEMORY_ERROR_MEMORY_MAP_EVENT 0x0F
970///@}
971
972///
973/// Memory Error Section
974///
975typedef struct {
976 UINT64 ValidFields;
977 EFI_GENERIC_ERROR_STATUS ErrorStatus;
978 UINT64 PhysicalAddress; // Error physical address
979 UINT64 PhysicalAddressMask; // Grnaularity
980 UINT16 Node; // Node #
981 UINT16 Card;
982 UINT16 ModuleRank; // Module or Rank#
983 UINT16 Bank;
984 UINT16 Device;
985 UINT16 Row;
986 UINT16 Column;
987 UINT16 BitPosition;
988 UINT64 RequestorId;
989 UINT64 ResponderId;
990 UINT64 TargetId;
991 UINT8 ErrorType;
992 UINT8 Extended;
993 UINT16 RankNum;
994 UINT16 CardHandle;
995 UINT16 ModuleHandle;
996} EFI_PLATFORM_MEMORY_ERROR_DATA;
997
998///
999/// Validation bit mask indicates which fields in the memory error record 2 are valid
1000/// in Memory Error section 2
1001///@{
1002#define EFI_PLATFORM_MEMORY2_ERROR_STATUS_VALID BIT0
1003#define EFI_PLATFORM_MEMORY2_PHY_ADDRESS_VALID BIT1
1004#define EFI_PLATFORM_MEMORY2_PHY_ADDRESS_MASK_VALID BIT2
1005#define EFI_PLATFORM_MEMORY2_NODE_VALID BIT3
1006#define EFI_PLATFORM_MEMORY2_CARD_VALID BIT4
1007#define EFI_PLATFORM_MEMORY2_MODULE_VALID BIT5
1008#define EFI_PLATFORM_MEMORY2_BANK_VALID BIT6
1009#define EFI_PLATFORM_MEMORY2_DEVICE_VALID BIT7
1010#define EFI_PLATFORM_MEMORY2_ROW_VALID BIT8
1011#define EFI_PLATFORM_MEMORY2_COLUMN_VALID BIT9
1012#define EFI_PLATFORM_MEMORY2_RANK_VALID BIT10
1013#define EFI_PLATFORM_MEMORY2_BIT_POS_VALID BIT11
1014#define EFI_PLATFORM_MEMORY2_CHIP_ID_VALID BIT12
1015#define EFI_PLATFORM_MEMORY2_MEMORY_ERROR_TYPE_VALID BIT13
1016#define EFI_PLATFORM_MEMORY2_STATUS_VALID BIT14
1017#define EFI_PLATFORM_MEMORY2_REQUESTOR_ID_VALID BIT15
1018#define EFI_PLATFORM_MEMORY2_RESPONDER_ID_VALID BIT16
1019#define EFI_PLATFORM_MEMORY2_TARGET_ID_VALID BIT17
1020#define EFI_PLATFORM_MEMORY2_CARD_HANDLE_VALID BIT18
1021#define EFI_PLATFORM_MEMORY2_MODULE_HANDLE_VALID BIT19
1022#define EFI_PLATFORM_MEMORY2_BANK_GROUP_VALID BIT20
1023#define EFI_PLATFORM_MEMORY2_BANK_ADDRESS_VALID BIT21
1024///@}
1025
1026///
1027/// Memory Error Type identifies the type of error that occurred in Memory
1028/// Error section 2
1029///@{
1030#define EFI_PLATFORM_MEMORY2_ERROR_UNKNOWN 0x00
1031#define EFI_PLATFORM_MEMORY2_ERROR_NONE 0x01
1032#define EFI_PLATFORM_MEMORY2_ERROR_SINGLEBIT_ECC 0x02
1033#define EFI_PLATFORM_MEMORY2_ERROR_MLTIBIT_ECC 0x03
1034#define EFI_PLATFORM_MEMORY2_ERROR_SINGLESYMBOL_CHIPKILL 0x04
1035#define EFI_PLATFORM_MEMORY2_ERROR_MULTISYMBOL_CHIPKILL 0x05
1036#define EFI_PLATFORM_MEMORY2_ERROR_MASTER_ABORT 0x06
1037#define EFI_PLATFORM_MEMORY2_ERROR_TARGET_ABORT 0x07
1038#define EFI_PLATFORM_MEMORY2_ERROR_PARITY 0x08
1039#define EFI_PLATFORM_MEMORY2_ERROR_WDT 0x09
1040#define EFI_PLATFORM_MEMORY2_ERROR_INVALID_ADDRESS 0x0A
1041#define EFI_PLATFORM_MEMORY2_ERROR_MIRROR_BROKEN 0x0B
1042#define EFI_PLATFORM_MEMORY2_ERROR_MEMORY_SPARING 0x0C
1043#define EFI_PLATFORM_MEMORY2_ERROR_SCRUB_CORRECTED 0x0D
1044#define EFI_PLATFORM_MEMORY2_ERROR_SCRUB_UNCORRECTED 0x0E
1045#define EFI_PLATFORM_MEMORY2_ERROR_MEMORY_MAP_EVENT 0x0F
1046///@}
1047
1048///
1049/// Memory Error Section 2
1050///
1051typedef struct {
1052 UINT64 ValidFields;
1053 EFI_GENERIC_ERROR_STATUS ErrorStatus;
1054 UINT64 PhysicalAddress; // Error physical address
1055 UINT64 PhysicalAddressMask; // Grnaularity
1056 UINT16 Node; // Node #
1057 UINT16 Card;
1058 UINT16 Module; // Module or Rank#
1059 UINT16 Bank;
1060 UINT32 Device;
1061 UINT32 Row;
1062 UINT32 Column;
1063 UINT32 Rank;
1064 UINT32 BitPosition;
1065 UINT8 ChipId;
1066 UINT8 MemErrorType;
1067 UINT8 Status;
1068 UINT8 Reserved;
1069 UINT64 RequestorId;
1070 UINT64 ResponderId;
1071 UINT64 TargetId;
1072 UINT32 CardHandle;
1073 UINT32 ModuleHandle;
1074} EFI_PLATFORM_MEMORY2_ERROR_DATA;
1075
1076///
1077/// Validation bits mask indicates which of the following fields is valid
1078/// in PCI Express Error Record.
1079///@{
1080#define EFI_PCIE_ERROR_PORT_TYPE_VALID BIT0
1081#define EFI_PCIE_ERROR_VERSION_VALID BIT1
1082#define EFI_PCIE_ERROR_COMMAND_STATUS_VALID BIT2
1083#define EFI_PCIE_ERROR_DEVICE_ID_VALID BIT3
1084#define EFI_PCIE_ERROR_SERIAL_NO_VALID BIT4
1085#define EFI_PCIE_ERROR_BRIDGE_CRL_STS_VALID BIT5
1086#define EFI_PCIE_ERROR_CAPABILITY_INFO_VALID BIT6
1087#define EFI_PCIE_ERROR_AER_INFO_VALID BIT7
1088///@}
1089
1090///
1091/// PCIe Device/Port Type as defined in the PCI Express capabilities register
1092///@{
1093#define EFI_PCIE_ERROR_PORT_PCIE_ENDPOINT 0x00000000
1094#define EFI_PCIE_ERROR_PORT_PCI_ENDPOINT 0x00000001
1095#define EFI_PCIE_ERROR_PORT_ROOT_PORT 0x00000004
1096#define EFI_PCIE_ERROR_PORT_UPSWITCH_PORT 0x00000005
1097#define EFI_PCIE_ERROR_PORT_DOWNSWITCH_PORT 0x00000006
1098#define EFI_PCIE_ERROR_PORT_PCIE_TO_PCI_BRIDGE 0x00000007
1099#define EFI_PCIE_ERROR_PORT_PCI_TO_PCIE_BRIDGE 0x00000008
1100#define EFI_PCIE_ERROR_PORT_ROOT_INT_ENDPOINT 0x00000009
1101#define EFI_PCIE_ERROR_PORT_ROOT_EVENT_COLLECTOR 0x0000000A
1102///@}
1103
1104///
1105/// PCI Slot number
1106///
1107typedef struct {
1108 UINT16 Resv1 : 3;
1109 UINT16 Number : 13;
1110} EFI_GENERIC_ERROR_PCI_SLOT;
1111
1112///
1113/// PCIe Root Port PCI/bridge PCI compatible device number and
1114/// bus number information to uniquely identify the root port or
1115/// bridge. Default values for both the bus numbers is zero.
1116///
1117typedef struct {
1118 UINT16 VendorId;
1119 UINT16 DeviceId;
1120 UINT8 ClassCode[3];
1121 UINT8 Function;
1122 UINT8 Device;
1123 UINT16 Segment;
1124 UINT8 PrimaryOrDeviceBus;
1125 UINT8 SecondaryBus;
1126 EFI_GENERIC_ERROR_PCI_SLOT Slot;
1127 UINT8 Resv1;
1128} EFI_GENERIC_ERROR_PCIE_DEV_BRIDGE_ID;
1129
1130///
1131/// PCIe Capability Structure
1132///
1133typedef struct {
1134 UINT8 PcieCap[60];
1135} EFI_PCIE_ERROR_DATA_CAPABILITY;
1136
1137///
1138/// PCIe Advanced Error Reporting Extended Capability Structure.
1139///
1140typedef struct {
1141 UINT8 PcieAer[96];
1142} EFI_PCIE_ERROR_DATA_AER;
1143
1144///
1145/// PCI Express Error Record
1146///
1147typedef struct {
1148 UINT64 ValidFields;
1149 UINT32 PortType;
1150 UINT32 Version;
1151 UINT32 CommandStatus;
1152 UINT32 Resv2;
1153 EFI_GENERIC_ERROR_PCIE_DEV_BRIDGE_ID DevBridge;
1154 UINT64 SerialNo;
1155 UINT32 BridgeControlStatus;
1156 EFI_PCIE_ERROR_DATA_CAPABILITY Capability;
1157 EFI_PCIE_ERROR_DATA_AER AerInfo;
1158} EFI_PCIE_ERROR_DATA;
1159
1160///
1161/// Validation bits Indicates which of the following fields is valid
1162/// in PCI/PCI-X Bus Error Section.
1163///@{
1164#define EFI_PCI_PCIX_BUS_ERROR_STATUS_VALID BIT0
1165#define EFI_PCI_PCIX_BUS_ERROR_TYPE_VALID BIT1
1166#define EFI_PCI_PCIX_BUS_ERROR_BUS_ID_VALID BIT2
1167#define EFI_PCI_PCIX_BUS_ERROR_BUS_ADDRESS_VALID BIT3
1168#define EFI_PCI_PCIX_BUS_ERROR_BUS_DATA_VALID BIT4
1169#define EFI_PCI_PCIX_BUS_ERROR_COMMAND_VALID BIT5
1170#define EFI_PCI_PCIX_BUS_ERROR_REQUESTOR_ID_VALID BIT6
1171#define EFI_PCI_PCIX_BUS_ERROR_COMPLETER_ID_VALID BIT7
1172#define EFI_PCI_PCIX_BUS_ERROR_TARGET_ID_VALID BIT8
1173///@}
1174
1175///
1176/// PCI Bus Error Type in PCI/PCI-X Bus Error Section
1177///@{
1178#define EFI_PCI_PCIX_BUS_ERROR_UNKNOWN 0x0000
1179#define EFI_PCI_PCIX_BUS_ERROR_DATA_PARITY 0x0001
1180#define EFI_PCI_PCIX_BUS_ERROR_SYSTEM 0x0002
1181#define EFI_PCI_PCIX_BUS_ERROR_MASTER_ABORT 0x0003
1182#define EFI_PCI_PCIX_BUS_ERROR_BUS_TIMEOUT 0x0004
1183#define EFI_PCI_PCIX_BUS_ERROR_MASTER_DATA_PARITY 0x0005
1184#define EFI_PCI_PCIX_BUS_ERROR_ADDRESS_PARITY 0x0006
1185#define EFI_PCI_PCIX_BUS_ERROR_COMMAND_PARITY 0x0007
1186///@}
1187
1188///
1189/// PCI/PCI-X Bus Error Section
1190///
1191typedef struct {
1192 UINT64 ValidFields;
1193 EFI_GENERIC_ERROR_STATUS ErrorStatus;
1194 UINT16 Type;
1195 UINT16 BusId;
1196 UINT32 Resv2;
1197 UINT64 BusAddress;
1198 UINT64 BusData;
1199 UINT64 BusCommand;
1200 UINT64 RequestorId;
1201 UINT64 ResponderId;
1202 UINT64 TargetId;
1203} EFI_PCI_PCIX_BUS_ERROR_DATA;
1204
1205///
1206/// Validation bits Indicates which of the following fields is valid
1207/// in PCI/PCI-X Component Error Section.
1208///@{
1209#define EFI_PCI_PCIX_DEVICE_ERROR_STATUS_VALID BIT0
1210#define EFI_PCI_PCIX_DEVICE_ERROR_ID_INFO_VALID BIT1
1211#define EFI_PCI_PCIX_DEVICE_ERROR_MEM_NUM_VALID BIT2
1212#define EFI_PCI_PCIX_DEVICE_ERROR_IO_NUM_VALID BIT3
1213#define EFI_PCI_PCIX_DEVICE_ERROR_REG_DATA_PAIR_VALID BIT4
1214///@}
1215
1216///
1217/// PCI/PCI-X Device Identification Information
1218///
1219typedef struct {
1220 UINT16 VendorId;
1221 UINT16 DeviceId;
1222 UINT8 ClassCode[3];
1223 UINT8 Function;
1224 UINT8 Device;
1225 UINT8 Bus;
1226 UINT8 Segment;
1227 UINT8 Resv1;
1228 UINT32 Resv2;
1229} EFI_GENERIC_ERROR_PCI_DEVICE_ID;
1230
1231///
1232/// Identifies the type of firmware error record
1233///@{
1234#define EFI_FIRMWARE_ERROR_TYPE_IPF_SAL 0x00
1235#define EFI_FIRMWARE_ERROR_TYPE_SOC_TYPE1 0x01
1236#define EFI_FIRMWARE_ERROR_TYPE_SOC_TYPE2 0x02
1237///@}
1238
1239///
1240/// Firmware Error Record Section
1241///
1242typedef struct {
1243 UINT8 ErrorType;
1244 UINT8 Revision;
1245 UINT8 Resv1[6];
1246 UINT64 RecordId;
1247 EFI_GUID RecordIdGuid;
1248} EFI_FIRMWARE_ERROR_DATA;
1249
1250///
1251/// Fault Reason in DMAr Generic Error Section
1252///@{
1253#define EFI_DMA_FAULT_REASON_TABLE_ENTRY_NOT_PRESENT 0x01
1254#define EFI_DMA_FAULT_REASON_TABLE_ENTRY_INVALID 0x02
1255#define EFI_DMA_FAULT_REASON_ACCESS_MAPPING_TABLE_ERROR 0x03
1256#define EFI_DMA_FAULT_REASON_RESV_BIT_ERROR_IN_MAPPING_TABLE 0x04
1257#define EFI_DMA_FAULT_REASON_ACCESS_ADDR_OUT_OF_SPACE 0x05
1258#define EFI_DMA_FAULT_REASON_INVALID_ACCESS 0x06
1259#define EFI_DMA_FAULT_REASON_INVALID_REQUEST 0x07
1260#define EFI_DMA_FAULT_REASON_ACCESS_TRANSLATE_TABLE_ERROR 0x08
1261#define EFI_DMA_FAULT_REASON_RESV_BIT_ERROR_IN_TRANSLATE_TABLE 0x09
1262#define EFI_DMA_FAULT_REASON_INVALID_COMMAOND 0x0A
1263#define EFI_DMA_FAULT_REASON_ACCESS_COMMAND_BUFFER_ERROR 0x0B
1264///@}
1265
1266///
1267/// DMA access type in DMAr Generic Error Section
1268///@{
1269#define EFI_DMA_ACCESS_TYPE_READ 0x00
1270#define EFI_DMA_ACCESS_TYPE_WRITE 0x01
1271///@}
1272
1273///
1274/// DMA address type in DMAr Generic Error Section
1275///@{
1276#define EFI_DMA_ADDRESS_UNTRANSLATED 0x00
1277#define EFI_DMA_ADDRESS_TRANSLATION 0x01
1278///@}
1279
1280///
1281/// Architecture type in DMAr Generic Error Section
1282///@{
1283#define EFI_DMA_ARCH_TYPE_VT 0x01
1284#define EFI_DMA_ARCH_TYPE_IOMMU 0x02
1285///@}
1286
1287///
1288/// DMAr Generic Error Section
1289///
1290typedef struct {
1291 UINT16 RequesterId;
1292 UINT16 SegmentNumber;
1293 UINT8 FaultReason;
1294 UINT8 AccessType;
1295 UINT8 AddressType;
1296 UINT8 ArchType;
1297 UINT64 DeviceAddr;
1298 UINT8 Resv1[16];
1299} EFI_DMAR_GENERIC_ERROR_DATA;
1300
1301///
1302/// Intel VT for Directed I/O specific DMAr Errors
1303///
1304typedef struct {
1305 UINT8 Version;
1306 UINT8 Revision;
1307 UINT8 OemId[6];
1308 UINT64 Capability;
1309 UINT64 CapabilityEx;
1310 UINT32 GlobalCommand;
1311 UINT32 GlobalStatus;
1312 UINT32 FaultStatus;
1313 UINT8 Resv1[12];
1314 UINT64 FaultRecord[2];
1315 UINT64 RootEntry[2];
1316 UINT64 ContextEntry[2];
1317 UINT64 PteL6;
1318 UINT64 PteL5;
1319 UINT64 PteL4;
1320 UINT64 PteL3;
1321 UINT64 PteL2;
1322 UINT64 PteL1;
1323} EFI_DIRECTED_IO_DMAR_ERROR_DATA;
1324
1325///
1326/// IOMMU specific DMAr Errors
1327///
1328typedef struct {
1329 UINT8 Revision;
1330 UINT8 Resv1[7];
1331 UINT64 Control;
1332 UINT64 Status;
1333 UINT8 Resv2[8];
1334 UINT64 EventLogEntry[2];
1335 UINT8 Resv3[16];
1336 UINT64 DeviceTableEntry[4];
1337 UINT64 PteL6;
1338 UINT64 PteL5;
1339 UINT64 PteL4;
1340 UINT64 PteL3;
1341 UINT64 PteL2;
1342 UINT64 PteL1;
1343} EFI_IOMMU_DMAR_ERROR_DATA;
1344
1345extern EFI_GUID gEfiEventNotificationTypeCmcGuid;
1346extern EFI_GUID gEfiEventNotificationTypeCpeGuid;
1347extern EFI_GUID gEfiEventNotificationTypeMceGuid;
1348extern EFI_GUID gEfiEventNotificationTypePcieGuid;
1349extern EFI_GUID gEfiEventNotificationTypeInitGuid;
1350extern EFI_GUID gEfiEventNotificationTypeNmiGuid;
1351extern EFI_GUID gEfiEventNotificationTypeBootGuid;
1352extern EFI_GUID gEfiEventNotificationTypeDmarGuid;
1353extern EFI_GUID gEfiEventNotificationTypeSeaGuid;
1354extern EFI_GUID gEfiEventNotificationTypeSeiGuid;
1355extern EFI_GUID gEfiEventNotificationTypePeiGuid;
1356extern EFI_GUID gEfiEventNotificationTypeCxlGuid;
1357extern EFI_GUID gEfiProcessorGenericErrorSectionGuid;
1358extern EFI_GUID gEfiProcessorSpecificErrorSectionGuid;
1359extern EFI_GUID gEfiIa32X64ProcessorErrorSectionGuid;
1360extern EFI_GUID gEfiIpfProcessorErrorSectionGuid;
1361extern EFI_GUID gEfiArmProcessorErrorSectionGuid;
1362extern EFI_GUID gEfiPlatformMemoryErrorSectionGuid;
1363extern EFI_GUID gEfiPlatformMemoryError2SectionGuid;
1364extern EFI_GUID gEfiPcieErrorSectionGuid;
1365extern EFI_GUID gEfiFirmwareErrorSectionGuid;
1366extern EFI_GUID gEfiPciBusErrorSectionGuid;
1367extern EFI_GUID gEfiPciDevErrorSectionGuid;
1368extern EFI_GUID gEfiDMArGenericErrorSectionGuid;
1369extern EFI_GUID gEfiDirectedIoDMArErrorSectionGuid;
1370extern EFI_GUID gEfiIommuDMArErrorSectionGuid;
1371extern EFI_GUID gEfiCcixPerLogErrorSectionGuid;
1372extern EFI_GUID gEfiCxlProtocolErrorSectionGuid;
1373extern EFI_GUID gEfiCxlGeneralMediaErrorSectionGuid;
1374extern EFI_GUID gEfiCxlDramEventErrorSectionGuid;
1375extern EFI_GUID gEfiCxlMemoryModuleErrorSectionGuid;
1376extern EFI_GUID gEfiCxlPhysicalSwitchErrorSectionGuid;
1377extern EFI_GUID gEfiCxlVirtualSwitchErrorSectionGuid;
1378extern EFI_GUID gEfiCxlMldPortErrorSectionGuid;
John Chungf8fc7052024-05-03 20:05:29 +08001379
1380#if defined(MDE_CPU_IA32) || defined(MDE_CPU_X64)
1381///
1382/// IA32 and x64 Specific definitions.
1383///
1384
1385extern EFI_GUID gEfiIa32X64ErrorTypeCacheCheckGuid;
1386extern EFI_GUID gEfiIa32X64ErrorTypeTlbCheckGuid;
1387extern EFI_GUID gEfiIa32X64ErrorTypeBusCheckGuid;
1388extern EFI_GUID gEfiIa32X64ErrorTypeMsCheckGuid;
1389
1390#endif
1391
Karthik Rajagopalan683e0552024-03-07 12:30:43 -08001392///
1393/// NVIDIA Error Record Section
1394///
1395typedef struct {
Ed Tanous2d17ace2024-08-27 14:45:38 -07001396 UINT64 Address;
1397 UINT64 Value;
1398} EFI_NVIDIA_REGISTER_DATA;
1399
1400typedef struct {
Karthik Rajagopalan683e0552024-03-07 12:30:43 -08001401 CHAR8 Signature[16];
1402 UINT16 ErrorType;
1403 UINT16 ErrorInstance;
1404 UINT8 Severity;
1405 UINT8 Socket;
1406 UINT8 NumberRegs;
1407 UINT8 Reserved;
1408 UINT64 InstanceBase;
Ed Tanous2d17ace2024-08-27 14:45:38 -07001409 // Keep this at the end of this struct
1410 // and allocate based on NumberRegs
1411#ifndef __cplusplus
1412 EFI_NVIDIA_REGISTER_DATA Register[] LIBCPER_CC_COUNTED_BY(NumberRegs);
1413#endif
Karthik Rajagopalan683e0552024-03-07 12:30:43 -08001414} EFI_NVIDIA_ERROR_DATA;
1415
1416extern EFI_GUID gEfiNvidiaErrorSectionGuid;
Ed Tanousc6fead12024-06-18 13:15:58 -07001417#pragma pack(pop)
1418
Karthik Rajagopalan255bd812024-09-06 14:36:34 -07001419#ifdef __cplusplus
1420}
1421#endif
1422
John Chungf8fc7052024-05-03 20:05:29 +08001423#endif