Skip to content

Commit f59c55d

Browse files
yhuang-intellenb
authored andcommitted
ACPI, APEI, Add APEI generic error status printing support
In APEI, Hardware error information reported by firmware to Linux kernel is in the data structure of APEI generic error status (struct acpi_hes_generic_status). While now printk is used by Linux kernel to report hardware error information to user space. So, this patch adds printing support for the data structure, so that the corresponding hardware error information can be reported to user space via printk. PCIe AER information printing is not implemented yet. Will refactor the original PCIe AER information printing code to avoid code duplicating. The output format is as follow: <error record> := APEI generic hardware error status severity: <integer>, <severity string> section: <integer>, severity: <integer>, <severity string> flags: <integer> <section flags strings> fru_id: <uuid string> fru_text: <string> section_type: <section type string> <section data> <severity string>* := recoverable | fatal | corrected | info <section flags strings># := [primary][, containment warning][, reset][, threshold exceeded]\ [, resource not accessible][, latent error] <section type string> := generic processor error | memory error | \ PCIe error | unknown, <uuid string> <section data> := <generic processor section data> | <memory section data> | \ <pcie section data> | <null> <generic processor section data> := [processor_type: <integer>, <proc type string>] [processor_isa: <integer>, <proc isa string>] [error_type: <integer> <proc error type strings>] [operation: <integer>, <proc operation string>] [flags: <integer> <proc flags strings>] [level: <integer>] [version_info: <integer>] [processor_id: <integer>] [target_address: <integer>] [requestor_id: <integer>] [responder_id: <integer>] [IP: <integer>] <proc type string>* := IA32/X64 | IA64 <proc isa string>* := IA32 | IA64 | X64 <processor error type strings># := [cache error][, TLB error][, bus error][, micro-architectural error] <proc operation string>* := unknown or generic | data read | data write | \ instruction execution <proc flags strings># := [restartable][, precise IP][, overflow][, corrected] <memory section data> := [error_status: <integer>] [physical_address: <integer>] [physical_address_mask: <integer>] [node: <integer>] [card: <integer>] [module: <integer>] [bank: <integer>] [device: <integer>] [row: <integer>] [column: <integer>] [bit_position: <integer>] [requestor_id: <integer>] [responder_id: <integer>] [target_id: <integer>] [error_type: <integer>, <mem error type string>] <mem error type string>* := unknown | no error | single-bit ECC | multi-bit ECC | \ single-symbol chipkill ECC | multi-symbol chipkill ECC | master abort | \ target abort | parity error | watchdog timeout | invalid address | \ mirror Broken | memory sparing | scrub corrected error | \ scrub uncorrected error <pcie section data> := [port_type: <integer>, <pcie port type string>] [version: <integer>.<integer>] [command: <integer>, status: <integer>] [device_id: <integer>:<integer>:<integer>.<integer> slot: <integer> secondary_bus: <integer> vendor_id: <integer>, device_id: <integer> class_code: <integer>] [serial number: <integer>, <integer>] [bridge: secondary_status: <integer>, control: <integer>] <pcie port type string>* := PCIe end point | legacy PCI end point | \ unknown | unknown | root port | upstream switch port | \ downstream switch port | PCIe to PCI/PCI-X bridge | \ PCI/PCI-X to PCIe bridge | root complex integrated endpoint device | \ root complex event collector Where, [] designate corresponding content is optional All <field string> description with * has the following format: field: <integer>, <field string> Where value of <integer> should be the position of "string" in <field string> description. Otherwise, <field string> will be "unknown". All <field strings> description with # has the following format: field: <integer> <field strings> Where each string in <fields strings> corresponding to one set bit of <integer>. The bit position is the position of "string" in <field strings> description. For more detailed explanation of every field, please refer to UEFI specification version 2.3 or later, section Appendix N: Common Platform Error Record. Signed-off-by: Huang Ying <ying.huang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
1 parent c9aa308 commit f59c55d

3 files changed

Lines changed: 435 additions & 0 deletions

