aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYazen Ghannam <yazen.ghannam@amd.com>2018-05-04 01:59:50 -0400
committerIngo Molnar <mingo@kernel.org>2018-05-14 02:57:47 -0400
commitf9e1bdb9f35f4f5cfa7c9025ac68c02909b6d3b1 (patch)
tree0d2dcf6dc509a8460df02e543efea941f65d15e7
parent742632d237ce180439ab4af31e9891df0df81233 (diff)
efi: Decode IA32/X64 Processor Error Section
Recognize the IA32/X64 Processor Error Section. Do the section decoding in a new "cper-x86.c" file and add this to the Makefile depending on a new "UEFI_CPER_X86" config option. Print the Local APIC ID and CPUID info from the Processor Error Record. The "Processor Error Info" and "Processor Context" fields will be decoded in following patches. Based on UEFI 2.7 Table 252. Processor Error Record. 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-5-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--drivers/firmware/efi/Kconfig5
-rw-r--r--drivers/firmware/efi/Makefile1
-rw-r--r--drivers/firmware/efi/cper-x86.c23
-rw-r--r--drivers/firmware/efi/cper.c10
-rw-r--r--include/linux/cper.h2
5 files changed, 41 insertions, 0 deletions
diff --git a/drivers/firmware/efi/Kconfig b/drivers/firmware/efi/Kconfig
index 3098410abad8..781a4a337557 100644
--- a/drivers/firmware/efi/Kconfig
+++ b/drivers/firmware/efi/Kconfig
@@ -174,6 +174,11 @@ config UEFI_CPER_ARM
174 depends on UEFI_CPER && ( ARM || ARM64 ) 174 depends on UEFI_CPER && ( ARM || ARM64 )
175 default y 175 default y
176 176
177config UEFI_CPER_X86
178 bool
179 depends on UEFI_CPER && X86
180 default y
181
177config EFI_DEV_PATH_PARSER 182config EFI_DEV_PATH_PARSER
178 bool 183 bool
179 depends on ACPI 184 depends on ACPI
diff --git a/drivers/firmware/efi/Makefile b/drivers/firmware/efi/Makefile
index cb805374f4bc..5f9f5039de50 100644
--- a/drivers/firmware/efi/Makefile
+++ b/drivers/firmware/efi/Makefile
@@ -31,3 +31,4 @@ obj-$(CONFIG_ARM) += $(arm-obj-y)
31obj-$(CONFIG_ARM64) += $(arm-obj-y) 31obj-$(CONFIG_ARM64) += $(arm-obj-y)
32obj-$(CONFIG_EFI_CAPSULE_LOADER) += capsule-loader.o 32obj-$(CONFIG_EFI_CAPSULE_LOADER) += capsule-loader.o
33obj-$(CONFIG_UEFI_CPER_ARM) += cper-arm.o 33obj-$(CONFIG_UEFI_CPER_ARM) += cper-arm.o
34obj-$(CONFIG_UEFI_CPER_X86) += cper-x86.o
diff --git a/drivers/firmware/efi/cper-x86.c b/drivers/firmware/efi/cper-x86.c
new file mode 100644
index 000000000000..863f0cd2a0ff
--- /dev/null
+++ b/drivers/firmware/efi/cper-x86.c
@@ -0,0 +1,23 @@
1// SPDX-License-Identifier: GPL-2.0
2// Copyright (C) 2018, Advanced Micro Devices, Inc.
3
4#include <linux/cper.h>
5
6/*
7 * We don't need a "CPER_IA" prefix since these are all locally defined.
8 * This will save us a lot of line space.
9 */
10#define VALID_LAPIC_ID BIT_ULL(0)
11#define VALID_CPUID_INFO BIT_ULL(1)
12
13void cper_print_proc_ia(const char *pfx, const struct cper_sec_proc_ia *proc)
14{
15 if (proc->validation_bits & VALID_LAPIC_ID)
16 printk("%sLocal APIC_ID: 0x%llx\n", pfx, proc->lapic_id);
17
18 if (proc->validation_bits & VALID_CPUID_INFO) {
19 printk("%sCPUID Info:\n", pfx);
20 print_hex_dump(pfx, "", DUMP_PREFIX_OFFSET, 16, 4, proc->cpuid,
21 sizeof(proc->cpuid), 0);
22 }
23}
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c
index ab21f1614007..3bf0dca378a6 100644
--- a/drivers/firmware/efi/cper.c
+++ b/drivers/firmware/efi/cper.c
@@ -468,6 +468,16 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata
468 else 468 else
469 goto err_section_too_small; 469 goto err_section_too_small;
470#endif 470#endif
471#if defined(CONFIG_UEFI_CPER_X86)
472 } else if (guid_equal(sec_type, &CPER_SEC_PROC_IA)) {
473 struct cper_sec_proc_ia *ia_err = acpi_hest_get_payload(gdata);
474
475 printk("%ssection_type: IA32/X64 processor error\n", newpfx);
476 if (gdata->error_data_length >= sizeof(*ia_err))
477 cper_print_proc_ia(newpfx, ia_err);
478 else
479 goto err_section_too_small;
480#endif
471 } else { 481 } else {
472 const void *err = acpi_hest_get_payload(gdata); 482 const void *err = acpi_hest_get_payload(gdata);
473 483
diff --git a/include/linux/cper.h b/include/linux/cper.h
index 4b5f8459b403..9c703a0abe6e 100644
--- a/include/linux/cper.h
+++ b/include/linux/cper.h
@@ -551,5 +551,7 @@ const char *cper_mem_err_unpack(struct trace_seq *,
551 struct cper_mem_err_compact *); 551 struct cper_mem_err_compact *);
552void cper_print_proc_arm(const char *pfx, 552void cper_print_proc_arm(const char *pfx,
553 const struct cper_sec_proc_arm *proc); 553 const struct cper_sec_proc_arm *proc);
554void cper_print_proc_ia(const char *pfx,
555 const struct cper_sec_proc_ia *proc);
554 556
555#endif 557#endif