Skip to contentSkip to conversation

CCIX Protocol error reporting.

PATCH Superseded Jonathan Cameron 2 participants 12 messages Nov 12, 2019 – Nov 13, 2019

Subsystems (5)
ACPI EFI EDAC-core ACPI APEI +1 more subsystems

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover CCIX Protocol error reporting.

Changes since V2:

Dropped the legal boiler plate from the cover letter. The CCIX consortium have agreed that a simple tradmark statement is sufficient which I have put in the cper-ccix.c file and here.

The CCIX® trademark and CCIX trade name are owned solely by CCIX CONSORTIUM, INC. and all rights are reserved therein.

Changes since V1:

Addressed comments from James Morse
- Dropped kernel logging of vendor data. We just push it to the tracepoints.
- Tidied up this cover letter and added information to address questions raised. Includes removing questions where James and I agreed ;)

Note, this initial series attempts no 'handling' of errors. That will follow later.

EFI 2.8 defines a new CPER record Appendix N for CCIX Protocol Error Records (PER). www.uefi.org

These include Protocol Error Record logs which are defined in the CCIX 1.0 Base Specification www.ccixconsortium.com. A public evaluation version is now available.

Handling of coherency protocol errors is complex and how Linux does this will take some time to evolve. For now, fatal errors are handled via the usual means and everything else is reported.

There are 6 types of error defined, covering:
* Memory errors
* Cache errors
* Address translation unit errors
* CCIX port errors
* CCIX link errors
* Agent internal errors.

These errors are concerned (mostly) wth things happening in the CCIX protocol layer. They are parallel to AER errors which should be only concerned with the PCIe layer (which is underneath CCIX). The ATS errors break this rule slightly. You may get an error occurring that results in problems at both layers of the protocol stack and hence have to handle AER and PER errors simultaneously.

Some of these errors can 'almost' be mapped onto standard existing error types but only at the loss of information specific to CCIX such as where in the topology they occurred.

The set includes tracepoints to report the errors to RAS Daemon and a patch set for RAS Daemon will follow shortly.

Several design decisions that people may disagree with.
1. Reporting of vendor data. We have little choice but to do this via a dynamic array as these blocks can take arbitrary size. I had hoped no one would actually use these given the odd mismatch between a standard error structure and non standard element, but there are already designs out there that do use it. James suggested that it made sense to put these in the tracepoints, but we shouldn't spam the kernel log with them (done in V2).
2. The trade off between explicit tracepoint fields, on which we might want to filter in kernel, and the simplicity of a blob.
I have gone for having the whole of the block specific to the PER error type in an opaque blob.
The key elements that may be filtered on are the physical address and the source and component fields which allow you to identify faulty devices. Note that you have to know how the devices were enumerated to be able to do so.
3. Defined 6 new tracepoints rather than cramming everything into one.
* They are all defined by the CCIX specification as independent error classes.
* Many of them can only be generated by particular types of agent.
* The handling required will vary widely depending on types. In the kernel some map cleanly onto existing handling. Keeping the whole flow separate will aide this. They vary by a similar amount in scope to the RAS errors found on an existing system which have independent tracepoints.
* Separating them out allows for filtering on the tracepoints by elements that are not shared between them.
* Muxing the lot into one record type can lead to ugly code both in kernel and in userspace.

Rasdaemon patches posted.
https://patchwork.kernel.org/cover/11116735/

Jonathan Cameron (6):
efi / ras: CCIX Memory error reporting
efi / ras: CCIX Cache error reporting
efi / ras: CCIX Address Translation Cache error reporting efi / ras: CCIX Port error reporting
efi / ras: CCIX Link error reporting
efi / ras: CCIX Agent internal error reporting

 drivers/acpi/apei/Kconfig        |   8 +
 drivers/acpi/apei/ghes.c         |  59 ++
 drivers/firmware/efi/Kconfig     |   5 +
 drivers/firmware/efi/Makefile    |   1 +
 drivers/firmware/efi/cper-ccix.c | 919 +++++++++++++++++++++++++++++++
 drivers/firmware/efi/cper.c      |   6 +
 include/linux/cper.h             | 333 +++++++++++
 include/ras/ras_event.h          | 405 ++++++++++++++
 8 files changed, 1736 insertions(+)
 create mode 100644 drivers/firmware/efi/cper-ccix.c
Signature · 1 line
2.20.1
#1 lore raw

PATCH v3 1/6 efi / ras: CCIX Memory error reporting

CCIX defines a number of different error types
(See CCIX spec 1.0) and UEFI 2.8 defines a CPER record to allow for them to be reported when firmware first handling is in use. The last part of that record is a copy of the CCIX protocol error record which can provide very detailed information.

This patch introduces infrastructure and support for one of those error types, CCIX Memory Errors. Later patches will supply equivalent support for the other error types.

The variable length and content of the different messages makes a single tracepoint impractical. As such the current RAS tracepoint only covers the memory error. Additional trace points will be introduced for other error types along with their cper handling in a follow up series.

RAS daemon support to follow shortly. qemu injection patches also available but not currently planing to upstream those.

---
 drivers/acpi/apei/Kconfig        |   8 +
 drivers/acpi/apei/ghes.c         |  39 ++++
 drivers/firmware/efi/Kconfig     |   5 +
 drivers/firmware/efi/Makefile    |   1 +
 drivers/firmware/efi/cper-ccix.c | 359 +++++++++++++++++++++++++++++++
 drivers/firmware/efi/cper.c      |   6 +
 include/linux/cper.h             | 118 ++++++++++
 include/ras/ras_event.h          |  77 +++++++
 8 files changed, 613 insertions(+)
drivers/acpi/apei/Kconfig +8 -0
index 6b18f8bc7be3..e687b18dee34 100644
@@ -68,3 +68,11 @@ config ACPI_APEI_ERST_DEBUG
 	  error information to and from a persistent store. Enable this
 	  if you want to debugging and testing the ERST kernel support
 	  and firmware implementation.
