diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2017-09-01 19:14:04 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2019-04-13 12:17:36 -0400 |
commit | 12fa4f47924c9e0638869c2315dda29d50a94446 (patch) | |
tree | 67a3b6c974806a5b6ff444b0fa12c8c6c0aca0e5 | |
parent | 74356addc0b32e891327bcb1e36d7f798f7b1c7d (diff) |
CPER: Add UEFI spec references
Add UEFI spec references for CPER UUIDs and structures, fix a few typos,
and remove some useless comments. No functional change intended.
Link: http://www.uefi.org/specifications
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | include/linux/cper.h | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/include/linux/cper.h b/include/linux/cper.h index 9c703a0abe6e..2f361a96dc76 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
@@ -44,7 +44,7 @@ | |||
44 | */ | 44 | */ |
45 | #define CPER_REC_LEN 256 | 45 | #define CPER_REC_LEN 256 |
46 | /* | 46 | /* |
47 | * Severity difinition for error_severity in struct cper_record_header | 47 | * Severity definition for error_severity in struct cper_record_header |
48 | * and section_severity in struct cper_section_descriptor | 48 | * and section_severity in struct cper_section_descriptor |
49 | */ | 49 | */ |
50 | enum { | 50 | enum { |
@@ -55,24 +55,21 @@ enum { | |||
55 | }; | 55 | }; |
56 | 56 | ||
57 | /* | 57 | /* |
58 | * Validation bits difinition for validation_bits in struct | 58 | * Validation bits definition for validation_bits in struct |
59 | * cper_record_header. If set, corresponding fields in struct | 59 | * cper_record_header. If set, corresponding fields in struct |
60 | * cper_record_header contain valid information. | 60 | * cper_record_header contain valid information. |
61 | * | ||
62 | * corresponds platform_id | ||
63 | */ | 61 | */ |
64 | #define CPER_VALID_PLATFORM_ID 0x0001 | 62 | #define CPER_VALID_PLATFORM_ID 0x0001 |
65 | /* corresponds timestamp */ | ||
66 | #define CPER_VALID_TIMESTAMP 0x0002 | 63 | #define CPER_VALID_TIMESTAMP 0x0002 |
67 | /* corresponds partition_id */ | ||
68 | #define CPER_VALID_PARTITION_ID 0x0004 | 64 | #define CPER_VALID_PARTITION_ID 0x0004 |
69 | 65 | ||
70 | /* | 66 | /* |
71 | * Notification type used to generate error record, used in | 67 | * Notification type used to generate error record, used in |
72 | * notification_type in struct cper_record_header | 68 | * notification_type in struct cper_record_header. These UUIDs are defined |
73 | * | 69 | * in the UEFI spec v2.7, sec N.2.1. |
74 | * Corrected Machine Check | ||
75 | */ | 70 | */ |
71 | |||
72 | /* Corrected Machine Check */ | ||
76 | #define CPER_NOTIFY_CMC \ | 73 | #define CPER_NOTIFY_CMC \ |
77 | GUID_INIT(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \ | 74 | GUID_INIT(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \ |
78 | 0xEB, 0xD4, 0xF8, 0x90) | 75 | 0xEB, 0xD4, 0xF8, 0x90) |
@@ -122,14 +119,11 @@ enum { | |||
122 | #define CPER_SEC_REV 0x0100 | 119 | #define CPER_SEC_REV 0x0100 |
123 | 120 | ||
124 | /* | 121 | /* |
125 | * Validation bits difinition for validation_bits in struct | 122 | * Validation bits definition for validation_bits in struct |
126 | * cper_section_descriptor. If set, corresponding fields in struct | 123 | * cper_section_descriptor. If set, corresponding fields in struct |
127 | * cper_section_descriptor contain valid information. | 124 | * cper_section_descriptor contain valid information. |
128 | * | ||
129 | * corresponds fru_id | ||
130 | */ | 125 | */ |
131 | #define CPER_SEC_VALID_FRU_ID 0x1 | 126 | #define CPER_SEC_VALID_FRU_ID 0x1 |
132 | /* corresponds fru_text */ | ||
133 | #define CPER_SEC_VALID_FRU_TEXT 0x2 | 127 | #define CPER_SEC_VALID_FRU_TEXT 0x2 |
134 | 128 | ||
135 | /* | 129 | /* |
@@ -165,10 +159,11 @@ enum { | |||
165 | 159 | ||
166 | /* | 160 | /* |
167 | * Section type definitions, used in section_type field in struct | 161 | * Section type definitions, used in section_type field in struct |
168 | * cper_section_descriptor | 162 | * cper_section_descriptor. These UUIDs are defined in the UEFI spec |
169 | * | 163 | * v2.7, sec N.2.2. |
170 | * Processor Generic | ||
171 | */ | 164 | */ |
165 | |||
166 | /* Processor Generic */ | ||
172 | #define CPER_SEC_PROC_GENERIC \ | 167 | #define CPER_SEC_PROC_GENERIC \ |
173 | GUID_INIT(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ | 168 | GUID_INIT(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ |
174 | 0x93, 0xC4, 0xF3, 0xDB) | 169 | 0x93, 0xC4, 0xF3, 0xDB) |
@@ -325,6 +320,7 @@ enum { | |||
325 | */ | 320 | */ |
326 | #pragma pack(1) | 321 | #pragma pack(1) |
327 | 322 | ||
323 | /* Record Header, UEFI v2.7 sec N.2.1 */ | ||
328 | struct cper_record_header { | 324 | struct cper_record_header { |
329 | char signature[CPER_SIG_SIZE]; /* must be CPER_SIG_RECORD */ | 325 | char signature[CPER_SIG_SIZE]; /* must be CPER_SIG_RECORD */ |
330 | __u16 revision; /* must be CPER_RECORD_REV */ | 326 | __u16 revision; /* must be CPER_RECORD_REV */ |
@@ -344,6 +340,7 @@ struct cper_record_header { | |||
344 | __u8 reserved[12]; /* must be zero */ | 340 | __u8 reserved[12]; /* must be zero */ |
345 | }; | 341 | }; |
346 | 342 | ||
343 | /* Section Descriptor, UEFI v2.7 sec N.2.2 */ | ||
347 | struct cper_section_descriptor { | 344 | struct cper_section_descriptor { |
348 | __u32 section_offset; /* Offset in bytes of the | 345 | __u32 section_offset; /* Offset in bytes of the |
349 | * section body from the base | 346 | * section body from the base |
@@ -359,7 +356,7 @@ struct cper_section_descriptor { | |||
359 | __u8 fru_text[20]; | 356 | __u8 fru_text[20]; |
360 | }; | 357 | }; |
361 | 358 | ||
362 | /* Generic Processor Error Section */ | 359 | /* Generic Processor Error Section, UEFI v2.7 sec N.2.4.1 */ |
363 | struct cper_sec_proc_generic { | 360 | struct cper_sec_proc_generic { |
364 | __u64 validation_bits; | 361 | __u64 validation_bits; |
365 | __u8 proc_type; | 362 | __u8 proc_type; |
@@ -378,14 +375,14 @@ struct cper_sec_proc_generic { | |||
378 | __u64 ip; | 375 | __u64 ip; |
379 | }; | 376 | }; |
380 | 377 | ||
381 | /* IA32/X64 Processor Error Section */ | 378 | /* IA32/X64 Processor Error Section, UEFI v2.7 sec N.2.4.2 */ |
382 | struct cper_sec_proc_ia { | 379 | struct cper_sec_proc_ia { |
383 | __u64 validation_bits; | 380 | __u64 validation_bits; |
384 | __u64 lapic_id; | 381 | __u64 lapic_id; |
385 | __u8 cpuid[48]; | 382 | __u8 cpuid[48]; |
386 | }; | 383 | }; |
387 | 384 | ||
388 | /* IA32/X64 Processor Error Information Structure */ | 385 | /* IA32/X64 Processor Error Information Structure, UEFI v2.7 sec N.2.4.2.1 */ |
389 | struct cper_ia_err_info { | 386 | struct cper_ia_err_info { |
390 | guid_t err_type; | 387 | guid_t err_type; |
391 | __u64 validation_bits; | 388 | __u64 validation_bits; |
@@ -396,7 +393,7 @@ struct cper_ia_err_info { | |||
396 | __u64 ip; | 393 | __u64 ip; |
397 | }; | 394 | }; |
398 | 395 | ||
399 | /* IA32/X64 Processor Context Information Structure */ | 396 | /* IA32/X64 Processor Context Information Structure, UEFI v2.7 sec N.2.4.2.2 */ |
400 | struct cper_ia_proc_ctx { | 397 | struct cper_ia_proc_ctx { |
401 | __u16 reg_ctx_type; | 398 | __u16 reg_ctx_type; |
402 | __u16 reg_arr_size; | 399 | __u16 reg_arr_size; |
@@ -404,7 +401,7 @@ struct cper_ia_proc_ctx { | |||
404 | __u64 mm_reg_addr; | 401 | __u64 mm_reg_addr; |
405 | }; | 402 | }; |
406 | 403 | ||
407 | /* ARM Processor Error Section */ | 404 | /* ARM Processor Error Section, UEFI v2.7 sec N.2.4.4 */ |
408 | struct cper_sec_proc_arm { | 405 | struct cper_sec_proc_arm { |
409 | __u32 validation_bits; | 406 | __u32 validation_bits; |
410 | __u16 err_info_num; /* Number of Processor Error Info */ | 407 | __u16 err_info_num; /* Number of Processor Error Info */ |
@@ -418,7 +415,7 @@ struct cper_sec_proc_arm { | |||
418 | __u32 psci_state; | 415 | __u32 psci_state; |
419 | }; | 416 | }; |
420 | 417 | ||
421 | /* ARM Processor Error Information Structure */ | 418 | /* ARM Processor Error Information Structure, UEFI v2.7 sec N.2.4.4.1 */ |
422 | struct cper_arm_err_info { | 419 | struct cper_arm_err_info { |
423 | __u8 version; | 420 | __u8 version; |
424 | __u8 length; | 421 | __u8 length; |
@@ -431,14 +428,14 @@ struct cper_arm_err_info { | |||
431 | __u64 physical_fault_addr; | 428 | __u64 physical_fault_addr; |
432 | }; | 429 | }; |
433 | 430 | ||
434 | /* ARM Processor Context Information Structure */ | 431 | /* ARM Processor Context Information Structure, UEFI v2.7 sec N.2.4.4.2 */ |
435 | struct cper_arm_ctx_info { | 432 | struct cper_arm_ctx_info { |
436 | __u16 version; | 433 | __u16 version; |
437 | __u16 type; | 434 | __u16 type; |
438 | __u32 size; | 435 | __u32 size; |
439 | }; | 436 | }; |
440 | 437 | ||
441 | /* Old Memory Error Section UEFI 2.1, 2.2 */ | 438 | /* Old Memory Error Section, UEFI v2.1, v2.2 */ |
442 | struct cper_sec_mem_err_old { | 439 | struct cper_sec_mem_err_old { |
443 | __u64 validation_bits; | 440 | __u64 validation_bits; |
444 | __u64 error_status; | 441 | __u64 error_status; |
@@ -458,7 +455,7 @@ struct cper_sec_mem_err_old { | |||
458 | __u8 error_type; | 455 | __u8 error_type; |
459 | }; | 456 | }; |
460 | 457 | ||
461 | /* Memory Error Section UEFI >= 2.3 */ | 458 | /* Memory Error Section (UEFI >= v2.3), UEFI v2.7 sec N.2.5 */ |
462 | struct cper_sec_mem_err { | 459 | struct cper_sec_mem_err { |
463 | __u64 validation_bits; | 460 | __u64 validation_bits; |
464 | __u64 error_status; | 461 | __u64 error_status; |
@@ -478,8 +475,8 @@ struct cper_sec_mem_err { | |||
478 | __u8 error_type; | 475 | __u8 error_type; |
479 | __u8 reserved; | 476 | __u8 reserved; |
480 | __u16 rank; | 477 | __u16 rank; |
481 | __u16 mem_array_handle; /* card handle in UEFI 2.4 */ | 478 | __u16 mem_array_handle; /* "card handle" in UEFI 2.4 */ |
482 | __u16 mem_dev_handle; /* module handle in UEFI 2.4 */ | 479 | __u16 mem_dev_handle; /* "module handle" in UEFI 2.4 */ |
483 | }; | 480 | }; |
484 | 481 | ||
485 | struct cper_mem_err_compact { | 482 | struct cper_mem_err_compact { |
@@ -500,6 +497,7 @@ struct cper_mem_err_compact { | |||
500 | __u16 mem_dev_handle; | 497 | __u16 mem_dev_handle; |
501 | }; | 498 | }; |
502 | 499 | ||
500 | /* PCI Express Error Section, UEFI v2.7 sec N.2.7 */ | ||
503 | struct cper_sec_pcie { | 501 | struct cper_sec_pcie { |
504 | __u64 validation_bits; | 502 | __u64 validation_bits; |
505 | __u32 port_type; | 503 | __u32 port_type; |
@@ -538,7 +536,7 @@ struct cper_sec_pcie { | |||
538 | /* Reset to default packing */ | 536 | /* Reset to default packing */ |
539 | #pragma pack() | 537 | #pragma pack() |
540 | 538 | ||
541 | extern const char * const cper_proc_error_type_strs[4]; | 539 | extern const char *const cper_proc_error_type_strs[4]; |
542 | 540 | ||
543 | u64 cper_next_record_id(void); | 541 | u64 cper_next_record_id(void); |
544 | const char *cper_severity_str(unsigned int); | 542 | const char *cper_severity_str(unsigned int); |