aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYazen Ghannam <yazen.ghannam@amd.com>2018-05-04 01:59:54 -0400
committerIngo Molnar <mingo@kernel.org>2018-05-14 02:57:48 -0400
commitc6bc4ac0aadede7a5c5260bcc315cd2b18c6b471 (patch)
tree3fe965e4246c979701a3879a4d327cf6cf6c7fea
parenta9c1e3e791409e35207277b7873efc756b6fb625 (diff)
efi: Decode additional IA32/X64 Bus Check fields
The "Participation Type", "Time Out", and "Address Space" fields are unique to the IA32/X64 Bus Check structure. Print these fields. Based on UEFI 2.7 Table 256. IA32/X64 Bus Check Structure Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20180504060003.19618-9-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--drivers/firmware/efi/cper-x86.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/firmware/efi/cper-x86.c b/drivers/firmware/efi/cper-x86.c
index f70c46f7a4db..5e6716564dba 100644
--- a/drivers/firmware/efi/cper-x86.c
+++ b/drivers/firmware/efi/cper-x86.c
@@ -39,6 +39,10 @@
39#define CHECK_VALID_RESTARTABLE_IP BIT_ULL(6) 39#define CHECK_VALID_RESTARTABLE_IP BIT_ULL(6)
40#define CHECK_VALID_OVERFLOW BIT_ULL(7) 40#define CHECK_VALID_OVERFLOW BIT_ULL(7)
41 41
42#define CHECK_VALID_BUS_PART_TYPE BIT_ULL(8)
43#define CHECK_VALID_BUS_TIME_OUT BIT_ULL(9)
44#define CHECK_VALID_BUS_ADDR_SPACE BIT_ULL(10)
45
42#define CHECK_VALID_BITS(check) (((check) & GENMASK_ULL(15, 0))) 46#define CHECK_VALID_BITS(check) (((check) & GENMASK_ULL(15, 0)))
43#define CHECK_TRANS_TYPE(check) (((check) & GENMASK_ULL(17, 16)) >> 16) 47#define CHECK_TRANS_TYPE(check) (((check) & GENMASK_ULL(17, 16)) >> 16)
44#define CHECK_OPERATION(check) (((check) & GENMASK_ULL(21, 18)) >> 18) 48#define CHECK_OPERATION(check) (((check) & GENMASK_ULL(21, 18)) >> 18)
@@ -49,6 +53,10 @@
49#define CHECK_RESTARTABLE_IP BIT_ULL(28) 53#define CHECK_RESTARTABLE_IP BIT_ULL(28)
50#define CHECK_OVERFLOW BIT_ULL(29) 54#define CHECK_OVERFLOW BIT_ULL(29)
51 55
56#define CHECK_BUS_PART_TYPE(check) (((check) & GENMASK_ULL(31, 30)) >> 30)
57#define CHECK_BUS_TIME_OUT BIT_ULL(32)
58#define CHECK_BUS_ADDR_SPACE(check) (((check) & GENMASK_ULL(34, 33)) >> 33)
59
52enum err_types { 60enum err_types {
53 ERR_TYPE_CACHE = 0, 61 ERR_TYPE_CACHE = 0,
54 ERR_TYPE_TLB, 62 ERR_TYPE_TLB,
@@ -89,6 +97,20 @@ static const char * const ia_check_op_strs[] = {
89 "snoop", 97 "snoop",
90}; 98};
91 99
100static const char * const ia_check_bus_part_type_strs[] = {
101 "Local Processor originated request",
102 "Local Processor responded to request",
103 "Local Processor observed",
104 "Generic",
105};
106
107static const char * const ia_check_bus_addr_space_strs[] = {
108 "Memory Access",
109 "Reserved",
110 "I/O",
111 "Other Transaction",
112};
113
92static inline void print_bool(char *str, const char *pfx, u64 check, u64 bit) 114static inline void print_bool(char *str, const char *pfx, u64 check, u64 bit)
93{ 115{
94 printk("%s%s: %s\n", pfx, str, (check & bit) ? "true" : "false"); 116 printk("%s%s: %s\n", pfx, str, (check & bit) ? "true" : "false");
@@ -139,6 +161,28 @@ static void print_err_info(const char *pfx, u8 err_type, u64 check)
139 161
140 if (validation_bits & CHECK_VALID_OVERFLOW) 162 if (validation_bits & CHECK_VALID_OVERFLOW)
141 print_bool("Overflow", pfx, check, CHECK_OVERFLOW); 163 print_bool("Overflow", pfx, check, CHECK_OVERFLOW);
164
165 if (err_type != ERR_TYPE_BUS)
166 return;
167
168 if (validation_bits & CHECK_VALID_BUS_PART_TYPE) {
169 u8 part_type = CHECK_BUS_PART_TYPE(check);
170
171 printk("%sParticipation Type: %u, %s\n", pfx, part_type,
172 part_type < ARRAY_SIZE(ia_check_bus_part_type_strs) ?
173 ia_check_bus_part_type_strs[part_type] : "unknown");
174 }
175
176 if (validation_bits & CHECK_VALID_BUS_TIME_OUT)
177 print_bool("Time Out", pfx, check, CHECK_BUS_TIME_OUT);
178
179 if (validation_bits & CHECK_VALID_BUS_ADDR_SPACE) {
180 u8 addr_space = CHECK_BUS_ADDR_SPACE(check);
181
182 printk("%sAddress Space: %u, %s\n", pfx, addr_space,
183 addr_space < ARRAY_SIZE(ia_check_bus_addr_space_strs) ?
184 ia_check_bus_addr_space_strs[addr_space] : "unknown");
185 }
142} 186}
143 187
144void cper_print_proc_ia(const char *pfx, const struct cper_sec_proc_ia *proc) 188void cper_print_proc_ia(const char *pfx, const struct cper_sec_proc_ia *proc)