Make ELOG and GHES log and trace consistently
Subsystems (6)
v6 cover Make ELOG and GHES log and trace consistently
When Firmware First is enabled, BIOS handles errors first and then it makes them available to the kernel via the Common Platform Error Record (CPER) sections (UEFI 2.10 Appendix N). Linux parses the CPER sections via one of two similar paths, either ELOG or GHES.
Currently, ELOG and GHES show some inconsistencies in how they print to the kernel log as well as in how they report to userspace via trace events.
Make the two mentioned paths act similarly for what relates to logging and tracing.
--- Changes for v6 ---
- Rename the helper that copies the CPER CXL protocol error information to work struct (Dave)
- Return -EOPNOTSUPP (instead of -EINVAL) from the two helpers if ACPI_APEI_PCIEAER is not defined (Dave)
--- Changes for v5 ---
- Add 3/6 to select ACPI_APEI_PCIEAER for GHES
- Add 4,5/6 to move common code between ELOG and GHES out to new helpers use them in 6/6 (Jonathan).
--- Changes for v4 ---
- Re-base on top of recent changes of the AER error logging and drop obsoleted 2/4 (Sathyanarayanan)
- Log with pr_warn_ratelimited() (Dave)
- Collect tags
--- Changes for v3 ---
1/4, 2/4:
- collect tags; no functional changes
3/4:
- Invert logic of checks (Yazen)
- Select CONFIG_ACPI_APEI_PCIEAER (Yazen)
4/4:
- Check serial number only for CXL devices (Yazen)
- Replace "invalid" with "unknown" in the output of a pr_err() (Yazen)
--- Changes for v2 ---
- Add a patch to pass log levels to pci_print_aer() (Dan)
- Add a patch to trace CPER CXL Protocol Errors
- Rework commit messages (Dan)
- Use log_non_standard_event() (Bjorn)
--- Changes for v1 ---
- Drop the RFC prefix and restart from PATCH v1
- Drop patch 3/3 because a discussion on it has not yet been settled
- Drop namespacing in export of pci_print_aer while() (Dan)
- Don't use '#ifdef' in *.c files (Dan)
- Drop a reference on pdev after operation is complete (Dan)
- Don't log an error message if pdev is NULL (Dan)
Fabio M. De Francesco (6):
ACPI: extlog: Trace CPER Non-standard Section Body
ACPI: extlog: Trace CPER PCI Express Error Section acpi/ghes: Make GHES select ACPI_APEI_PCIEAER
acpi/ghes: Add helper for CPER CXL protocol errors validity checks acpi/ghes: Add helper to copy CPER CXL protocol error information to
work struct
ACPI: extlog: Trace CPER CXL Protocol Error Section
drivers/acpi/Kconfig | 1 + drivers/acpi/acpi_extlog.c | 60 ++++++++++++++++++++++++++++++++++++ drivers/acpi/apei/Kconfig | 1 + drivers/acpi/apei/ghes.c | 62 +++++++++++++++++++++++++------------- drivers/cxl/core/ras.c | 6 ++++ drivers/pci/pcie/aer.c | 2 +- include/cxl/event.h | 22 ++++++++++++++ 7 files changed, 132 insertions(+), 22 deletions(-)
base-commit: 552c50713f273b494ac6c77052032a49bc9255e2
Signature · 1 line
2.51.0
PATCH v6 1/6 ACPI: extlog: Trace CPER Non-standard Section Body
ghes_do_proc() has a catch-all for unknown or unhandled CPER formats (UEFI v2.10 Appendix N 2.3), extlog_print() does not. This gap was noticed by a RAS test that injected CXL protocol errors which were notified to extlog_print() via the IOMCA (I/O Machine Check Architecture) mechanism. Bring parity to the extlog_print() path by including a similar log_non_standard_event().
--- drivers/acpi/acpi_extlog.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/acpi/acpi_extlog.c +6 -0
@@ -183,6 +183,12 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,if (gdata->error_data_length >=sizeof (*mem))trace_extlog_mem_event (mem, err_seq, fru_id, fru_text, (u8 )gdata->error_severity); + }else { +void *err =acpi_hest_get_payload (gdata); + +log_non_standard_event (sec_type, fru_id, fru_text, + gdata->error_severity, err, + gdata->error_data_length); } }
Signature · 1 line
2.51.0
Re: [PATCH 1/6 v6] ACPI: extlog: Trace CPER Non-standard Section Body
Quoted 2 lines · Fabio M. De Francesco
ghes_do_proc()has a catch-all for unknown or unhandled CPER formats (UEFI v2.10 Appendix N 2.3),extlog_print()does not. This gap was
Latest is v2.11, right? Why not use it for reference?
Quoted 5 lines
noticed by a RAS test that injected CXL protocol errors which were notified to
extlog_print()via the IOMCA (I/O Machine Check Architecture) mechanism. Bring parity to theextlog_print()path by including a similarlog_non_standard_event().
Quoted 7 lines
Cc Dan Williams <[email protected]>Reviewed-by Dan Williams <[email protected]>Reviewed-by Dave Jiang <[email protected]>Reviewed-by Jonathan Cameron <[email protected]>Reviewed-by Qiuxu Zhuo <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>---
Quoted 20 lines
drivers/acpi/acpi_extlog.c | 6 ++++++ 1 file changed, 6 insertions(+)drivers/acpi/acpi_extlog.c +6
-0@@ -183,6 +183,12 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,if (gdata->error_data_length >=sizeof (*mem))trace_extlog_mem_event (mem, err_seq, fru_id, fru_text, (u8 )gdata->error_severity); + }else { +void *err =acpi_hest_get_payload (gdata); + +log_non_standard_event (sec_type, fru_id, fru_text, + gdata->error_severity, err, + gdata->error_data_length); } }
Signature · 2 lines
Sathyanarayanan Kuppuswamy Linux Kernel Developer
PATCH v6 2/6 ACPI: extlog: Trace CPER PCI Express Error Section
In reply to Fabio M. De FrancescoI/O Machine Check Architecture events may signal failing PCIe components or links. The AER event contains details on what was happening on the wire when the error was signaled.
Trace the CPER PCIe Error section (UEFI v2.10, Appendix N.2.7) reported by the I/O MCA.
--- drivers/acpi/Kconfig | 1 + drivers/acpi/acpi_extlog.c | 32 ++++++++++++++++++++++++++++++++ drivers/pci/pcie/aer.c | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-)
drivers/acpi/Kconfig +1 -0
@@ -494,6 +494,7 @@ config ACPI_EXTLOG tristate "Extended Error Log support" depends on X86_MCE && X86_LOCAL_APIC && EDAC select UEFI_CPER + select ACPI_APEI_PCIEAER help Certain usages such as Predictive Failure Analysis (PFA) require more information about the error than what can be described in
drivers/acpi/acpi_extlog.c +32 -0
@@ -132,6 +132,34 @@ static int print_extlog_rcd(const char *pfx,return 1 ; } +static void extlog_print_pcie (struct cper_sec_pcie *pcie_err, +int severity) +{ +struct aer_capability_regs *aer; +struct pci_dev *pdev; +unsigned int devfn; +unsigned int bus; +int aer_severity; +int domain; + +if (!(pcie_err->validation_bits &CPER_PCIE_VALID_DEVICE_ID || + pcie_err->validation_bits &CPER_PCIE_VALID_AER_INFO )) +return ; + + aer_severity =cper_severity_to_aer (severity); + aer = (struct aer_capability_regs *)pcie_err->aer_info; + domain = pcie_err->device_id.segment; + bus = pcie_err->device_id.bus; + devfn =PCI_DEVFN (pcie_err->device_id.device, + pcie_err->device_id.function); + pdev =pci_get_domain_bus_and_slot (domain, bus, devfn); +if (!pdev) +return ; + +pci_print_aer (pdev, aer_severity, aer); +pci_dev_put (pdev); +} +static int extlog_print (struct notifier_block *nb,unsigned long val,void *data) {
@@ -183,6 +211,10 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,if (gdata->error_data_length >=sizeof (*mem))trace_extlog_mem_event (mem, err_seq, fru_id, fru_text, (u8 )gdata->error_severity); + }else if (guid_equal (sec_type, &CPER_SEC_PCIE )) { +struct cper_sec_pcie *pcie_err =acpi_hest_get_payload (gdata); + +extlog_print_pcie (pcie_err, gdata->error_severity); }else {void *err =acpi_hest_get_payload (gdata);
drivers/pci/pcie/aer.c +1 -1
@@ -971,7 +971,7 @@ void pci_print_aer(struct pci_dev *dev, int aer_severity,pcie_print_tlp_log (dev, &aer->header_log, info.level,dev_fmt (" " )); } -EXPORT_SYMBOL_NS_GPL (pci_print_aer,"CXL" ); +EXPORT_SYMBOL_GPL (pci_print_aer);/** * add_error_device - list device to be handled
Signature · 1 line
2.51.0
Re: [PATCH 2/6 v6] ACPI: extlog: Trace CPER PCI Express Error Section
Quoted 11 lines · On Thu, 23 Oct 2025 14:25:37 +0200 "Fabio M. De Francesco"…
I/O Machine Check Architecture events may signal failing PCIe components or links. The AER event contains details on what was happening on the wire when the error was signaled.
Trace the CPER PCIe Error section (UEFI v2.10, Appendix N.2.7) reported by the I/O MCA.
Cc Dan Williams <[email protected]>Reviewed-by Dave Jiang <[email protected]>Reviewed-by Jonathan Cameron <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>
Hi Fabio,
Was taking a fresh look at this as a precursor to looking at later patches in series and spotted something that I'm doubtful about.
Quoted 10 lines
drivers/acpi/acpi_extlog.c +2
-0@@ -132,6 +132,34 @@ static int print_extlog_rcd(const char *pfx,return 1 ; } +static void extlog_print_pcie (struct cper_sec_pcie *pcie_err, +int severity)
drivers/acpi/acpi_extlog.c static int print_extlog_rcd(const char *pfx, · line 146
Quoted 10 lines
drivers/acpi/acpi_extlog.c +10
-0+{ +struct aer_capability_regs *aer; +struct pci_dev *pdev; +unsigned int devfn; +unsigned int bus; +int aer_severity; +int domain; + +if (!(pcie_err->validation_bits &CPER_PCIE_VALID_DEVICE_ID || + pcie_err->validation_bits &CPER_PCIE_VALID_AER_INFO ))
Looking again, I'm not sure this is as intended. Is the aim to allow for either one of these two? Or check that that are both present? That is should it be !(A && B) rather than !(A || B)?
Quoted 15 lines
drivers/acpi/acpi_extlog.c +15
-0+return ; + + aer_severity =cper_severity_to_aer (severity); + aer = (struct aer_capability_regs *)pcie_err->aer_info; + domain = pcie_err->device_id.segment; + bus = pcie_err->device_id.bus; + devfn =PCI_DEVFN (pcie_err->device_id.device, + pcie_err->device_id.function); + pdev =pci_get_domain_bus_and_slot (domain, bus, devfn); +if (!pdev) +return ; + +pci_print_aer (pdev, aer_severity, aer); +pci_dev_put (pdev); +}
Re: [PATCH 2/6 v6] ACPI: extlog: Trace CPER PCI Express Error Section
Quoted 27 lines · Central European Standard Time Jonathan Cameron
Quoted 11 lines · On Thu, 23 Oct 2025 14:25:37 +0200 "Fabio M. De Francesco"…
I/O Machine Check Architecture events may signal failing PCIe components or links. The AER event contains details on what was happening on the wire when the error was signaled.
Trace the CPER PCIe Error section (UEFI v2.10, Appendix N.2.7) reported by the I/O MCA.
Cc Dan Williams <[email protected]>Reviewed-by Dave Jiang <[email protected]>Reviewed-by Jonathan Cameron <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>Hi Fabio,
Was taking a fresh look at this as a precursor to looking at later patches in series and spotted something that I'm doubtful about.
Quoted 8 lines
drivers/acpi/acpi_extlog.c +0
-0@@ -132,6 +132,34 @@ static int print_extlog_rcd(const char *pfx,return 1 ; }
Quoted 17 lines
drivers/acpi/acpi_extlog.c static int print_extlog_rcd(const char *pfx, · line 146
Quoted 12 lines
drivers/acpi/acpi_extlog.c +12
-0+static void extlog_print_pcie (struct cper_sec_pcie *pcie_err, +int severity) +{ +struct aer_capability_regs *aer; +struct pci_dev *pdev; +unsigned int devfn; +unsigned int bus; +int aer_severity; +int domain; + +if (!(pcie_err->validation_bits &CPER_PCIE_VALID_DEVICE_ID || + pcie_err->validation_bits &CPER_PCIE_VALID_AER_INFO ))Looking again, I'm not sure this is as intended. Is the aim to allow for either one of these two? Or check that that are both present? That is should it be !(A && B) rather than !(A || B)?
Hi Jonathan,
You're right. We need to check that both are true and return if they are not, then the statement has to be !(A && B).
Thank you,
Fabio
Quoted 18 lines
Quoted 16 lines
drivers/acpi/acpi_extlog.c +15
-0+return ; + + aer_severity =cper_severity_to_aer (severity); + aer = (struct aer_capability_regs *)pcie_err->aer_info; + domain = pcie_err->device_id.segment; + bus = pcie_err->device_id.bus; + devfn =PCI_DEVFN (pcie_err->device_id.device, + pcie_err->device_id.function); + pdev =pci_get_domain_bus_and_slot (domain, bus, devfn); +if (!pdev) +return ; + +pci_print_aer (pdev, aer_severity, aer); +pci_dev_put (pdev); +}
PATCH v6 3/6 acpi/ghes: Make GHES select ACPI_APEI_PCIEAER
In reply to Fabio M. De FrancescoGHES handles the PCI Express Error Section and also the Compute Express Link (CXL) Protocol Error Section. Two of its functions depend on the APEI PCIe AER logging/recovering support (ACPI_APEI_PCIEAER).
Make GHES select ACPI_APEI_PCIEAER and remove the conditional compilation from the body of two static functions that handle the CPER Error Sections mentioned above.
--- drivers/acpi/apei/Kconfig | 1 + drivers/acpi/apei/ghes.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/acpi/apei/Kconfig +1 -0
@@ -23,6 +23,7 @@ config ACPI_APEI_GHES select ACPI_HED select IRQ_WORK select GENERIC_ALLOCATOR + select ACPI_APEI_PCIEAER select ARM_SDE_INTERFACE if ARM64 help Generic Hardware Error Source provides a way to report
drivers/acpi/apei/ghes.c +0 -4
@@ -613,7 +613,6 @@ static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata,*/ static void ghes_handle_aer (struct acpi_hest_generic_data *gdata) { -#ifdef CONFIG_ACPI_APEI_PCIEAER struct cper_sec_pcie *pcie_err =acpi_hest_get_payload (gdata); if (pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID &&
@@ -646,7 +645,6 @@ static void ghes_handle_aer(struct acpi_hest_generic_data *gdata) (struct aer_capability_regs *) aer_info); } -#endif }static BLOCKING_NOTIFIER_HEAD (vendor_record_notify_list);
@@ -711,7 +709,6 @@ struct work_struct *cxl_cper_prot_err_work;static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err,int severity) { -#ifdef CONFIG_ACPI_APEI_PCIEAER struct cxl_cper_prot_err_work_data wd;u8 *dvsec_start, *cap_start;
@@ -767,7 +764,6 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err, }schedule_work (cxl_cper_prot_err_work); -#endif }int cxl_cper_register_prot_err_work (struct work_struct *work)
Signature · 1 line
2.51.0
kernel test robot
build botRe: [PATCH 3/6 v6] acpi/ghes: Make GHES select ACPI_APEI_PCIEAER
kernel test robot noticed the following build errors:
Hi Fabio,
kernel test robot noticed the following build errors:
[auto build test ERROR on 552c50713f273b494ac6c77052032a49bc9255e2]
url: https://github.com/intel-lab-lkp/linux/commits/Fabio-M-De-Francesco/ACPI-extlog-Trace-CPER-Non-standard-Section-Body/20251023-202846 base: 552c50713f273b494ac6c77052032a49bc9255e2 patch link: https://lore.kernel.org/r/20251023122612.1326748-4-fabio.m.de.francesco%40linux.intel.com patch subject: [PATCH 3/6 v6] acpi/ghes: Make GHES select ACPI_APEI_PCIEAER config: x86_64-buildonly-randconfig-001-20251023 (https://download.01.org/0day-ci/archive/20251023/[email protected]/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251023/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
>> ld.lld: error: undefined symbol: cper_severity_to_aer >>> referenced by ghes.c:626 (drivers/acpi/apei/ghes.c:626) >>> drivers/acpi/apei/ghes.o:(ghes_do_proc) in archive vmlinux.a >>> referenced by ghes.c:753 (drivers/acpi/apei/ghes.c:753) >>> drivers/acpi/apei/ghes.o:(ghes_do_proc) in archive vmlinux.a -- >> ld.lld: error: undefined symbol: aer_recover_queue >>> referenced by ghes.c:642 (drivers/acpi/apei/ghes.c:642) >>> drivers/acpi/apei/ghes.o:(ghes_do_proc) in archive vmlinux.a
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for ACPI_APEI_PCIEAER Depends on [n]: ACPI [=y] && ACPI_APEI [=y] && PCIEAER [=n] Selected by [y]:
- ACPI_APEI_GHES [=y] && ACPI [=y] && ACPI_APEI [=y]
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Re: [PATCH 3/6 v6] acpi/ghes: Make GHES select ACPI_APEI_PCIEAER
Quoted 28 lines · On Thu, 23 Oct 2025 22:56:02 +0800 kernel test robot <[email protected]> wrote:
Hi Fabio,
kernel test robot noticed the following build errors:
[auto build test ERROR on
552c50713f273b494ac6c77052032a49bc9255e2]url: https://github.com/intel-lab-lkp/linux/commits/Fabio-M-De-Francesco/ACPI-extlog-Trace-CPER-Non-standard-Section-Body/20251023-202846 base: 552c50713f273b494ac6c77052032a49bc9255e2 patch link: https://lore.kernel.org/r/20251023122612.1326748-4-fabio.m.de.francesco%40linux.intel.com patch subject: [PATCH 3/6 v6] acpi/ghes: Make GHES select ACPI_APEI_PCIEAER config: x86_64-buildonly-randconfig-001-20251023 (https://download.01.org/0day-ci/archive/20251023/[email protected]/config) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251023/[email protected]/reproduce)If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/All errors (new ones prefixed by >>):
Quoted 5 lines
Quoted 5 lines
ld.lld: error: undefined symbol:
cper_severity_to_aerQuoted 4 lines
referenced by ghes.c:626 (
drivers/acpi/apei/ghes.c:626)
drivers/acpi/apei/ghes.o:(ghes_do_proc) in archive vmlinux.a
referenced by ghes.c:753 (drivers/acpi/apei/ghes.c:753)
drivers/acpi/apei/ghes.o:(ghes_do_proc) in archive vmlinux.a--
Quoted 1 line
Quoted 1 line
ld.lld: error: undefined symbol:
aer_recover_queue
Quoted 9 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
referenced by ghes.c:642 (
drivers/acpi/apei/ghes.c:642)
drivers/acpi/apei/ghes.o:(ghes_do_proc) in archive vmlinux.a
Kconfigwarnings: (for reference only)
WARNING: unmet direct dependencies detected forACPI_APEI_PCIEAERDepends on [n]: ACPI [=y] &&ACPI_APEI[=y] && PCIEAER [=n] Selected by [y]:
-ACPI_APEI_GHES[=y] && ACPI [=y] &&ACPI_APEI[=y]
Ah. The old classic of selects not being recursive. You'll need to select PCIEAER as well I think.
kernel test robot
build botRe: [PATCH 3/6 v6] acpi/ghes: Make GHES select ACPI_APEI_PCIEAER
In reply to Fabio M. De Francescokernel test robot noticed the following build errors:
Hi Fabio,
kernel test robot noticed the following build errors:
[auto build test ERROR on 552c50713f273b494ac6c77052032a49bc9255e2]
url: https://github.com/intel-lab-lkp/linux/commits/Fabio-M-De-Francesco/ACPI-extlog-Trace-CPER-Non-standard-Section-Body/20251023-202846 base: 552c50713f273b494ac6c77052032a49bc9255e2 patch link: https://lore.kernel.org/r/20251023122612.1326748-4-fabio.m.de.francesco%40linux.intel.com patch subject: [PATCH 3/6 v6] acpi/ghes: Make GHES select ACPI_APEI_PCIEAER config: x86_64-buildonly-randconfig-004-20251023 (https://download.01.org/0day-ci/archive/20251023/[email protected]/config) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251023/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
ld: vmlinux.o: in function `ghes_handle_aer':
>> drivers/acpi/apei/ghes.c:626:(.text+0xf13e77): undefined reference to `cper_severity_to_aer' >> ld: drivers/acpi/apei/ghes.c:642:(.text+0xf13f76): undefined reference to `aer_recover_queue'
ld: vmlinux.o: in function `cxl_cper_post_prot_err':
drivers/acpi/apei/ghes.c:753:(.text+0xf14cef): undefined reference to `cper_severity_to_aer'
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for ACPI_APEI_PCIEAER Depends on [n]: ACPI [=y] && ACPI_APEI [=y] && PCIEAER [=n] Selected by [y]:
- ACPI_APEI_GHES [=y] && ACPI [=y] && ACPI_APEI [=y]
vim +626 drivers/acpi/apei/ghes.c
cf870c70a19444 Naveen N Rao 2013-07-10 599
9852ce9ae213d3 Tyler Baicar 2017-11-28 600 /*
9852ce9ae213d3 Tyler Baicar 2017-11-28 601 * PCIe AER errors need to be sent to the AER driver for reporting and
9852ce9ae213d3 Tyler Baicar 2017-11-28 602 * recovery. The GHES severities map to the following AER severities and
9852ce9ae213d3 Tyler Baicar 2017-11-28 603 * require the following handling:
9852ce9ae213d3 Tyler Baicar 2017-11-28 604 *
9852ce9ae213d3 Tyler Baicar 2017-11-28 605 * GHES_SEV_CORRECTABLE -> AER_CORRECTABLE
9852ce9ae213d3 Tyler Baicar 2017-11-28 606 * These need to be reported by the AER driver but no recovery is
9852ce9ae213d3 Tyler Baicar 2017-11-28 607 * necessary.
9852ce9ae213d3 Tyler Baicar 2017-11-28 608 * GHES_SEV_RECOVERABLE -> AER_NONFATAL
9852ce9ae213d3 Tyler Baicar 2017-11-28 609 * GHES_SEV_RECOVERABLE && CPER_SEC_RESET -> AER_FATAL
9852ce9ae213d3 Tyler Baicar 2017-11-28 610 * These both need to be reported and recovered from by the AER driver.
9852ce9ae213d3 Tyler Baicar 2017-11-28 611 * GHES_SEV_PANIC does not make it to this handling since the kernel must
9852ce9ae213d3 Tyler Baicar 2017-11-28 612 * panic.
9852ce9ae213d3 Tyler Baicar 2017-11-28 613 */
9852ce9ae213d3 Tyler Baicar 2017-11-28 614 static void ghes_handle_aer(struct acpi_hest_generic_data *gdata)
d334a49113a4a3 Ying Huang 2010-05-18 615 {
bbcc2e7b642ed2 Tyler Baicar 2017-06-21 616 struct cper_sec_pcie *pcie_err = acpi_hest_get_payload(gdata);
bbcc2e7b642ed2 Tyler Baicar 2017-06-21 617
9852ce9ae213d3 Tyler Baicar 2017-11-28 618 if (pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID &&
a654e5ee4f2213 Ying Huang 2011-12-08 619 pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO) {
a654e5ee4f2213 Ying Huang 2011-12-08 620 unsigned int devfn;
a654e5ee4f2213 Ying Huang 2011-12-08 621 int aer_severity;
e2abc47a5a1a9f Shiju Jose 2023-09-21 622 u8 *aer_info;
0ba98ec9196746 Betty Dall 2013-06-06 623
a654e5ee4f2213 Ying Huang 2011-12-08 624 devfn = PCI_DEVFN(pcie_err->device_id.device,
a654e5ee4f2213 Ying Huang 2011-12-08 625 pcie_err->device_id.function);
2458d66b245e39 Tyler Baicar 2016-09-14 @626 aer_severity = cper_severity_to_aer(gdata->error_severity);
0ba98ec9196746 Betty Dall 2013-06-06 627
0ba98ec9196746 Betty Dall 2013-06-06 628 /*
0ba98ec9196746 Betty Dall 2013-06-06 629 * If firmware reset the component to contain
0ba98ec9196746 Betty Dall 2013-06-06 630 * the error, we must reinitialize it before
0ba98ec9196746 Betty Dall 2013-06-06 631 * use, so treat it as a fatal AER error.
0ba98ec9196746 Betty Dall 2013-06-06 632 */
0ba98ec9196746 Betty Dall 2013-06-06 633 if (gdata->flags & CPER_SEC_RESET)
0ba98ec9196746 Betty Dall 2013-06-06 634 aer_severity = AER_FATAL;
0ba98ec9196746 Betty Dall 2013-06-06 635
e2abc47a5a1a9f Shiju Jose 2023-09-21 636 aer_info = (void *)gen_pool_alloc(ghes_estatus_pool,
e2abc47a5a1a9f Shiju Jose 2023-09-21 637 sizeof(struct aer_capability_regs));
e2abc47a5a1a9f Shiju Jose 2023-09-21 638 if (!aer_info)
e2abc47a5a1a9f Shiju Jose 2023-09-21 639 return;
e2abc47a5a1a9f Shiju Jose 2023-09-21 640 memcpy(aer_info, pcie_err->aer_info, sizeof(struct aer_capability_regs));
e2abc47a5a1a9f Shiju Jose 2023-09-21 641
a654e5ee4f2213 Ying Huang 2011-12-08 @642 aer_recover_queue(pcie_err->device_id.segment,
a654e5ee4f2213 Ying Huang 2011-12-08 643 pcie_err->device_id.bus,
37448adfc7ce0d Lance Ortiz 2013-05-30 644 devfn, aer_severity,
37448adfc7ce0d Lance Ortiz 2013-05-30 645 (struct aer_capability_regs *)
e2abc47a5a1a9f Shiju Jose 2023-09-21 646 aer_info);
a654e5ee4f2213 Ying Huang 2011-12-08 647 }3c5b977f06b754 Tyler Baicar 2017-11-28 648 }a654e5ee4f2213 Ying Huang 2011-12-08 649
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
PATCH v6 4/6 acpi/ghes: Add helper for CXL protocol errors checks
In reply to Fabio M. De FrancescoMove the CPER CXL protocol errors validity out of cxl_cper_post_prot_err() to cxl_cper_sec_prot_err_valid() and limit the serial number check only to CXL agents that are CXL devices (UEFI v2.10, Appendix N.2.13).
--- drivers/acpi/apei/ghes.c | 32 ++++++++++++++++++++++---------- include/cxl/event.h | 10 ++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-)
drivers/acpi/apei/ghes.c +22 -10
@@ -706,30 +706,42 @@ static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data,static DEFINE_SPINLOCK (cxl_cper_prot_err_work_lock);struct work_struct *cxl_cper_prot_err_work; -static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err, -int severity) +int cxl_cper_sec_prot_err_valid (struct cxl_cper_sec_prot_err *prot_err) { -struct cxl_cper_prot_err_work_data wd; -u8 *dvsec_start, *cap_start; -if (!(prot_err->valid_bits &PROT_ERR_VALID_AGENT_ADDRESS )) {pr_err_ratelimited ("CXL CPER invalid agent type\n" ); -return ; +return -EINVAL ; }if (!(prot_err->valid_bits &PROT_ERR_VALID_ERROR_LOG )) {pr_err_ratelimited ("CXL CPER invalid protocol error log\n" ); -return ; +return -EINVAL ; }if (prot_err->err_len !=sizeof (struct cxl_ras_capability_regs )) {pr_err_ratelimited ("CXL CPER invalid RAS Cap size (%u)\n" , prot_err->err_len); -return ; +return -EINVAL ; } -if (!(prot_err->valid_bits &PROT_ERR_VALID_SERIAL_NUMBER )) -pr_warn (FW_WARN "CXL CPER no device serial number\n" ); +if ((prot_err->agent_type ==RCD || prot_err->agent_type ==DEVICE || + prot_err->agent_type ==LD || prot_err->agent_type ==FMLD ) && + !(prot_err->valid_bits &PROT_ERR_VALID_SERIAL_NUMBER )) +pr_warn_ratelimited (FW_WARN +"CXL CPER no device serial number\n" ); + +return 0 ; +} +EXPORT_SYMBOL_GPL (cxl_cper_sec_prot_err_valid); + +static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err, +int severity) +{ +struct cxl_cper_prot_err_work_data wd; +u8 *dvsec_start, *cap_start; + +if (cxl_cper_sec_prot_err_valid (prot_err)) +return ;guard (spinlock_irqsave)(&cxl_cper_prot_err_work_lock);
include/cxl/event.h +10 -0
@@ -320,4 +320,14 @@ static inline int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data }#endif +#ifdef CONFIG_ACPI_APEI_PCIEAER +int cxl_cper_sec_prot_err_valid (struct cxl_cper_sec_prot_err *prot_err); +#else +static inline int +cxl_cper_sec_prot_err_valid (struct cxl_cper_sec_prot_err *prot_err) +{ +return -EOPNOTSUPP ; +} +#endif +#endif /* _LINUX_CXL_EVENT_H */
Signature · 1 line
2.51.0
Re: [PATCH 4/6 v6] acpi/ghes: Add helper for CXL protocol errors checks
Quoted 1 line · On Thu, 23 Oct 2025 14:25:39 +0200 "Fabio M. De Francesco"…
Move the CPER CXL protocol errors validity out of
validity check
Quoted 1 line
cxl_cper_post_prot_err()tocxl_cper_sec_prot_err_valid()and limit the
to new cxl_cper_sec_prot_err_valid()
as otherwise it sounds like it already exists.
Quoted 2 lines
serial number check only to CXL agents that are CXL devices (UEFI v2.10, Appendix N.2.13).
Perhaps a little more here on why. I assume because you are going to have a second user for it, but good to say that. Also serves to justify the export.
Quoted 12 lines
Signed-off-by Fabio M. De Francesco <[email protected]>--- drivers/acpi/apei/ghes.c | 32 ++++++++++++++++++++++---------- include/cxl/event.h | 10 ++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-)drivers/acpi/apei/ghes.c +0
-0
drivers/acpi/apei/ghes.c static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data, · line 709
Quoted 6 lines
drivers/acpi/apei/ghes.c +1
-2@@ -706,30 +706,42 @@ static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data,static DEFINE_SPINLOCK (cxl_cper_prot_err_work_lock);struct work_struct *cxl_cper_prot_err_work; -static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err, -int severity) +int cxl_cper_sec_prot_err_valid (struct cxl_cper_sec_prot_err *prot_err)
Useful to return an error number? Or would a bool be better given it is either valid or not?
Otherwise looks good to me,
Jonathan
Quoted 46 lines
drivers/acpi/apei/ghes.c +21
-8{ -struct cxl_cper_prot_err_work_data wd; -u8 *dvsec_start, *cap_start; -if (!(prot_err->valid_bits &PROT_ERR_VALID_AGENT_ADDRESS )) {pr_err_ratelimited ("CXL CPER invalid agent type\n" ); -return ; +return -EINVAL ; }if (!(prot_err->valid_bits &PROT_ERR_VALID_ERROR_LOG )) {pr_err_ratelimited ("CXL CPER invalid protocol error log\n" ); -return ; +return -EINVAL ; }if (prot_err->err_len !=sizeof (struct cxl_ras_capability_regs )) {pr_err_ratelimited ("CXL CPER invalid RAS Cap size (%u)\n" , prot_err->err_len); -return ; +return -EINVAL ; } -if (!(prot_err->valid_bits &PROT_ERR_VALID_SERIAL_NUMBER )) -pr_warn (FW_WARN "CXL CPER no device serial number\n" ); +if ((prot_err->agent_type ==RCD || prot_err->agent_type ==DEVICE || + prot_err->agent_type ==LD || prot_err->agent_type ==FMLD ) && + !(prot_err->valid_bits &PROT_ERR_VALID_SERIAL_NUMBER )) +pr_warn_ratelimited (FW_WARN +"CXL CPER no device serial number\n" ); + +return 0 ; +} +EXPORT_SYMBOL_GPL (cxl_cper_sec_prot_err_valid); + +static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err, +int severity) +{ +struct cxl_cper_prot_err_work_data wd; +u8 *dvsec_start, *cap_start; + +if (cxl_cper_sec_prot_err_valid (prot_err)) +return ;guard (spinlock_irqsave)(&cxl_cper_prot_err_work_lock);
Re: [PATCH 4/6 v6] acpi/ghes: Add helper for CXL protocol errors checks
Quoted 11 lines · Central European Standard Time Jonathan Cameron
Quoted 1 line · On Thu, 23 Oct 2025 14:25:39 +0200 "Fabio M. De Francesco"…
Move the CPER CXL protocol errors validity out of
validity check
Quoted 1 line
cxl_cper_post_prot_err()tocxl_cper_sec_prot_err_valid()and limit theto new
cxl_cper_sec_prot_err_valid()
Quoted 9 lines
as otherwise it sounds like it already exists.
Quoted 2 lines
serial number check only to CXL agents that are CXL devices (UEFI v2.10, Appendix N.2.13).
Perhaps a little more here on why. I assume because you are going to have a second user for it, but good to say that. Also serves to justify the export.
Hi Jonathan,
All the corrections you made will be applied to the next version.
Quoted 15 lines
Quoted 15 lines
Signed-off-by Fabio M. De Francesco <[email protected]>--- drivers/acpi/apei/ghes.c | 32 ++++++++++++++++++++++---------- include/cxl/event.h | 10 ++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-)drivers/acpi/apei/ghes.c +0
-0@@ -706,30 +706,42 @@ static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data,static DEFINE_SPINLOCK (cxl_cper_prot_err_work_lock);struct work_struct *cxl_cper_prot_err_work;
Quoted 7 lines
drivers/acpi/apei/ghes.c static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data, · line 709
Quoted 3 lines
drivers/acpi/apei/ghes.c +1
-2-static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err, -int severity) +int cxl_cper_sec_prot_err_valid (struct cxl_cper_sec_prot_err *prot_err)Useful to return an error number? Or would a bool be better given it is either valid or not?
I prefer to return more information when reasonable and leave the callers free to use or ignore the specific error number.
Fabio
Quoted 54 lines
Otherwise looks good to me,
Jonathan
Quoted 46 lines
drivers/acpi/apei/ghes.c +21
-8{ -struct cxl_cper_prot_err_work_data wd; -u8 *dvsec_start, *cap_start; -if (!(prot_err->valid_bits &PROT_ERR_VALID_AGENT_ADDRESS )) {pr_err_ratelimited ("CXL CPER invalid agent type\n" ); -return ; +return -EINVAL ; }if (!(prot_err->valid_bits &PROT_ERR_VALID_ERROR_LOG )) {pr_err_ratelimited ("CXL CPER invalid protocol error log\n" ); -return ; +return -EINVAL ; }if (prot_err->err_len !=sizeof (struct cxl_ras_capability_regs )) {pr_err_ratelimited ("CXL CPER invalid RAS Cap size (%u)\n" , prot_err->err_len); -return ; +return -EINVAL ; } -if (!(prot_err->valid_bits &PROT_ERR_VALID_SERIAL_NUMBER )) -pr_warn (FW_WARN "CXL CPER no device serial number\n" ); +if ((prot_err->agent_type ==RCD || prot_err->agent_type ==DEVICE || + prot_err->agent_type ==LD || prot_err->agent_type ==FMLD ) && + !(prot_err->valid_bits &PROT_ERR_VALID_SERIAL_NUMBER )) +pr_warn_ratelimited (FW_WARN +"CXL CPER no device serial number\n" ); + +return 0 ; +} +EXPORT_SYMBOL_GPL (cxl_cper_sec_prot_err_valid); + +static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err, +int severity) +{ +struct cxl_cper_prot_err_work_data wd; +u8 *dvsec_start, *cap_start; + +if (cxl_cper_sec_prot_err_valid (prot_err)) +return ;guard (spinlock_irqsave)(&cxl_cper_prot_err_work_lock);
PATCH v6 5/6 acpi/ghes: Add helper to copy CXL protocol error info to work struct
In reply to Fabio M. De FrancescoMake a helper out of cxl_cper_post_prot_err() that checks the CXL agent type and copy the CPER CXL protocol errors information to a work data structure.
--- drivers/acpi/apei/ghes.c | 42 ++++++++++++++++++++++++++-------------- include/cxl/event.h | 10 ++++++++++ 2 files changed, 37 insertions(+), 15 deletions(-)
drivers/acpi/apei/ghes.c +27 -15
@@ -734,20 +734,12 @@ int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err) }EXPORT_SYMBOL_GPL (cxl_cper_sec_prot_err_valid); -static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err, -int severity) +int cxl_cper_setup_prot_err_work_data (struct cxl_cper_prot_err_work_data *wd, +struct cxl_cper_sec_prot_err *prot_err, +int severity) { -struct cxl_cper_prot_err_work_data wd;u8 *dvsec_start, *cap_start; -if (cxl_cper_sec_prot_err_valid (prot_err)) -return ; - -guard (spinlock_irqsave)(&cxl_cper_prot_err_work_lock); - -if (!cxl_cper_prot_err_work) -return ; -switch (prot_err->agent_type) {case RCD :case DEVICE :
@@ -756,20 +748,40 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err,case RP :case DSP :case USP : -memcpy (&wd.prot_err, prot_err,sizeof (wd.prot_err)); +memcpy (&wd->prot_err, prot_err,sizeof (wd->prot_err)); dvsec_start = (u8 *)(prot_err +1 ); cap_start = dvsec_start + prot_err->dvsec_len; -memcpy (&wd.ras_cap, cap_start,sizeof (wd.ras_cap)); - wd.severity =cper_severity_to_aer (severity); +memcpy (&wd->ras_cap, cap_start,sizeof (wd->ras_cap)); + wd->severity =cper_severity_to_aer (severity);break ;default :pr_err_ratelimited ("CXL CPER invalid agent type: %d\n" , prot_err->agent_type); -return ; +return -EINVAL ; } +return 0 ; +} +EXPORT_SYMBOL_GPL (cxl_cper_setup_prot_err_work_data); + +static void cxl_cper_post_prot_err (struct cxl_cper_sec_prot_err *prot_err, +int severity) +{ +struct cxl_cper_prot_err_work_data wd; + +if (cxl_cper_sec_prot_err_valid (prot_err)) +return ; + +guard (spinlock_irqsave)(&cxl_cper_prot_err_work_lock); + +if (!cxl_cper_prot_err_work) +return ; + +if (cxl_cper_setup_prot_err_work_data (&wd, prot_err, severity)) +return ; +if (!kfifo_put (&cxl_cper_prot_err_fifo, wd)) {pr_err_ratelimited ("CXL CPER kfifo overflow\n" );return ;
include/cxl/event.h +10 -0
@@ -322,12 +322,22 @@ static inline int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data#ifdef CONFIG_ACPI_APEI_PCIEAER int cxl_cper_sec_prot_err_valid (struct cxl_cper_sec_prot_err *prot_err); +int cxl_cper_setup_prot_err_work_data (struct cxl_cper_prot_err_work_data *wd, +struct cxl_cper_sec_prot_err *prot_err, +int severity);#else static inline int cxl_cper_sec_prot_err_valid (struct cxl_cper_sec_prot_err *prot_err) {return -EOPNOTSUPP ; } +static inline int +cxl_cper_setup_prot_err_work_data (struct cxl_cper_prot_err_work_data *wd, +struct cxl_cper_sec_prot_err *prot_err, +int severity) +{ +return -EOPNOTSUPP ; +}#endif #endif /* _LINUX_CXL_EVENT_H */
Signature · 1 line
2.51.0
Re: [PATCH 5/6 v6] acpi/ghes: Add helper to copy CXL protocol error info to work struct
Quoted 5 lines · On Thu, 23 Oct 2025 14:25:40 +0200 "Fabio M. De Francesco"…
Make a helper out of
cxl_cper_post_prot_err()that checks the CXL agent type and copy the CPER CXL protocol errors information to a work data structure.Signed-off-by Fabio M. De Francesco <[email protected]>
LGTM
PATCH v6 6/6 ACPI: extlog: Trace CPER CXL Protocol Error Section
In reply to Fabio M. De FrancescoWhen Firmware First is enabled, BIOS handles errors first and then it makes them available to the kernel via the Common Platform Error Record (CPER) sections (UEFI 2.10 Appendix N). Linux parses the CPER sections via one of two similar paths, either ELOG or GHES. The errors managed by ELOG are signaled to the BIOS by the I/O Machine Check Architecture (I/O MCA).
Currently, ELOG and GHES show some inconsistencies in how they report to userspace via trace events.
Therefore, make the two mentioned paths act similarly by tracing the CPER CXL Protocol Error Section (UEFI v2.10, Appendix N.2.13).
--- drivers/acpi/acpi_extlog.c | 22 ++++++++++++++++++++++ drivers/cxl/core/ras.c | 6 ++++++ include/cxl/event.h | 2 ++ 3 files changed, 30 insertions(+)
drivers/acpi/acpi_extlog.c +22 -0
@@ -12,6 +12,7 @@#include <linux/ratelimit.h> #include <linux/edac.h> #include <linux/ras.h> +#include <cxl/event.h> #include <acpi/ghes.h> #include <asm/cpu.h> #include <asm/mce.h>
@@ -160,6 +161,21 @@ static void extlog_print_pcie(struct cper_sec_pcie *pcie_err,pci_dev_put (pdev); } +static void +extlog_cxl_cper_handle_prot_err (struct cxl_cper_sec_prot_err *prot_err, +int severity) +{ +struct cxl_cper_prot_err_work_data wd; + +if (cxl_cper_sec_prot_err_valid (prot_err)) +return ; + +if (cxl_cper_setup_prot_err_work_data (&wd, prot_err, severity)) +return ; + +cxl_cper_ras_handle_prot_err (&wd); +} +static int extlog_print (struct notifier_block *nb,unsigned long val,void *data) {
@@ -211,6 +227,12 @@ static int extlog_print(struct notifier_block *nb, unsigned long val,if (gdata->error_data_length >=sizeof (*mem))trace_extlog_mem_event (mem, err_seq, fru_id, fru_text, (u8 )gdata->error_severity); + }else if (guid_equal (sec_type, &CPER_SEC_CXL_PROT_ERR )) { +struct cxl_cper_sec_prot_err *prot_err = +acpi_hest_get_payload (gdata); + +extlog_cxl_cper_handle_prot_err (prot_err, + gdata->error_severity); }else if (guid_equal (sec_type, &CPER_SEC_PCIE )) {struct cper_sec_pcie *pcie_err =acpi_hest_get_payload (gdata);
drivers/cxl/core/ras.c +6 -0
@@ -105,6 +105,12 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data)cxl_cper_trace_uncorr_prot_err (cxlmd, data->ras_cap); } +void cxl_cper_ras_handle_prot_err (struct cxl_cper_prot_err_work_data *wd) +{ +cxl_cper_handle_prot_err (wd); +} +EXPORT_SYMBOL_GPL (cxl_cper_ras_handle_prot_err); +static void cxl_cper_prot_err_work_fn (struct work_struct *work) {struct cxl_cper_prot_err_work_data wd;
include/cxl/event.h +2 -0
@@ -340,4 +340,6 @@ cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_err_work_data *wd, }#endif +void cxl_cper_ras_handle_prot_err (struct cxl_cper_prot_err_work_data *wd); +#endif /* _LINUX_CXL_EVENT_H */
Signature · 1 line
2.51.0
Re: [PATCH 6/6 v6] ACPI: extlog: Trace CPER CXL Protocol Error Section
Quoted 9 lines · On Thu, 23 Oct 2025 14:25:41 +0200 "Fabio M. De Francesco"…
When Firmware First is enabled, BIOS handles errors first and then it makes them available to the kernel via the Common Platform Error Record (CPER) sections (UEFI 2.10 Appendix N). Linux parses the CPER sections via one of two similar paths, either ELOG or GHES. The errors managed by ELOG are signaled to the BIOS by the I/O Machine Check Architecture (I/O MCA).
Currently, ELOG and GHES show some inconsistencies in how they report to userspace via trace events.
Quoted 6 lines
Therefore, make the two mentioned paths act similarly by tracing the CPER CXL Protocol Error Section (UEFI v2.10, Appendix N.2.13).
Cc Dan Williams <[email protected]>Reviewed-by Kuppuswamy Sathyanarayanan <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>
Just one small question. With that addressed,
drivers/cxl/core/ras.c static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) · line 108
Quoted 9 lines
drivers/cxl/core/ras.c +1
-0@@ -105,6 +105,12 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data)cxl_cper_trace_uncorr_prot_err (cxlmd, data->ras_cap); } +void cxl_cper_ras_handle_prot_err (struct cxl_cper_prot_err_work_data *wd)
Why do we need this wrapper? The name is a bit more general, so if you do need it, then why not instead just rename cxl_cper_handle_prot_err()
Quoted 19 lines
drivers/cxl/core/ras.c +5
-0+{ +cxl_cper_handle_prot_err (wd); +} +EXPORT_SYMBOL_GPL (cxl_cper_ras_handle_prot_err); +static void cxl_cper_prot_err_work_fn (struct work_struct *work) {struct cxl_cper_prot_err_work_data wd;include/cxl/event.h +2
-0@@ -340,4 +340,6 @@ cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_err_work_data *wd, }#endif +void cxl_cper_ras_handle_prot_err (struct cxl_cper_prot_err_work_data *wd); +#endif /* _LINUX_CXL_EVENT_H */
Re: [PATCH 6/6 v6] ACPI: extlog: Trace CPER CXL Protocol Error Section
Quoted 30 lines · Central European Standard Time Jonathan Cameron
Quoted 9 lines · On Thu, 23 Oct 2025 14:25:41 +0200 "Fabio M. De Francesco"…
When Firmware First is enabled, BIOS handles errors first and then it makes them available to the kernel via the Common Platform Error Record (CPER) sections (UEFI 2.10 Appendix N). Linux parses the CPER sections via one of two similar paths, either ELOG or GHES. The errors managed by ELOG are signaled to the BIOS by the I/O Machine Check Architecture (I/O MCA).
Currently, ELOG and GHES show some inconsistencies in how they report to userspace via trace events.
Quoted 6 lines
Therefore, make the two mentioned paths act similarly by tracing the CPER CXL Protocol Error Section (UEFI v2.10, Appendix N.2.13).
Cc Dan Williams <[email protected]>Reviewed-by Kuppuswamy Sathyanarayanan <[email protected]>Signed-off-by Fabio M. De Francesco <[email protected]>Just one small question. With that addressed,
Reviewed-by Jonathan Cameron <[email protected]>Quoted 8 lines
drivers/cxl/core/ras.c +0
-0@@ -105,6 +105,12 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data)cxl_cper_trace_uncorr_prot_err (cxlmd, data->ras_cap); }
Quoted 5 lines
drivers/cxl/core/ras.c static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) · line 108
Quoted 1 line
drivers/cxl/core/ras.c +1
-0+void cxl_cper_ras_handle_prot_err (struct cxl_cper_prot_err_work_data *wd)Why do we need this wrapper? The name is a bit more general, so if you do need it, then why not instead just rename
cxl_cper_handle_prot_err()
Actually, on a second thought I believe that we don't need either this wrapper or renaming cxl_cper_handle_prot_err(). I'll export the latter as it is.
Fabio
Quoted 21 lines
Quoted 19 lines
drivers/cxl/core/ras.c +5
-0+{ +cxl_cper_handle_prot_err (wd); +} +EXPORT_SYMBOL_GPL (cxl_cper_ras_handle_prot_err); +static void cxl_cper_prot_err_work_fn (struct work_struct *work) {struct cxl_cper_prot_err_work_data wd;include/cxl/event.h +2
-0@@ -340,4 +340,6 @@ cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_err_work_data *wd, }#endif +void cxl_cper_ras_handle_prot_err (struct cxl_cper_prot_err_work_data *wd); +#endif /* _LINUX_CXL_EVENT_H */
Rafael J. Wysocki
maintainerQuoted 81 lines · Fabio M. De Francesco
When Firmware First is enabled, BIOS handles errors first and then it makes them available to the kernel via the Common Platform Error Record (CPER) sections (UEFI 2.10 Appendix N). Linux parses the CPER sections via one of two similar paths, either ELOG or GHES.
Currently, ELOG and GHES show some inconsistencies in how they print to the kernel log as well as in how they report to userspace via trace events.
Make the two mentioned paths act similarly for what relates to logging and tracing.
--- Changes for v6 ---
- Rename the helper that copies the CPER CXL protocol error information to work struct (Dave)
- Return-EOPNOTSUPP(instead of-EINVAL) from the two helpers ifACPI_APEI_PCIEAERis not defined (Dave)--- Changes for v5 ---
- Add 3/6 to select
ACPI_APEI_PCIEAERfor GHES
- Add 4,5/6 to move common code between ELOG and GHES out to new helpers use them in 6/6 (Jonathan).--- Changes for v4 ---
- Re-base on top of recent changes of the AER error logging and drop obsoleted 2/4 (Sathyanarayanan)
- Log withpr_warn_ratelimited()(Dave)
- Collect tags--- Changes for v3 ---
1/4, 2/4:
- collect tags; no functional changes
3/4:
- Invert logic of checks (Yazen)
- SelectCONFIG_ACPI_APEI_PCIEAER(Yazen)
4/4:
- Check serial number only for CXL devices (Yazen)
- Replace "invalid" with "unknown" in the output of apr_err()(Yazen)--- Changes for v2 ---
- Add a patch to pass log levels to
pci_print_aer()(Dan)
- Add a patch to trace CPER CXL Protocol Errors
- Rework commit messages (Dan)
- Uselog_non_standard_event()(Bjorn)--- Changes for v1 ---
- Drop the RFC prefix and restart from PATCH v1
- Drop patch 3/3 because a discussion on it has not yet been settled
- Drop namespacing in export ofpci_print_aerwhile()(Dan)
- Don't use '#ifdef' in *.c files (Dan)
- Drop a reference on pdev after operation is complete (Dan)
- Don't log an error message if pdev is NULL (Dan)Fabio M. De Francesco (6):
ACPI: extlog: Trace CPER Non-standard Section Body
ACPI: extlog: Trace CPER PCI Express Error Section acpi/ghes: Make GHES selectACPI_APEI_PCIEAER
acpi/ghes: Add helper for CPER CXL protocol errors validity checks acpi/ghes: Add helper to copy CPER CXL protocol error information to
work struct
ACPI: extlog: Trace CPER CXL Protocol Error Sectiondrivers/acpi/Kconfig | 1 + drivers/acpi/acpi_extlog.c | 60 ++++++++++++++++++++++++++++++++++++ drivers/acpi/apei/Kconfig | 1 + drivers/acpi/apei/ghes.c | 62 +++++++++++++++++++++++++------------- drivers/cxl/core/ras.c | 6 ++++ drivers/pci/pcie/aer.c | 2 +- include/cxl/event.h | 22 ++++++++++++++ 7 files changed, 132 insertions(+), 22 deletions(-)
Quoted 2 lines
base-commit:
552c50713f273b494ac6c77052032a49bc9255e2--
I need ACKs or equivalent for patches [3-5/6] from the designated APEI reviewers. Tony?
Luck, Tony
reviewerQuoted 2 lines
I need ACKs or equivalent for patches [3-5/6] from the designated APEI reviewers. Tony?
There's an LKP complaint against patch 3 (perhaps for a crazy randconfig, but an indication that Kconfig dependencies aren't right).
The APEI bits look ok to me. But I think 3-6 need some CXL acks too.
-Tony