File tree

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
APEI output format
2+
~~~~~~~~~~~~~~~~~~
3+
4+
APEI uses printk as hardware error reporting interface, the output
5+
format is as follow.
6+
7+
<error record> :=
8+
APEI generic hardware error status
9+
severity: <integer>, <severity string>
10+
section: <integer>, severity: <integer>, <severity string>
11+
flags: <integer>
12+
<section flags strings>
13+
fru_id: <uuid string>
14+
fru_text: <string>
15+
section_type: <section type string>
16+
<section data>
17+
18+
<severity string>* := recoverable | fatal | corrected | info
19+
20+
<section flags strings># :=
21+
[primary][, containment warning][, reset][, threshold exceeded]\
22+
[, resource not accessible][, latent error]
23+
24+
<section type string> := generic processor error | memory error | \
25+
PCIe error | unknown, <uuid string>
26+
27+
<section data> :=
28+
<generic processor section data> | <memory section data> | \
29+
<pcie section data> | <null>
30+
31+
<generic processor section data> :=
32+
[processor_type: <integer>, <proc type string>]
33+
[processor_isa: <integer>, <proc isa string>]
34+
[error_type: <integer>
35+
<proc error type strings>]
36+
[operation: <integer>, <proc operation string>]
37+
[flags: <integer>
38+
<proc flags strings>]
39+
[level: <integer>]
40+
[version_info: <integer>]
41+
[processor_id: <integer>]
42+
[target_address: <integer>]
43+
[requestor_id: <integer>]
44+
[responder_id: <integer>]
45+
[IP: <integer>]
46+
47+
<proc type string>* := IA32/X64 | IA64
48+
49+
<proc isa string>* := IA32 | IA64 | X64
50+
51+
<processor error type strings># :=
52+
[cache error][, TLB error][, bus error][, micro-architectural error]
53+
54+
<proc operation string>* := unknown or generic | data read | data write | \
55+
instruction execution
56+
57+
<proc flags strings># :=
58+
[restartable][, precise IP][, overflow][, corrected]
59+
60+
<memory section data> :=
61+
[error_status: <integer>]
62+
[physical_address: <integer>]
63+
[physical_address_mask: <integer>]
64+
[node: <integer>]
65+
[card: <integer>]
66+
[module: <integer>]
67+
[bank: <integer>]
68+
[device: <integer>]
69+
[row: <integer>]
70+
[column: <integer>]
71+
[bit_position: <integer>]
72+
[requestor_id: <integer>]
73+
[responder_id: <integer>]
74+
[target_id: <integer>]
75+
[error_type: <integer>, <mem error type string>]
76+
77+
<mem error type string>* :=
78+
unknown | no error | single-bit ECC | multi-bit ECC | \
79+
single-symbol chipkill ECC | multi-symbol chipkill ECC | master abort | \
80+
target abort | parity error | watchdog timeout | invalid address | \
81+
mirror Broken | memory sparing | scrub corrected error | \
82+
scrub uncorrected error
83+
84+
<pcie section data> :=
85+
[port_type: <integer>, <pcie port type string>]
86+
[version: <integer>.<integer>]
87+
[command: <integer>, status: <integer>]
88+
[device_id: <integer>:<integer>:<integer>.<integer>
89+
slot: <integer>
90+
secondary_bus: <integer>
91+
vendor_id: <integer>, device_id: <integer>
92+
class_code: <integer>]
93+
[serial number: <integer>, <integer>]
94+
[bridge: secondary_status: <integer>, control: <integer>]
95+
96+
<pcie port type string>* := PCIe end point | legacy PCI end point | \
97+
unknown | unknown | root port | upstream switch port | \
98+
downstream switch port | PCIe to PCI/PCI-X bridge | \
99+
PCI/PCI-X to PCIe bridge | root complex integrated endpoint device | \
100+
root complex event collector
101+
102+
Where, [] designate corresponding content is optional
103+
104+
All <field string> description with * has the following format:
105+
106+
field: <integer>, <field string>
107+
108+
Where value of <integer> should be the position of "string" in <field
109+
string> description. Otherwise, <field string> will be "unknown".
110+
111+
All <field strings> description with # has the following format:
112+
113+
field: <integer>
114+
<field strings>
115+
116+
Where each string in <fields strings> corresponding to one set bit of
117+
<integer>. The bit position is the position of "string" in <field
118+
strings> description.
119+
120+
For more detailed explanation of every field, please refer to UEFI
121+
specification version 2.3 or later, section Appendix N: Common
122+
Platform Error Record.

‎drivers/acpi/apei/apei-internal.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ static inline u32 apei_estatus_len(struct acpi_hest_generic_status *estatus)
109109
return sizeof(*estatus) + estatus->data_length;
110110
}
111111

112+
void apei_estatus_print(const char *pfx,
113+
const struct acpi_hest_generic_status *estatus);
112114
int apei_estatus_check_header(const struct acpi_hest_generic_status *estatus);
113115
int apei_estatus_check(const struct acpi_hest_generic_status *estatus);
114116
#endif

0 commit comments

Comments
 (0)