| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * UEFI Common Platform Error Record |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2010, Intel Corp. |
|---|
| 5 | 6 | * Author: Huang Ying <ying.huang@intel.com> |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or |
|---|
| 8 | | - * modify it under the terms of the GNU General Public License version |
|---|
| 9 | | - * 2 as published by the Free Software Foundation. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | | - * |
|---|
| 16 | | - * You should have received a copy of the GNU General Public License |
|---|
| 17 | | - * along with this program; if not, write to the Free Software |
|---|
| 18 | | - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|---|
| 19 | 7 | */ |
|---|
| 20 | 8 | |
|---|
| 21 | 9 | #ifndef LINUX_CPER_H |
|---|
| .. | .. |
|---|
| 44 | 32 | */ |
|---|
| 45 | 33 | #define CPER_REC_LEN 256 |
|---|
| 46 | 34 | /* |
|---|
| 47 | | - * Severity difinition for error_severity in struct cper_record_header |
|---|
| 35 | + * Severity definition for error_severity in struct cper_record_header |
|---|
| 48 | 36 | * and section_severity in struct cper_section_descriptor |
|---|
| 49 | 37 | */ |
|---|
| 50 | 38 | enum { |
|---|
| .. | .. |
|---|
| 55 | 43 | }; |
|---|
| 56 | 44 | |
|---|
| 57 | 45 | /* |
|---|
| 58 | | - * Validation bits difinition for validation_bits in struct |
|---|
| 46 | + * Validation bits definition for validation_bits in struct |
|---|
| 59 | 47 | * cper_record_header. If set, corresponding fields in struct |
|---|
| 60 | 48 | * cper_record_header contain valid information. |
|---|
| 61 | | - * |
|---|
| 62 | | - * corresponds platform_id |
|---|
| 63 | 49 | */ |
|---|
| 64 | 50 | #define CPER_VALID_PLATFORM_ID 0x0001 |
|---|
| 65 | | -/* corresponds timestamp */ |
|---|
| 66 | 51 | #define CPER_VALID_TIMESTAMP 0x0002 |
|---|
| 67 | | -/* corresponds partition_id */ |
|---|
| 68 | 52 | #define CPER_VALID_PARTITION_ID 0x0004 |
|---|
| 69 | 53 | |
|---|
| 70 | 54 | /* |
|---|
| 71 | 55 | * Notification type used to generate error record, used in |
|---|
| 72 | | - * notification_type in struct cper_record_header |
|---|
| 73 | | - * |
|---|
| 74 | | - * Corrected Machine Check |
|---|
| 56 | + * notification_type in struct cper_record_header. These UUIDs are defined |
|---|
| 57 | + * in the UEFI spec v2.7, sec N.2.1. |
|---|
| 75 | 58 | */ |
|---|
| 59 | + |
|---|
| 60 | +/* Corrected Machine Check */ |
|---|
| 76 | 61 | #define CPER_NOTIFY_CMC \ |
|---|
| 77 | 62 | GUID_INIT(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \ |
|---|
| 78 | 63 | 0xEB, 0xD4, 0xF8, 0x90) |
|---|
| .. | .. |
|---|
| 122 | 107 | #define CPER_SEC_REV 0x0100 |
|---|
| 123 | 108 | |
|---|
| 124 | 109 | /* |
|---|
| 125 | | - * Validation bits difinition for validation_bits in struct |
|---|
| 110 | + * Validation bits definition for validation_bits in struct |
|---|
| 126 | 111 | * cper_section_descriptor. If set, corresponding fields in struct |
|---|
| 127 | 112 | * cper_section_descriptor contain valid information. |
|---|
| 128 | | - * |
|---|
| 129 | | - * corresponds fru_id |
|---|
| 130 | 113 | */ |
|---|
| 131 | 114 | #define CPER_SEC_VALID_FRU_ID 0x1 |
|---|
| 132 | | -/* corresponds fru_text */ |
|---|
| 133 | 115 | #define CPER_SEC_VALID_FRU_TEXT 0x2 |
|---|
| 134 | 116 | |
|---|
| 135 | 117 | /* |
|---|
| .. | .. |
|---|
| 165 | 147 | |
|---|
| 166 | 148 | /* |
|---|
| 167 | 149 | * Section type definitions, used in section_type field in struct |
|---|
| 168 | | - * cper_section_descriptor |
|---|
| 169 | | - * |
|---|
| 170 | | - * Processor Generic |
|---|
| 150 | + * cper_section_descriptor. These UUIDs are defined in the UEFI spec |
|---|
| 151 | + * v2.7, sec N.2.2. |
|---|
| 171 | 152 | */ |
|---|
| 153 | + |
|---|
| 154 | +/* Processor Generic */ |
|---|
| 172 | 155 | #define CPER_SEC_PROC_GENERIC \ |
|---|
| 173 | 156 | GUID_INIT(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \ |
|---|
| 174 | 157 | 0x93, 0xC4, 0xF3, 0xDB) |
|---|
| .. | .. |
|---|
| 247 | 230 | #define CPER_MEM_VALID_RANK_NUMBER 0x8000 |
|---|
| 248 | 231 | #define CPER_MEM_VALID_CARD_HANDLE 0x10000 |
|---|
| 249 | 232 | #define CPER_MEM_VALID_MODULE_HANDLE 0x20000 |
|---|
| 233 | +#define CPER_MEM_VALID_ROW_EXT 0x40000 |
|---|
| 234 | +#define CPER_MEM_VALID_BANK_GROUP 0x80000 |
|---|
| 235 | +#define CPER_MEM_VALID_BANK_ADDRESS 0x100000 |
|---|
| 236 | +#define CPER_MEM_VALID_CHIP_ID 0x200000 |
|---|
| 237 | + |
|---|
| 238 | +#define CPER_MEM_EXT_ROW_MASK 0x3 |
|---|
| 239 | +#define CPER_MEM_EXT_ROW_SHIFT 16 |
|---|
| 240 | + |
|---|
| 241 | +#define CPER_MEM_BANK_ADDRESS_MASK 0xff |
|---|
| 242 | +#define CPER_MEM_BANK_GROUP_SHIFT 8 |
|---|
| 243 | + |
|---|
| 244 | +#define CPER_MEM_CHIP_ID_SHIFT 5 |
|---|
| 250 | 245 | |
|---|
| 251 | 246 | #define CPER_PCIE_VALID_PORT_TYPE 0x0001 |
|---|
| 252 | 247 | #define CPER_PCIE_VALID_VERSION 0x0002 |
|---|
| .. | .. |
|---|
| 325 | 320 | */ |
|---|
| 326 | 321 | #pragma pack(1) |
|---|
| 327 | 322 | |
|---|
| 323 | +/* Record Header, UEFI v2.7 sec N.2.1 */ |
|---|
| 328 | 324 | struct cper_record_header { |
|---|
| 329 | 325 | char signature[CPER_SIG_SIZE]; /* must be CPER_SIG_RECORD */ |
|---|
| 330 | | - __u16 revision; /* must be CPER_RECORD_REV */ |
|---|
| 331 | | - __u32 signature_end; /* must be CPER_SIG_END */ |
|---|
| 332 | | - __u16 section_count; |
|---|
| 333 | | - __u32 error_severity; |
|---|
| 334 | | - __u32 validation_bits; |
|---|
| 335 | | - __u32 record_length; |
|---|
| 336 | | - __u64 timestamp; |
|---|
| 326 | + u16 revision; /* must be CPER_RECORD_REV */ |
|---|
| 327 | + u32 signature_end; /* must be CPER_SIG_END */ |
|---|
| 328 | + u16 section_count; |
|---|
| 329 | + u32 error_severity; |
|---|
| 330 | + u32 validation_bits; |
|---|
| 331 | + u32 record_length; |
|---|
| 332 | + u64 timestamp; |
|---|
| 337 | 333 | guid_t platform_id; |
|---|
| 338 | 334 | guid_t partition_id; |
|---|
| 339 | 335 | guid_t creator_id; |
|---|
| 340 | 336 | guid_t notification_type; |
|---|
| 341 | | - __u64 record_id; |
|---|
| 342 | | - __u32 flags; |
|---|
| 343 | | - __u64 persistence_information; |
|---|
| 344 | | - __u8 reserved[12]; /* must be zero */ |
|---|
| 337 | + u64 record_id; |
|---|
| 338 | + u32 flags; |
|---|
| 339 | + u64 persistence_information; |
|---|
| 340 | + u8 reserved[12]; /* must be zero */ |
|---|
| 345 | 341 | }; |
|---|
| 346 | 342 | |
|---|
| 343 | +/* Section Descriptor, UEFI v2.7 sec N.2.2 */ |
|---|
| 347 | 344 | struct cper_section_descriptor { |
|---|
| 348 | | - __u32 section_offset; /* Offset in bytes of the |
|---|
| 345 | + u32 section_offset; /* Offset in bytes of the |
|---|
| 349 | 346 | * section body from the base |
|---|
| 350 | 347 | * of the record header */ |
|---|
| 351 | | - __u32 section_length; |
|---|
| 352 | | - __u16 revision; /* must be CPER_RECORD_REV */ |
|---|
| 353 | | - __u8 validation_bits; |
|---|
| 354 | | - __u8 reserved; /* must be zero */ |
|---|
| 355 | | - __u32 flags; |
|---|
| 348 | + u32 section_length; |
|---|
| 349 | + u16 revision; /* must be CPER_RECORD_REV */ |
|---|
| 350 | + u8 validation_bits; |
|---|
| 351 | + u8 reserved; /* must be zero */ |
|---|
| 352 | + u32 flags; |
|---|
| 356 | 353 | guid_t section_type; |
|---|
| 357 | 354 | guid_t fru_id; |
|---|
| 358 | | - __u32 section_severity; |
|---|
| 359 | | - __u8 fru_text[20]; |
|---|
| 355 | + u32 section_severity; |
|---|
| 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 | 360 | struct cper_sec_proc_generic { |
|---|
| 364 | | - __u64 validation_bits; |
|---|
| 365 | | - __u8 proc_type; |
|---|
| 366 | | - __u8 proc_isa; |
|---|
| 367 | | - __u8 proc_error_type; |
|---|
| 368 | | - __u8 operation; |
|---|
| 369 | | - __u8 flags; |
|---|
| 370 | | - __u8 level; |
|---|
| 371 | | - __u16 reserved; |
|---|
| 372 | | - __u64 cpu_version; |
|---|
| 361 | + u64 validation_bits; |
|---|
| 362 | + u8 proc_type; |
|---|
| 363 | + u8 proc_isa; |
|---|
| 364 | + u8 proc_error_type; |
|---|
| 365 | + u8 operation; |
|---|
| 366 | + u8 flags; |
|---|
| 367 | + u8 level; |
|---|
| 368 | + u16 reserved; |
|---|
| 369 | + u64 cpu_version; |
|---|
| 373 | 370 | char cpu_brand[128]; |
|---|
| 374 | | - __u64 proc_id; |
|---|
| 375 | | - __u64 target_addr; |
|---|
| 376 | | - __u64 requestor_id; |
|---|
| 377 | | - __u64 responder_id; |
|---|
| 378 | | - __u64 ip; |
|---|
| 371 | + u64 proc_id; |
|---|
| 372 | + u64 target_addr; |
|---|
| 373 | + u64 requestor_id; |
|---|
| 374 | + u64 responder_id; |
|---|
| 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 | 379 | struct cper_sec_proc_ia { |
|---|
| 383 | | - __u64 validation_bits; |
|---|
| 384 | | - __u64 lapic_id; |
|---|
| 385 | | - __u8 cpuid[48]; |
|---|
| 380 | + u64 validation_bits; |
|---|
| 381 | + u64 lapic_id; |
|---|
| 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 | 386 | struct cper_ia_err_info { |
|---|
| 390 | 387 | guid_t err_type; |
|---|
| 391 | | - __u64 validation_bits; |
|---|
| 392 | | - __u64 check_info; |
|---|
| 393 | | - __u64 target_id; |
|---|
| 394 | | - __u64 requestor_id; |
|---|
| 395 | | - __u64 responder_id; |
|---|
| 396 | | - __u64 ip; |
|---|
| 388 | + u64 validation_bits; |
|---|
| 389 | + u64 check_info; |
|---|
| 390 | + u64 target_id; |
|---|
| 391 | + u64 requestor_id; |
|---|
| 392 | + u64 responder_id; |
|---|
| 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 | 397 | struct cper_ia_proc_ctx { |
|---|
| 401 | | - __u16 reg_ctx_type; |
|---|
| 402 | | - __u16 reg_arr_size; |
|---|
| 403 | | - __u32 msr_addr; |
|---|
| 404 | | - __u64 mm_reg_addr; |
|---|
| 398 | + u16 reg_ctx_type; |
|---|
| 399 | + u16 reg_arr_size; |
|---|
| 400 | + u32 msr_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 | 405 | struct cper_sec_proc_arm { |
|---|
| 409 | | - __u32 validation_bits; |
|---|
| 410 | | - __u16 err_info_num; /* Number of Processor Error Info */ |
|---|
| 411 | | - __u16 context_info_num; /* Number of Processor Context Info Records*/ |
|---|
| 412 | | - __u32 section_length; |
|---|
| 413 | | - __u8 affinity_level; |
|---|
| 414 | | - __u8 reserved[3]; /* must be zero */ |
|---|
| 415 | | - __u64 mpidr; |
|---|
| 416 | | - __u64 midr; |
|---|
| 417 | | - __u32 running_state; /* Bit 0 set - Processor running. PSCI = 0 */ |
|---|
| 418 | | - __u32 psci_state; |
|---|
| 406 | + u32 validation_bits; |
|---|
| 407 | + u16 err_info_num; /* Number of Processor Error Info */ |
|---|
| 408 | + u16 context_info_num; /* Number of Processor Context Info Records*/ |
|---|
| 409 | + u32 section_length; |
|---|
| 410 | + u8 affinity_level; |
|---|
| 411 | + u8 reserved[3]; /* must be zero */ |
|---|
| 412 | + u64 mpidr; |
|---|
| 413 | + u64 midr; |
|---|
| 414 | + u32 running_state; /* Bit 0 set - Processor running. PSCI = 0 */ |
|---|
| 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 | 419 | struct cper_arm_err_info { |
|---|
| 423 | | - __u8 version; |
|---|
| 424 | | - __u8 length; |
|---|
| 425 | | - __u16 validation_bits; |
|---|
| 426 | | - __u8 type; |
|---|
| 427 | | - __u16 multiple_error; |
|---|
| 428 | | - __u8 flags; |
|---|
| 429 | | - __u64 error_info; |
|---|
| 430 | | - __u64 virt_fault_addr; |
|---|
| 431 | | - __u64 physical_fault_addr; |
|---|
| 420 | + u8 version; |
|---|
| 421 | + u8 length; |
|---|
| 422 | + u16 validation_bits; |
|---|
| 423 | + u8 type; |
|---|
| 424 | + u16 multiple_error; |
|---|
| 425 | + u8 flags; |
|---|
| 426 | + u64 error_info; |
|---|
| 427 | + u64 virt_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 | 432 | struct cper_arm_ctx_info { |
|---|
| 436 | | - __u16 version; |
|---|
| 437 | | - __u16 type; |
|---|
| 438 | | - __u32 size; |
|---|
| 433 | + u16 version; |
|---|
| 434 | + u16 type; |
|---|
| 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 | 439 | struct cper_sec_mem_err_old { |
|---|
| 443 | | - __u64 validation_bits; |
|---|
| 444 | | - __u64 error_status; |
|---|
| 445 | | - __u64 physical_addr; |
|---|
| 446 | | - __u64 physical_addr_mask; |
|---|
| 447 | | - __u16 node; |
|---|
| 448 | | - __u16 card; |
|---|
| 449 | | - __u16 module; |
|---|
| 450 | | - __u16 bank; |
|---|
| 451 | | - __u16 device; |
|---|
| 452 | | - __u16 row; |
|---|
| 453 | | - __u16 column; |
|---|
| 454 | | - __u16 bit_pos; |
|---|
| 455 | | - __u64 requestor_id; |
|---|
| 456 | | - __u64 responder_id; |
|---|
| 457 | | - __u64 target_id; |
|---|
| 458 | | - __u8 error_type; |
|---|
| 440 | + u64 validation_bits; |
|---|
| 441 | + u64 error_status; |
|---|
| 442 | + u64 physical_addr; |
|---|
| 443 | + u64 physical_addr_mask; |
|---|
| 444 | + u16 node; |
|---|
| 445 | + u16 card; |
|---|
| 446 | + u16 module; |
|---|
| 447 | + u16 bank; |
|---|
| 448 | + u16 device; |
|---|
| 449 | + u16 row; |
|---|
| 450 | + u16 column; |
|---|
| 451 | + u16 bit_pos; |
|---|
| 452 | + u64 requestor_id; |
|---|
| 453 | + u64 responder_id; |
|---|
| 454 | + u64 target_id; |
|---|
| 455 | + u8 error_type; |
|---|
| 459 | 456 | }; |
|---|
| 460 | 457 | |
|---|
| 461 | | -/* Memory Error Section UEFI >= 2.3 */ |
|---|
| 458 | +/* Memory Error Section (UEFI >= v2.3), UEFI v2.8 sec N.2.5 */ |
|---|
| 462 | 459 | struct cper_sec_mem_err { |
|---|
| 463 | | - __u64 validation_bits; |
|---|
| 464 | | - __u64 error_status; |
|---|
| 465 | | - __u64 physical_addr; |
|---|
| 466 | | - __u64 physical_addr_mask; |
|---|
| 467 | | - __u16 node; |
|---|
| 468 | | - __u16 card; |
|---|
| 469 | | - __u16 module; |
|---|
| 470 | | - __u16 bank; |
|---|
| 471 | | - __u16 device; |
|---|
| 472 | | - __u16 row; |
|---|
| 473 | | - __u16 column; |
|---|
| 474 | | - __u16 bit_pos; |
|---|
| 475 | | - __u64 requestor_id; |
|---|
| 476 | | - __u64 responder_id; |
|---|
| 477 | | - __u64 target_id; |
|---|
| 478 | | - __u8 error_type; |
|---|
| 479 | | - __u8 reserved; |
|---|
| 480 | | - __u16 rank; |
|---|
| 481 | | - __u16 mem_array_handle; /* card handle in UEFI 2.4 */ |
|---|
| 482 | | - __u16 mem_dev_handle; /* module handle in UEFI 2.4 */ |
|---|
| 460 | + u64 validation_bits; |
|---|
| 461 | + u64 error_status; |
|---|
| 462 | + u64 physical_addr; |
|---|
| 463 | + u64 physical_addr_mask; |
|---|
| 464 | + u16 node; |
|---|
| 465 | + u16 card; |
|---|
| 466 | + u16 module; |
|---|
| 467 | + u16 bank; |
|---|
| 468 | + u16 device; |
|---|
| 469 | + u16 row; |
|---|
| 470 | + u16 column; |
|---|
| 471 | + u16 bit_pos; |
|---|
| 472 | + u64 requestor_id; |
|---|
| 473 | + u64 responder_id; |
|---|
| 474 | + u64 target_id; |
|---|
| 475 | + u8 error_type; |
|---|
| 476 | + u8 extended; |
|---|
| 477 | + u16 rank; |
|---|
| 478 | + u16 mem_array_handle; /* "card handle" in UEFI 2.4 */ |
|---|
| 479 | + u16 mem_dev_handle; /* "module handle" in UEFI 2.4 */ |
|---|
| 483 | 480 | }; |
|---|
| 484 | 481 | |
|---|
| 485 | 482 | struct cper_mem_err_compact { |
|---|
| 486 | | - __u64 validation_bits; |
|---|
| 487 | | - __u16 node; |
|---|
| 488 | | - __u16 card; |
|---|
| 489 | | - __u16 module; |
|---|
| 490 | | - __u16 bank; |
|---|
| 491 | | - __u16 device; |
|---|
| 492 | | - __u16 row; |
|---|
| 493 | | - __u16 column; |
|---|
| 494 | | - __u16 bit_pos; |
|---|
| 495 | | - __u64 requestor_id; |
|---|
| 496 | | - __u64 responder_id; |
|---|
| 497 | | - __u64 target_id; |
|---|
| 498 | | - __u16 rank; |
|---|
| 499 | | - __u16 mem_array_handle; |
|---|
| 500 | | - __u16 mem_dev_handle; |
|---|
| 483 | + u64 validation_bits; |
|---|
| 484 | + u16 node; |
|---|
| 485 | + u16 card; |
|---|
| 486 | + u16 module; |
|---|
| 487 | + u16 bank; |
|---|
| 488 | + u16 device; |
|---|
| 489 | + u16 row; |
|---|
| 490 | + u16 column; |
|---|
| 491 | + u16 bit_pos; |
|---|
| 492 | + u64 requestor_id; |
|---|
| 493 | + u64 responder_id; |
|---|
| 494 | + u64 target_id; |
|---|
| 495 | + u16 rank; |
|---|
| 496 | + u16 mem_array_handle; |
|---|
| 497 | + u16 mem_dev_handle; |
|---|
| 498 | + u8 extended; |
|---|
| 501 | 499 | }; |
|---|
| 502 | 500 | |
|---|
| 501 | +static inline u32 cper_get_mem_extension(u64 mem_valid, u8 mem_extended) |
|---|
| 502 | +{ |
|---|
| 503 | + if (!(mem_valid & CPER_MEM_VALID_ROW_EXT)) |
|---|
| 504 | + return 0; |
|---|
| 505 | + return (mem_extended & CPER_MEM_EXT_ROW_MASK) << CPER_MEM_EXT_ROW_SHIFT; |
|---|
| 506 | +} |
|---|
| 507 | + |
|---|
| 508 | +/* PCI Express Error Section, UEFI v2.7 sec N.2.7 */ |
|---|
| 503 | 509 | struct cper_sec_pcie { |
|---|
| 504 | | - __u64 validation_bits; |
|---|
| 505 | | - __u32 port_type; |
|---|
| 510 | + u64 validation_bits; |
|---|
| 511 | + u32 port_type; |
|---|
| 506 | 512 | struct { |
|---|
| 507 | | - __u8 minor; |
|---|
| 508 | | - __u8 major; |
|---|
| 509 | | - __u8 reserved[2]; |
|---|
| 513 | + u8 minor; |
|---|
| 514 | + u8 major; |
|---|
| 515 | + u8 reserved[2]; |
|---|
| 510 | 516 | } version; |
|---|
| 511 | | - __u16 command; |
|---|
| 512 | | - __u16 status; |
|---|
| 513 | | - __u32 reserved; |
|---|
| 517 | + u16 command; |
|---|
| 518 | + u16 status; |
|---|
| 519 | + u32 reserved; |
|---|
| 514 | 520 | struct { |
|---|
| 515 | | - __u16 vendor_id; |
|---|
| 516 | | - __u16 device_id; |
|---|
| 517 | | - __u8 class_code[3]; |
|---|
| 518 | | - __u8 function; |
|---|
| 519 | | - __u8 device; |
|---|
| 520 | | - __u16 segment; |
|---|
| 521 | | - __u8 bus; |
|---|
| 522 | | - __u8 secondary_bus; |
|---|
| 523 | | - __u16 slot; |
|---|
| 524 | | - __u8 reserved; |
|---|
| 521 | + u16 vendor_id; |
|---|
| 522 | + u16 device_id; |
|---|
| 523 | + u8 class_code[3]; |
|---|
| 524 | + u8 function; |
|---|
| 525 | + u8 device; |
|---|
| 526 | + u16 segment; |
|---|
| 527 | + u8 bus; |
|---|
| 528 | + u8 secondary_bus; |
|---|
| 529 | + u16 slot; |
|---|
| 530 | + u8 reserved; |
|---|
| 525 | 531 | } device_id; |
|---|
| 526 | 532 | struct { |
|---|
| 527 | | - __u32 lower; |
|---|
| 528 | | - __u32 upper; |
|---|
| 533 | + u32 lower; |
|---|
| 534 | + u32 upper; |
|---|
| 529 | 535 | } serial_number; |
|---|
| 530 | 536 | struct { |
|---|
| 531 | | - __u16 secondary_status; |
|---|
| 532 | | - __u16 control; |
|---|
| 537 | + u16 secondary_status; |
|---|
| 538 | + u16 control; |
|---|
| 533 | 539 | } bridge; |
|---|
| 534 | | - __u8 capability[60]; |
|---|
| 535 | | - __u8 aer_info[96]; |
|---|
| 540 | + u8 capability[60]; |
|---|
| 541 | + u8 aer_info[96]; |
|---|
| 542 | +}; |
|---|
| 543 | + |
|---|
| 544 | +/* Firmware Error Record Reference, UEFI v2.7 sec N.2.10 */ |
|---|
| 545 | +struct cper_sec_fw_err_rec_ref { |
|---|
| 546 | + u8 record_type; |
|---|
| 547 | + u8 revision; |
|---|
| 548 | + u8 reserved[6]; |
|---|
| 549 | + u64 record_identifier; |
|---|
| 550 | + guid_t record_identifier_guid; |
|---|
| 536 | 551 | }; |
|---|
| 537 | 552 | |
|---|
| 538 | 553 | /* Reset to default packing */ |
|---|
| 539 | 554 | #pragma pack() |
|---|
| 540 | 555 | |
|---|
| 541 | | -extern const char * const cper_proc_error_type_strs[4]; |
|---|
| 556 | +extern const char *const cper_proc_error_type_strs[4]; |
|---|
| 542 | 557 | |
|---|
| 543 | 558 | u64 cper_next_record_id(void); |
|---|
| 544 | 559 | const char *cper_severity_str(unsigned int); |
|---|