+
+config ACPI_APEI_CCIX
+       bool "APEI CCIX error recovery support"
+       depends on ACPI_APEI && MEMORY_FAILURE
+       help
+	 CCIX has a number of defined error types. This option enables
+	 the handling of CPER records generated by a firmware performing
+	 firmware first error handling of these CCIX errors.
drivers/acpi/apei/ghes.c +39 -0
index 777f6f7122b4..75a177ae9de3 100644
@@ -490,6 +490,42 @@ static void ghes_handle_aer(struct acpi_hest_generic_data *gdata)
 #endif
 }
 
+static void ghes_handle_ccix_per(struct acpi_hest_generic_data *gdata, int sev)
+{
+#ifdef CONFIG_ACPI_APEI_CCIX
+	struct cper_sec_ccix_header *header = acpi_hest_get_payload(gdata);
+	__u32 *dw;
+	enum ccix_per_type per_type;
+	static u32 err_seq;
+	void *payload;
+
+	/* Check if space for CCIX CPER header and 8 DW of a PER log header */
+	if (gdata->error_data_length <
+	    sizeof(*header) + CCIX_PER_LOG_HEADER_DWS * sizeof(__u32))
+		return;
+
+	if ((header->validation_bits & CPER_CCIX_VALID_PER_LOG) == 0)
+		return;
+
+	dw = (__u32 *)(header + 1);
+
+	per_type = FIELD_GET(CCIX_PER_LOG_DW1_PER_TYPE_M, dw[1]);
+	payload = acpi_hest_get_payload(gdata);
+
+	switch (per_type) {
+	case CCIX_MEMORY_ERROR:
+		trace_ccix_memory_error_event(payload, err_seq, sev,
+					      ccix_mem_err_ven_len_get(payload));
+		break;
+	default:
+		/* Unknown error type */
+		pr_info("CCIX error of unknown or vendor defined type\n");
+		break;
+	}
+	err_seq++;
+#endif
+}
+
 static void ghes_do_proc(struct ghes *ghes,
 			 const struct acpi_hest_generic_status *estatus)
 {
@@ -520,6 +556,9 @@ static void ghes_do_proc(struct ghes *ghes,
 		else if (guid_equal(sec_type, &CPER_SEC_PCIE)) {
 			ghes_handle_aer(gdata);
 		}
+		else if (guid_equal(sec_type, &CPER_SEC_CCIX)) {
+			ghes_handle_ccix_per(gdata, estatus->error_severity);
+		}
 		else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) {
 			struct cper_sec_proc_arm *err = acpi_hest_get_payload(gdata);
 
drivers/firmware/efi/Kconfig +5 -0
index b248870a9806..096e693a9522 100644
@@ -209,6 +209,11 @@ config UEFI_CPER_X86
 	depends on UEFI_CPER && X86
 	default y
 
+config UEFI_CPER_CCIX
+       bool
+       depends on UEFI_CPER
+       default y
+
 config EFI_DEV_PATH_PARSER
 	bool
 	depends on ACPI
drivers/firmware/efi/Makefile +1 -0
index 4ac2de4dfa72..9a52c7d01e94 100644
@@ -34,3 +34,4 @@ obj-$(CONFIG_EFI_CAPSULE_LOADER)	+= capsule-loader.o
 obj-$(CONFIG_EFI_EARLYCON)		+= earlycon.o
 obj-$(CONFIG_UEFI_CPER_ARM)		+= cper-arm.o
 obj-$(CONFIG_UEFI_CPER_X86)		+= cper-x86.o
+obj-$(CONFIG_UEFI_CPER_CCIX)		+= cper-ccix.o
drivers/firmware/efi/cper-ccix.c new file +359 -0

359 lines not on this page · raw message

drivers/firmware/efi/cper.c +6 -0
index b1af0de2e100..03bb27db2e87 100644
@@ -474,6 +474,12 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata
 			cper_print_pcie(newpfx, pcie, gdata);
 		else
 			goto err_section_too_small;
+	} else if (guid_equal(sec_type, &CPER_SEC_CCIX)) {
+		int ret;
+		/* CCIX CPER entries are variable length */
+		ret = cper_print_ccix_per(newpfx, gdata);
+		if (ret)
+			goto err_section_too_small;
 #if defined(CONFIG_ARM64) || defined(CONFIG_ARM)
 	} else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) {
 		struct cper_sec_proc_arm *arm_err = acpi_hest_get_payload(gdata);
include/linux/cper.h +118 -0

142 lines not on this page · raw message

include/ras/ras_event.h +77 -0

89 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw

Re: [PATCH v3 1/6] efi / ras: CCIX Memory error reporting

I love your patch! Yet something to improve:

Hi Jonathan,

I love your patch! Yet something to improve:

[auto build test ERROR on efi/next]
[cannot apply to v5.4-rc7 next-20191112]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/efi-ras-CCIX-Memory-error-reporting/20191113-133322
base:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

ld: drivers/ras/ras.o: in function `perf_trace_ccix_memory_error_event':

>> ras.c:(.text+0x794): undefined reference to `cper_ccix_mem_err_pack'
   ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_memory_error_event':
>> ras.c:(.text+0x83d): undefined reference to `cper_ccix_mem_err_unpack'
>> ld: ras.c:(.text+0x863): undefined reference to `cper_ccix_comp_type_str'
>> ld: ras.c:(.text+0x86f): undefined reference to `cper_severity_str'

ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_memory_error_event':
ras.c:(.text+0x10e9): undefined reference to `cper_ccix_mem_err_pack'

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

#3 lore raw

Re: [PATCH v3 1/6] efi / ras: CCIX Memory error reporting

In reply to Jonathan Cameron
I love your patch! Yet something to improve:

Hi Jonathan,

I love your patch! Yet something to improve:

[auto build test ERROR on efi/next]
[cannot apply to v5.4-rc7 next-20191112]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/efi-ras-CCIX-Memory-error-reporting/20191113-133322
base:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
config: x86_64-randconfig-a004-201945 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

ld: drivers/ras/ras.o: in function `perf_trace_ccix_memory_error_event':

>> include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_pack'
   ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_memory_error_event':
>> include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_pack'
   ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_memory_error_event':
>> include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_unpack'
>> ld: include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_comp_type_str'
>> ld: include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_severity_str'

vim +352 include/trace/../../include/ras/ras_event.h

341
342 /*
343 * CCIX PER log memory error trace event
344 *
345 * These events are generated when hardware detects a corrected or
346 * uncorrected event.
347 *
348 * Some elements of the record are not included
349 * - PER version (tracepoint should remain compatible across versions)
350 * - Multiple Error
351 */

 > 352	TRACE_EVENT(ccix_memory_error_event,
   353		TP_PROTO(struct cper_ccix_mem_error *mem,
   354			 u32 err_seq,
   355			 u8 sev,
   356			 u16 ven_len),
   357	
   358		TP_ARGS(mem, err_seq, sev, ven_len),
   359	
   360		TP_STRUCT__entry(
   361			__field(u32, err_seq)
   362			__field(u8, sev)
   363			__field(u8, sevdetail)
   364			__field(u8, source)
   365			__field(u8, component)
   366			__field(u64, pa)
   367			__field(u8, pa_mask_lsb)
   368			__field_struct(struct cper_ccix_mem_err_compact, data)
   369			__field(u16, vendor_data_length)
   370			__dynamic_array(u8, vendor_data, ven_len)
   371		),
   372	
   373		TP_fast_assign(
   374			__entry->err_seq = err_seq;
   375			__entry->sev = sev;
   376			__entry->sevdetail =
   377				FIELD_GET(CCIX_PER_LOG_DW1_SEV_UE_M |
   378					  CCIX_PER_LOG_DW1_SEV_NO_COMM_M |
   379					  CCIX_PER_LOG_DW1_SEV_DEGRADED_M |
   380					  CCIX_PER_LOG_DW1_SEV_DEFFERABLE_M,
   381							   mem->ccix_header[1]);
   382			if (mem->header.validation_bits & 0x1)
   383				__entry->source = mem->header.source_id;
   384			else
   385				__entry->source = ~0;
   386			__entry->component = FIELD_GET(CCIX_PER_LOG_DW1_COMP_TYPE_M,
   387						       mem->ccix_header[1]);
   388			if (mem->ccix_header[1] & CCIX_PER_LOG_DW1_ADDR_VAL_M) {
   389				__entry->pa = (u64)mem->ccix_header[2] << 32 |
   390					(mem->ccix_header[3] & 0xfffffffc);
   391				__entry->pa_mask_lsb = mem->ccix_header[4] & 0xff;
   392			} else {
   393				__entry->pa = ~0ull;
   394				__entry->pa_mask_lsb = ~0;
   395			}
   396			__entry->vendor_data_length = ven_len ? ven_len - 4 : 0;
   397			cper_ccix_mem_err_pack(&mem->mem_record, &__entry->data,
   398					       __entry->vendor_data_length,
   399					       __get_dynamic_array(vendor_data));
   400		),
   401	
   402		TP_printk("{%d} %s CCIX PER Memory Error in %s SevUE:%d SevNoComm:%d SevDegraded:%d SevDeferred:%d physical addr: %016llx (mask: %x) %s vendor:%s",
   403			__entry->err_seq,
   404			cper_severity_str(__entry->sev),
   405			cper_ccix_comp_type_str(__entry->component),
   406			  __entry->sevdetail & BIT(0) ? 1 : 0,
   407			  __entry->sevdetail & BIT(1) ? 1 : 0,
   408			  __entry->sevdetail & BIT(2) ? 1 : 0,
   409			  __entry->sevdetail & BIT(3) ? 1 : 0,

410 __entry->pa,
411 __entry->pa_mask_lsb,
412 cper_ccix_mem_err_unpack(p, &__entry->data),
413 __print_hex(__get_dynamic_array(vendor_data),
414 __entry->vendor_data_length)
415 )
416 );
417

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

#4 lore raw

PATCH v3 2/6 efi / ras: CCIX Cache error reporting

In reply to Jonathan Cameron

As CCIX Request Agents have fully cache coherent caches, the CCIX 1.0 Base Specification defines detailed error reporting for these caches.

A CCIX cache error is reported via a CPER record as defined in the UEFI 2.8 specification. The PER log section is defined in the CCIX 1.0 Base Specification.

---
 drivers/acpi/apei/ghes.c         |   4 +
 drivers/firmware/efi/cper-ccix.c | 170 +++++++++++++++++++++++++++++++
 include/linux/cper.h             |  57 +++++++++++
 include/ras/ras_event.h          |  66 ++++++++++++
 4 files changed, 297 insertions(+)
drivers/acpi/apei/ghes.c +4 -0
index 75a177ae9de3..c99a4216b67d 100644
@@ -517,6 +517,10 @@ static void ghes_handle_ccix_per(struct acpi_hest_generic_data *gdata, int sev)
 		trace_ccix_memory_error_event(payload, err_seq, sev,
 					      ccix_mem_err_ven_len_get(payload));
 		break;
+	case CCIX_CACHE_ERROR:
+		trace_ccix_cache_error_event(payload, err_seq, sev,
+					     ccix_cache_err_ven_len_get(payload));
+		break;
 	default:
 		/* Unknown error type */
 		pr_info("CCIX error of unknown or vendor defined type\n");
drivers/firmware/efi/cper-ccix.c +170 -0

185 lines not on this page · raw message

include/linux/cper.h +57 -0

69 lines not on this page · raw message

include/ras/ras_event.h +66 -0

72 lines not on this page · raw message

Signature · 1 line
2.20.1
#5 lore raw

Re: [PATCH v3 2/6] efi / ras: CCIX Cache error reporting

I love your patch! Yet something to improve:

Hi Jonathan,

I love your patch! Yet something to improve:

[auto build test ERROR on efi/next]
[cannot apply to v5.4-rc7 next-20191112]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/efi-ras-CCIX-Memory-error-reporting/20191113-133322
base:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
config: x86_64-randconfig-a004-201945 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

ld: drivers/ras/ras.o: in function `perf_trace_ccix_memory_error_event':
include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_pack'
ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_memory_error_event':
include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_pack'
ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_memory_error_event':
include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_unpack'
ld: include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_comp_type_str'
ld: include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_severity_str'
ld: drivers/ras/ras.o: in function `perf_trace_ccix_cache_error_event':

>> include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_ccix_cache_err_pack'
   ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_cache_error_event':
>> include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_ccix_cache_err_unpack'
   ld: include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_ccix_comp_type_str'
   ld: include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_severity_str'
   ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_cache_error_event':
>> include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_ccix_cache_err_pack'

vim +418 include/trace/../../include/ras/ras_event.h

341
342 /*
343 * CCIX PER log memory error trace event
344 *
345 * These events are generated when hardware detects a corrected or
346 * uncorrected event.
347 *
348 * Some elements of the record are not included
349 * - PER version (tracepoint should remain compatible across versions)
350 * - Multiple Error
351 */

 > 352	TRACE_EVENT(ccix_memory_error_event,
   353		TP_PROTO(struct cper_ccix_mem_error *mem,
   354			 u32 err_seq,
   355			 u8 sev,
   356			 u16 ven_len),
   357	
   358		TP_ARGS(mem, err_seq, sev, ven_len),
   359	
   360		TP_STRUCT__entry(
   361			__field(u32, err_seq)
   362			__field(u8, sev)
   363			__field(u8, sevdetail)
   364			__field(u8, source)
   365			__field(u8, component)
   366			__field(u64, pa)
   367			__field(u8, pa_mask_lsb)
   368			__field_struct(struct cper_ccix_mem_err_compact, data)
   369			__field(u16, vendor_data_length)
   370			__dynamic_array(u8, vendor_data, ven_len)
   371		),
   372	
   373		TP_fast_assign(
   374			__entry->err_seq = err_seq;
   375			__entry->sev = sev;
   376			__entry->sevdetail =
   377				FIELD_GET(CCIX_PER_LOG_DW1_SEV_UE_M |
   378					  CCIX_PER_LOG_DW1_SEV_NO_COMM_M |
   379					  CCIX_PER_LOG_DW1_SEV_DEGRADED_M |
   380					  CCIX_PER_LOG_DW1_SEV_DEFFERABLE_M,
   381							   mem->ccix_header[1]);
   382			if (mem->header.validation_bits & 0x1)
   383				__entry->source = mem->header.source_id;
   384			else
   385				__entry->source = ~0;
   386			__entry->component = FIELD_GET(CCIX_PER_LOG_DW1_COMP_TYPE_M,
   387						       mem->ccix_header[1]);
   388			if (mem->ccix_header[1] & CCIX_PER_LOG_DW1_ADDR_VAL_M) {
   389				__entry->pa = (u64)mem->ccix_header[2] << 32 |
   390					(mem->ccix_header[3] & 0xfffffffc);
   391				__entry->pa_mask_lsb = mem->ccix_header[4] & 0xff;
   392			} else {
   393				__entry->pa = ~0ull;
   394				__entry->pa_mask_lsb = ~0;
   395			}
   396			__entry->vendor_data_length = ven_len ? ven_len - 4 : 0;
   397			cper_ccix_mem_err_pack(&mem->mem_record, &__entry->data,
   398					       __entry->vendor_data_length,
   399					       __get_dynamic_array(vendor_data));
   400		),
   401	
   402		TP_printk("{%d} %s CCIX PER Memory Error in %s SevUE:%d SevNoComm:%d SevDegraded:%d SevDeferred:%d physical addr: %016llx (mask: %x) %s vendor:%s",
   403			__entry->err_seq,
   404			cper_severity_str(__entry->sev),
   405			cper_ccix_comp_type_str(__entry->component),
   406			  __entry->sevdetail & BIT(0) ? 1 : 0,
   407			  __entry->sevdetail & BIT(1) ? 1 : 0,
   408			  __entry->sevdetail & BIT(2) ? 1 : 0,
   409			  __entry->sevdetail & BIT(3) ? 1 : 0,
   410			__entry->pa,
   411			__entry->pa_mask_lsb,
   412			cper_ccix_mem_err_unpack(p, &__entry->data),
   413			__print_hex(__get_dynamic_array(vendor_data),
   414				    __entry->vendor_data_length)
   415		)
   416	);
   417	
 > 418	TRACE_EVENT(ccix_cache_error_event,

419 TP_PROTO(struct cper_ccix_cache_error *err,
420 u32 err_seq,
421 u8 sev,
422 u16 ven_len),
423
424 TP_ARGS(err, err_seq, sev, ven_len),
425
426 TP_STRUCT__entry(
427 __field(u32, err_seq)
428 __field(u8, sev)
429 __field(u8, sevdetail)
430 __field(u8, source)
431 __field(u8, component)
432 __field(u64, pa)
433 __field(u8, pa_mask_lsb)
434 __field_struct(struct cper_ccix_cache_err_compact, data)
435 __field(u16, vendor_data_length)
436 __dynamic_array(u8, vendor_data, ven_len)
437 ),
438
439 TP_fast_assign(
440 __entry->err_seq = err_seq;
441
442 __entry->sev = sev;
443 __entry->sevdetail = FIELD_GET(CCIX_PER_LOG_DW1_SEV_UE_M |
444 CCIX_PER_LOG_DW1_SEV_NO_COMM_M |
445 CCIX_PER_LOG_DW1_SEV_DEGRADED_M |
446 CCIX_PER_LOG_DW1_SEV_DEFFERABLE_M,
447 err->ccix_header[1]);
448 if (err->header.validation_bits & 0x1)
449 __entry->source = err->header.source_id;
450 else
451 __entry->source = ~0;
452 __entry->component = FIELD_GET(CCIX_PER_LOG_DW1_COMP_TYPE_M,
453 err->ccix_header[1]);
454 if (err->ccix_header[1] & CCIX_PER_LOG_DW1_ADDR_VAL_M) {
455 __entry->pa = (u64)err->ccix_header[2] << 32 |
456 (err->ccix_header[3] & 0xfffffffc);
457 __entry->pa_mask_lsb = err->ccix_header[4] & 0xff;
458 } else {
459 __entry->pa = ~0ull;
460 __entry->pa_mask_lsb = ~0;
461 }
462
463 __entry->vendor_data_length = ven_len ? ven_len - 4 : 0;
464 cper_ccix_cache_err_pack(&err->cache_record, &__entry->data,
465 __entry->vendor_data_length,
466 __get_dynamic_array(vendor_data));
467 ),
468
469 TP_printk("{%d} %s CCIX PER Cache Error in %s SevUE:%d SevNoComm:%d SevDegraded:%d SevDeferred:%d physical addr: %016llx (mask: %x) %s vendor:%s",
470 __entry->err_seq,
471 cper_severity_str(__entry->sev),
472 cper_ccix_comp_type_str(__entry->component),
473 __entry->sevdetail & BIT(0) ? 1 : 0,
474 __entry->sevdetail & BIT(1) ? 1 : 0,
475 __entry->sevdetail & BIT(2) ? 1 : 0,
476 __entry->sevdetail & BIT(3) ? 1 : 0,
477 __entry->pa,
478 __entry->pa_mask_lsb,
479 cper_ccix_cache_err_unpack(p, &__entry->data),
480 __print_hex(__get_dynamic_array(vendor_data),
481 __entry->vendor_data_length)
482 )
483 );
484 /*
485 * memory-failure recovery action result event
486 *
487 * unsigned long pfn - Page Frame Number of the corrupted page
488 * int type - Page types of the corrupted page
489 * int result - Result of recovery action
490 */
491

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

#6 lore raw

Re: [PATCH v3 2/6] efi / ras: CCIX Cache error reporting

In reply to Jonathan Cameron
I love your patch! Yet something to improve:

Hi Jonathan,

I love your patch! Yet something to improve:

[auto build test ERROR on efi/next]
[also build test ERROR on v5.4-rc7 next-20191112]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/efi-ras-CCIX-Memory-error-reporting/20191113-133322
base:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
config: i386-defconfig (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

ld: drivers/ras/ras.o: in function `perf_trace_ccix_memory_error_event':
ras.c:(.text+0x794): undefined reference to `cper_ccix_mem_err_pack'
ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_memory_error_event':
ras.c:(.text+0x83d): undefined reference to `cper_ccix_mem_err_unpack'
ld: ras.c:(.text+0x863): undefined reference to `cper_ccix_comp_type_str'
ld: ras.c:(.text+0x86f): undefined reference to `cper_severity_str'
ld: drivers/ras/ras.o: in function `perf_trace_ccix_cache_error_event':

>> ras.c:(.text+0x9f4): undefined reference to `cper_ccix_cache_err_pack'
   ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_cache_error_event':
>> ras.c:(.text+0xa9d): undefined reference to `cper_ccix_cache_err_unpack'

ld: ras.c:(.text+0xac3): undefined reference to `cper_ccix_comp_type_str'
ld: ras.c:(.text+0xacf): undefined reference to `cper_severity_str'
ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_memory_error_event':
ras.c:(.text+0x1349): undefined reference to `cper_ccix_mem_err_pack'
ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_cache_error_event':
ras.c:(.text+0x14b9): undefined reference to `cper_ccix_cache_err_pack'

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

#7 lore raw

PATCH v3 3/6 efi / ras: CCIX Address Translation Cache error reporting

In reply to Jonathan Cameron

CCIX devices tend to make heavy use of ATCs. The CCIX base specification defines a protocol error message (PER) that describes errors reported by such caches. The UEFI 2.8 specification includes a CCIX CPER record for firmware first handling to report these errors to the operating system.

This patch is very similar to the support previously added for CCIX Memory Errors and provides both logging and RAS tracepoint for this error class.

---
 drivers/acpi/apei/ghes.c         |  4 ++
 drivers/firmware/efi/cper-ccix.c | 84 ++++++++++++++++++++++++++++++++
 include/linux/cper.h             | 39 +++++++++++++++
 include/ras/ras_event.h          | 67 +++++++++++++++++++++++++
 4 files changed, 194 insertions(+)
drivers/acpi/apei/ghes.c +4 -0
index c99a4216b67d..ba73d3a5d564 100644
@@ -521,6 +521,10 @@ static void ghes_handle_ccix_per(struct acpi_hest_generic_data *gdata, int sev)
 		trace_ccix_cache_error_event(payload, err_seq, sev,
 					     ccix_cache_err_ven_len_get(payload));
 		break;
+	case CCIX_ATC_ERROR:
+		trace_ccix_atc_error_event(payload, err_seq, sev,
+					   ccix_atc_err_ven_len_get(payload));
+		break;
 	default:
 		/* Unknown error type */
 		pr_info("CCIX error of unknown or vendor defined type\n");
drivers/firmware/efi/cper-ccix.c +84 -0

99 lines not on this page · raw message

include/linux/cper.h +39 -0
index eef254b8b8b7..6bb603e9a97a 100644
@@ -675,6 +675,38 @@ struct cper_ccix_cache_err_compact {
 	__u8	instance;
 };
 
+struct cper_sec_ccix_atc_error {
+	__u32	validation_bits;
+#define CCIX_ATC_ERR_OP_VALID			BIT(0)
+#define CCIX_ATC_ERR_INSTANCE_ID_VALID		BIT(1)
+#define CCIX_ATC_ERR_VENDOR_DATA_VALID		BIT(2)
+	__u16	length; /* Includes vendor specific log info */
+	__u8	op_type;
+	__u8	instance;
+	__u32	reserved;
+	__u32	vendor_data[];
+};
+
+struct cper_ccix_atc_error {
+	struct cper_sec_ccix_header header;
+	__u32 ccix_header[CCIX_PER_LOG_HEADER_DWS];
+	struct cper_sec_ccix_atc_error atc_record;
+};
+
+static inline u16 ccix_atc_err_ven_len_get(struct cper_ccix_atc_error *atc_err)
+{
+	if (atc_err->atc_record.validation_bits & CCIX_ATC_ERR_VENDOR_DATA_VALID)
+		return atc_err->atc_record.vendor_data[0] & 0xFFFF;
+	else
+		return 0;
+}
+
+struct cper_ccix_atc_err_compact {
+	__u32	validation_bits;
+	__u8	op_type;
+	__u8	instance;
+};
+
 /* Reset to default packing */
 #pragma pack()
 
@@ -706,6 +738,13 @@ const char *cper_ccix_cache_err_unpack(struct trace_seq *p,
 				       struct cper_ccix_cache_err_compact *ccache_err);
 const char *cper_ccix_cache_err_type_str(__u8 error_type);
 
+void cper_ccix_atc_err_pack(const struct cper_sec_ccix_atc_error *atc_record,
+			    struct cper_ccix_atc_err_compact *catc_err,
+			    const u16 vendor_data_len,
+			    u8 *vendor_data);
+const char *cper_ccix_atc_err_unpack(struct trace_seq *p,
+				     struct cper_ccix_atc_err_compact *catc_err);
+
 struct acpi_hest_generic_data;
 int cper_print_ccix_per(const char *pfx,
 			struct acpi_hest_generic_data *gdata);
include/ras/ras_event.h +67 -0

73 lines not on this page · raw message

Signature · 1 line
2.20.1
#8 lore raw

Re: [PATCH v3 3/6] efi / ras: CCIX Address Translation Cache error reporting

I love your patch! Yet something to improve:

Hi Jonathan,

I love your patch! Yet something to improve:

[auto build test ERROR on efi/next]
[cannot apply to v5.4-rc7 next-20191112]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Jonathan-Cameron/efi-ras-CCIX-Memory-error-reporting/20191113-133322
base:   https://git.kernel.org/pub/scm/linux/kernel/git/efi/efi.git next
config: x86_64-randconfig-a004-201945 (attached as .config)
compiler: gcc-7 (Debian 7.4.0-14) 7.4.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

ld: drivers/ras/ras.o: in function `perf_trace_ccix_memory_error_event':
include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_pack'
ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_memory_error_event':
include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_unpack'
ld: include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_comp_type_str'
ld: include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_severity_str'
ld: drivers/ras/ras.o: in function `perf_trace_ccix_cache_error_event':
include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_ccix_cache_err_pack'
ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_cache_error_event':
include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_ccix_cache_err_pack'
ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_cache_error_event':
include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_ccix_cache_err_unpack'
ld: include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_ccix_comp_type_str'
ld: include/trace/../../include/ras/ras_event.h:418: undefined reference to `cper_severity_str'
ld: drivers/ras/ras.o: in function `perf_trace_ccix_atc_error_event':

>> include/trace/../../include/ras/ras_event.h:485: undefined reference to `cper_ccix_atc_err_pack'
   ld: drivers/ras/ras.o: in function `trace_raw_output_ccix_atc_error_event':
>> include/trace/../../include/ras/ras_event.h:485: undefined reference to `cper_ccix_atc_err_unpack'
   ld: include/trace/../../include/ras/ras_event.h:485: undefined reference to `cper_ccix_comp_type_str'
   ld: include/trace/../../include/ras/ras_event.h:485: undefined reference to `cper_severity_str'
   ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_atc_error_event':
>> include/trace/../../include/ras/ras_event.h:485: undefined reference to `cper_ccix_atc_err_pack'

ld: drivers/ras/ras.o: in function `trace_event_raw_event_ccix_memory_error_event':
include/trace/../../include/ras/ras_event.h:352: undefined reference to `cper_ccix_mem_err_pack'

vim +485 include/trace/../../include/ras/ras_event.h

417

 > 418	TRACE_EVENT(ccix_cache_error_event,
   419		TP_PROTO(struct cper_ccix_cache_error *err,
   420			 u32 err_seq,
   421			 u8 sev,
   422			 u16 ven_len),
   423	
   424		TP_ARGS(err, err_seq, sev, ven_len),
   425	
   426		TP_STRUCT__entry(
   427			__field(u32, err_seq)
   428			__field(u8, sev)
   429			__field(u8, sevdetail)
   430			__field(u8, source)
   431			__field(u8, component)
   432			__field(u64, pa)
   433			__field(u8, pa_mask_lsb)
   434			__field_struct(struct cper_ccix_cache_err_compact, data)
   435			__field(u16, vendor_data_length)
   436			__dynamic_array(u8, vendor_data, ven_len)
   437		),
   438	
   439		TP_fast_assign(
   440			__entry->err_seq = err_seq;
   441	
   442			__entry->sev = sev;
   443			__entry->sevdetail = FIELD_GET(CCIX_PER_LOG_DW1_SEV_UE_M |
   444				CCIX_PER_LOG_DW1_SEV_NO_COMM_M |
   445				CCIX_PER_LOG_DW1_SEV_DEGRADED_M |
   446				CCIX_PER_LOG_DW1_SEV_DEFFERABLE_M,
   447				err->ccix_header[1]);
   448			if (err->header.validation_bits & 0x1)
   449				__entry->source = err->header.source_id;
   450			else
   451				__entry->source = ~0;
   452			__entry->component = FIELD_GET(CCIX_PER_LOG_DW1_COMP_TYPE_M,
   453						       err->ccix_header[1]);
   454			if (err->ccix_header[1] & CCIX_PER_LOG_DW1_ADDR_VAL_M) {
   455				__entry->pa = (u64)err->ccix_header[2] << 32 |
   456					(err->ccix_header[3] & 0xfffffffc);
   457				__entry->pa_mask_lsb = err->ccix_header[4] & 0xff;
   458			} else {
   459				__entry->pa = ~0ull;
   460				__entry->pa_mask_lsb = ~0;
   461			}
   462	
   463			__entry->vendor_data_length = ven_len ? ven_len - 4 : 0;
   464			cper_ccix_cache_err_pack(&err->cache_record, &__entry->data,
   465						 __entry->vendor_data_length,
   466						 __get_dynamic_array(vendor_data));
   467		),
   468	
   469		TP_printk("{%d} %s CCIX PER Cache Error in %s SevUE:%d SevNoComm:%d SevDegraded:%d SevDeferred:%d physical addr: %016llx (mask: %x) %s vendor:%s",
   470			__entry->err_seq,
   471			cper_severity_str(__entry->sev),
   472			cper_ccix_comp_type_str(__entry->component),
   473			__entry->sevdetail & BIT(0) ? 1 : 0,
   474			__entry->sevdetail & BIT(1) ? 1 : 0,
   475			__entry->sevdetail & BIT(2) ? 1 : 0,
   476			__entry->sevdetail & BIT(3) ? 1 : 0,
   477			__entry->pa,
   478			__entry->pa_mask_lsb,
   479			cper_ccix_cache_err_unpack(p, &__entry->data),
   480			__print_hex(__get_dynamic_array(vendor_data),
   481				    __entry->vendor_data_length)
   482		)
   483	);
   484	
 > 485	TRACE_EVENT(ccix_atc_error_event,

486 TP_PROTO(struct cper_ccix_atc_error *err,
487 u32 err_seq,
488 u8 sev,
489 u16 ven_len),
490
491 TP_ARGS(err, err_seq, sev, ven_len),
492
493 TP_STRUCT__entry(
494 __field(u32, err_seq)
495 __field(u8, sev)
496 __field(u8, sevdetail)
497 __field(u8, source)
498 __field(u8, component)
499 __field(u64, pa)
500 __field(u8, pa_mask_lsb)
501 __field_struct(struct cper_ccix_atc_err_compact, data)
502 __field(u16, vendor_data_length)
503 __dynamic_array(u8, vendor_data, ven_len)
504 ),
505
506 TP_fast_assign(
507 __entry->err_seq = err_seq;
508
509 __entry->sev = sev;
510 __entry->sevdetail = FIELD_GET(CCIX_PER_LOG_DW1_SEV_UE_M |
511 CCIX_PER_LOG_DW1_SEV_NO_COMM_M |
512 CCIX_PER_LOG_DW1_SEV_DEGRADED_M |
513 CCIX_PER_LOG_DW1_SEV_DEFFERABLE_M,
514 err->ccix_header[1]);
515 if (err->header.validation_bits & 0x1)
516 __entry->source = err->header.source_id;
517 else
518 __entry->source = ~0;
519 __entry->component = FIELD_GET(CCIX_PER_LOG_DW1_COMP_TYPE_M,
520 err->ccix_header[1]);
521 if (err->ccix_header[1] & CCIX_PER_LOG_DW1_ADDR_VAL_M) {
522 __entry->pa = (u64)err->ccix_header[2] << 32 |
523 (err->ccix_header[3] & 0xfffffffc);
524 __entry->pa_mask_lsb = err->ccix_header[4] & 0xff;
525 } else {
526 __entry->pa = ~0ull;
527 __entry->pa_mask_lsb = ~0;
528 }
529
530 __entry->vendor_data_length = ven_len ? ven_len - 4 : 0;
531 cper_ccix_atc_err_pack(&err->atc_record, &__entry->data,
532 __entry->vendor_data_length,
533 __get_dynamic_array(vendor_data));
534 ),
535
536 TP_printk("{%d} %s CCIX PER ATC Error in %s SevUE:%d SevNoComm:%d SevDegraded:%d SevDeferred:%d physical addr: %016llx (mask: %x) %s vendor:%s",
537 __entry->err_seq,
538 cper_severity_str(__entry->sev),
539 cper_ccix_comp_type_str(__entry->component),
540 __entry->sevdetail & BIT(0) ? 1 : 0,
541 __entry->sevdetail & BIT(1) ? 1 : 0,
542 __entry->sevdetail & BIT(2) ? 1 : 0,
543 __entry->sevdetail & BIT(3) ? 1 : 0,
544 __entry->pa,
545 __entry->pa_mask_lsb,
546 cper_ccix_atc_err_unpack(p, &__entry->data),
547 __print_hex(__get_dynamic_array(vendor_data), __entry->vendor_data_length)
548 )
549 );
550

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

#9 lore raw

PATCH v3 4/6 efi / ras: CCIX Port error reporting

In reply to Jonathan Cameron

The CCIX 1.0 base specification defines a CCIX protocol layer port. The specification provides a mechanism for detailed error logging for these ports. The UEFI 2.8 specification includes a CCIX CPER record for firmware first handling to report these errors to the operating system.

This patch is very similar to the support previously added for for CCIX Memory Errors and provides both logging and RAS tracepoint for this error class.

---
 drivers/acpi/apei/ghes.c         |   4 +
 drivers/firmware/efi/cper-ccix.c | 123 +++++++++++++++++++++++++++++++
 include/linux/cper.h             |  42 +++++++++++
 include/ras/ras_event.h          |  66 +++++++++++++++++
 4 files changed, 235 insertions(+)
drivers/acpi/apei/ghes.c +4 -0
index ba73d3a5d564..7455db97319c 100644
@@ -525,6 +525,10 @@ static void ghes_handle_ccix_per(struct acpi_hest_generic_data *gdata, int sev)
 		trace_ccix_atc_error_event(payload, err_seq, sev,
 					   ccix_atc_err_ven_len_get(payload));
 		break;
+	case CCIX_PORT_ERROR:
+		trace_ccix_port_error_event(payload, err_seq, sev,
+					    ccix_port_err_ven_len_get(payload));
+		break;
 	default:
 		/* Unknown error type */
 		pr_info("CCIX error of unknown or vendor defined type\n");
drivers/firmware/efi/cper-ccix.c +123 -0

138 lines not on this page · raw message

include/linux/cper.h +42 -0

54 lines not on this page · raw message

include/ras/ras_event.h +66 -0

72 lines not on this page · raw message

Signature · 1 line
2.20.1
#10 lore raw

PATCH v3 5/6 efi / ras: CCIX Link error reporting

In reply to Jonathan Cameron

The CCIX 1.0 Base Specification defines a protocol layer CCIX link and related error reporting mechanism. The UEFI 2.8 specification includes a CCIX CPER record for firmware first handling to report these errors to the operating system.

This patch is very similar to the support previously added for CCIX Memory Errors and provides both logging and RAS tracepoint for this error class.

---
 drivers/acpi/apei/ghes.c         |   4 +
 drivers/firmware/efi/cper-ccix.c | 140 +++++++++++++++++++++++++++++++
 include/linux/cper.h             |  48 +++++++++++
 include/ras/ras_event.h          |  65 ++++++++++++++
 4 files changed, 257 insertions(+)
drivers/acpi/apei/ghes.c +4 -0
index 7455db97319c..22df8c14ec13 100644
@@ -529,6 +529,10 @@ static void ghes_handle_ccix_per(struct acpi_hest_generic_data *gdata, int sev)
 		trace_ccix_port_error_event(payload, err_seq, sev,
 					    ccix_port_err_ven_len_get(payload));
 		break;
+	case CCIX_LINK_ERROR:
+		trace_ccix_link_error_event(payload, err_seq, sev,
+					    ccix_link_err_ven_len_get(payload));
+		break;
 	default:
 		/* Unknown error type */
 		pr_info("CCIX error of unknown or vendor defined type\n");
drivers/firmware/efi/cper-ccix.c +140 -0

155 lines not on this page · raw message

include/linux/cper.h +48 -0

60 lines not on this page · raw message

include/ras/ras_event.h +65 -0

71 lines not on this page · raw message

Signature · 1 line
2.20.1
#11 lore raw

PATCH v3 6/6 efi / ras: CCIX Agent internal error reporting

In reply to Jonathan Cameron

The CCIX 1.0 Base specification defines an internal agent error, for which the specific data present afte the header is vendor defined.

---
 drivers/acpi/apei/ghes.c         |  4 ++
 drivers/firmware/efi/cper-ccix.c | 43 +++++++++++++++++++++
 include/linux/cper.h             | 29 +++++++++++++++
 include/ras/ras_event.h          | 64 ++++++++++++++++++++++++++++++++
 4 files changed, 140 insertions(+)
drivers/acpi/apei/ghes.c +4 -0
index 22df8c14ec13..5a75fb0374dd 100644
@@ -533,6 +533,10 @@ static void ghes_handle_ccix_per(struct acpi_hest_generic_data *gdata, int sev)
 		trace_ccix_link_error_event(payload, err_seq, sev,
 					    ccix_link_err_ven_len_get(payload));
 		break;
+	case CCIX_AGENT_INTERNAL_ERROR:
+		trace_ccix_agent_error_event(payload, err_seq, sev,
+					     ccix_agent_err_ven_len_get(payload));
+		break;
 	default:
 		/* Unknown error type */
 		pr_info("CCIX error of unknown or vendor defined type\n");
drivers/firmware/efi/cper-ccix.c +43 -0

58 lines not on this page · raw message

include/linux/cper.h +29 -0
index d35be55351e3..373c1d387a70 100644
@@ -783,6 +783,30 @@ struct cper_ccix_link_err_compact {
 	__u8	credit_type;
 };
 
+struct cper_sec_ccix_agent_err {
+	__u32	validation_bits;
+#define CCIX_AGENT_INTERNAL_ERR_VENDOR_DATA_VALID	BIT(0)
+	__u32	vendor_data[];
+};
+
+struct cper_ccix_agent_err {
+	struct cper_sec_ccix_header header;
+	__u32 ccix_header[CCIX_PER_LOG_HEADER_DWS];
+	struct cper_sec_ccix_agent_err agent_record;
+};
+
+static inline u16 ccix_agent_err_ven_len_get(struct cper_ccix_agent_err *agent_err)
+{
+	if (agent_err->agent_record.validation_bits & CCIX_AGENT_INTERNAL_ERR_VENDOR_DATA_VALID)
+		return agent_err->agent_record.vendor_data[0] & 0xFFFF;
+	else
+		return 0;
+}
+
+struct cper_ccix_agent_err_compact {
+	__u32	validation_bits;
+};
+
 /* Reset to default packing */
 #pragma pack()
 
@@ -835,6 +859,11 @@ void cper_ccix_link_err_pack(const struct cper_sec_ccix_link_error *link_record,
 const char *cper_ccix_link_err_unpack(struct trace_seq *p,
 				      struct cper_ccix_link_err_compact *clink_err);
 
+void cper_ccix_agent_err_pack(const struct cper_sec_ccix_agent_err *agent_record,
+			      struct cper_ccix_agent_err_compact *cagent_err,
+			      const u16 vendor_data_len,
+			      u8 *vendor_data);
+
 struct acpi_hest_generic_data;
 int cper_print_ccix_per(const char *pfx,
 			struct acpi_hest_generic_data *gdata);
include/ras/ras_event.h +64 -0

70 lines not on this page · raw message

Signature · 1 line
2.20.1