From nobody Sat Feb 7 11:05:20 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8533192B75; Wed, 14 Jan 2026 10:16:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385765; cv=none; b=LYu336ZcT8ydufhqHbq/HATDCCNXwdXAOZiLH7c/ijMckbNKSgrpRVf0WLYQ4QTBUlDWBHNwa3XKLMf4E86MH5EDJpSjk308u0R5Fd2offLepfMgXLPJMeVbTuFl+VqiMm3xhjO6rZ4gyCDrvGzmiDmu7fwxwEV+9SK9V/45C2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385765; c=relaxed/simple; bh=0Jx7sgvnzmm4IhMz1DkIVr0T4vOsn+9/FVAb35DZKCk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h4wXICwZi8e/XetwcP6a9LhU4eBZCHvSY5oXHew3kEr/OdtwmY0m3oDy6ePM3lIYQao3/UclAUxVaIp+Y1E8ecYIR1Ph6gEdp43OlvToltc6yglPFbNbphDjD0Up3hVcW0g0oPoijUwTUg2BaOFMNDmC2P30wJ9lRYfE/AApOAo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AbjvDyCX; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AbjvDyCX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768385762; x=1799921762; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0Jx7sgvnzmm4IhMz1DkIVr0T4vOsn+9/FVAb35DZKCk=; b=AbjvDyCXcnZWC/cYIsZ4eEdzqgij6SE8V6RHEXRDbjJyhWePPk8lYy2P wlirayvUvj+5kCEO4QgLUTlexfORbSc3eQCptXBtR1egQK6P8OtB+cGx3 D+oSKeCV2KCYHQhnJ68r7vnnXiYric+D4x3xmDgnc15wqhiHJWww1PYu2 i58uQJr61NJaybwNAAHOSG9yBR7BtutB8NPYzn2VUHK1y12lGEwxVeOvo anEUI37k4Z0ytpvI0BZBj2IHo0cF1HBlhOEVjjt9peVZMj9Rr+ZOKtpgQ AH6KE3zAXL1IhSh+sRrYjBc35d6SAySL2EVYL/vZjsrPxDTUHuK4E5pK4 w==; X-CSE-ConnectionGUID: MKcLmI3gQJeZr7IdJCTkFQ== X-CSE-MsgGUID: dX3anY07QI6NQUxJAdGl6A== X-IronPort-AV: E=McAfee;i="6800,10657,11670"; a="69765803" X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="69765803" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:02 -0800 X-CSE-ConnectionGUID: iYVtXrfTT3isZMTL8ZXelA== X-CSE-MsgGUID: BKHDCLGeQqSvTScn1B0fXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="208792751" Received: from unknown (HELO fdefranc-mobl3.igk.intel.com) ([10.237.142.167]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:15:56 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" , Jonathan Cameron , Kuppuswamy Sathyanarayanan , Qiuxu Zhuo Subject: [PATCH 1/5 v9] ACPI: extlog: Trace CPER Non-standard Section Body Date: Wed, 14 Jan 2026 11:14:21 +0100 Message-ID: <20260114101543.85926-2-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> References: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" ghes_do_proc() has a catch-all for unknown or unhandled CPER formats (UEFI v2.11 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(). Cc: Dan Williams Reviewed-by: Dan Williams Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan Reviewed-by: Qiuxu Zhuo Reviewed-by: Shuai Xue Signed-off-by: Fabio M. De Francesco --- drivers/acpi/acpi_extlog.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index f6b9562779de0..47d11cb5c9120 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -183,6 +183,12 @@ static int extlog_print(struct notifier_block *nb, uns= igned long val, if (gdata->error_data_length >=3D sizeof(*mem)) trace_extlog_mem_event(mem, err_seq, fru_id, fru_text, (u8)gdata->error_severity); + } else { + void *err =3D acpi_hest_get_payload(gdata); + + log_non_standard_event(sec_type, fru_id, fru_text, + gdata->error_severity, err, + gdata->error_data_length); } } =20 --=20 2.52.0 From nobody Sat Feb 7 11:05:20 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 760A2350A0E; Wed, 14 Jan 2026 10:16:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385772; cv=none; b=cGKswTnbecnuZ2t73RS0JP5ZkdtFP+q6zYyLP3uUQy4qM5AFLoS+4pR4cQEFEhdY1hzR4Qmnq5CUjfIRSnMoJ90EYbhko30zxKpbq5py1aRYx/XJ5lbZtpiP/ZK5xQyJpo5kF2CN8Gn2WZqAMHm94CdFXgNIK3ZBjTlAxNGGhH0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385772; c=relaxed/simple; bh=qBAGDUoxoUz1GVnALDeA12vJreI1EPv7zHhPC8BpEP4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZnRsDobw0UADCBmrORFN31X271iUJ+DpDSc9aOdFjSC00EXYF/o1UQB0/Zl2v2E7fpctWrv9SEU3e//Y+5FgD0H25GpVw8iyO3VsINi8uIA5FdgvVOQpBRQIChAY9sdxN3y38jEmiUiHv3b8gK4CETvd05Sl99ah6IsrMWNo2EI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Dm75d2sI; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Dm75d2sI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768385770; x=1799921770; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qBAGDUoxoUz1GVnALDeA12vJreI1EPv7zHhPC8BpEP4=; b=Dm75d2sIaVz2X/2EMKvn+ZiW3Q/bBAeuzik5rqer1VDVRD79MvZSpoqC UT8Yo98zL2FPHQ6N9/PFv/ovvGzGi0+cfqShHYxwbUPOpgWsKCStZzkv0 8ACQXO8Y+pxx01YtRCbAjXURtHBC6iufRRrNGMUPA2Pvr+xUPeoW02ik5 YiWutfnWEjcubDvL6iaFYYAzGghl7QPOtI8oSewnnBtfZirFvoxsHqcwG P63Xxra9D63IbJ6yd7edajUOj6u8RW0zR1WwlBDg3D+3TTJnETIPAIBLG XmJ4JxOMuBsEojHFn6voEOuYPqvG0qzK59WM6a6lEc6BxQyRZr4sG46ei Q==; X-CSE-ConnectionGUID: gzJVxZpLTdCLziUvzk77uw== X-CSE-MsgGUID: XmOPoPF1QKGvOTEY2wuMLg== X-IronPort-AV: E=McAfee;i="6800,10657,11670"; a="69765822" X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="69765822" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:08 -0800 X-CSE-ConnectionGUID: Lyyf5N7dTvqobdIJjgXORA== X-CSE-MsgGUID: J8hu9WWzQzqCth5pPfVAcA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="208792772" Received: from unknown (HELO fdefranc-mobl3.igk.intel.com) ([10.237.142.167]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:03 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" Subject: [PATCH 2/5 v9] ACPI: extlog: Trace CPER PCI Express Error Section Date: Wed, 14 Jan 2026 11:14:22 +0100 Message-ID: <20260114101543.85926-3-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> References: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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.11, Appendix N.2.7) reported by the I/O MCA. Cc: Dan Williams Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Fabio M. De Francesco --- drivers/acpi/acpi_extlog.c | 34 ++++++++++++++++++++++++++++++++++ drivers/pci/pcie/aer.c | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index 47d11cb5c9120..88a2237772c26 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -132,6 +132,36 @@ static int print_extlog_rcd(const char *pfx, return 1; } =20 +static void extlog_print_pcie(struct cper_sec_pcie *pcie_err, + int severity) +{ +#ifdef ACPI_APEI_PCIEAER + 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 =3D cper_severity_to_aer(severity); + aer =3D (struct aer_capability_regs *)pcie_err->aer_info; + domain =3D pcie_err->device_id.segment; + bus =3D pcie_err->device_id.bus; + devfn =3D PCI_DEVFN(pcie_err->device_id.device, + pcie_err->device_id.function); + pdev =3D pci_get_domain_bus_and_slot(domain, bus, devfn); + if (!pdev) + return; + + pci_print_aer(pdev, aer_severity, aer); + pci_dev_put(pdev); +#endif +} + static int extlog_print(struct notifier_block *nb, unsigned long val, void *data) { @@ -183,6 +213,10 @@ static int extlog_print(struct notifier_block *nb, uns= igned long val, if (gdata->error_data_length >=3D 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 =3D acpi_hest_get_payload(gdata); + + extlog_print_pcie(pcie_err, gdata->error_severity); } else { void *err =3D acpi_hest_get_payload(gdata); =20 diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index e0bcaa896803c..71ee4f5064ded 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -973,7 +973,7 @@ void pci_print_aer(struct pci_dev *dev, int aer_severit= y, 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); =20 /** * add_error_device - list device to be handled --=20 2.52.0 From nobody Sat Feb 7 11:05:20 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54D1C38A280; Wed, 14 Jan 2026 10:16:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385783; cv=none; b=So2T5UmWLgIekR5PTmbG7I5BPzMBcYXKRSM3Rc4NsZlSXymeM07ZnqMEIH6s9uwz8ptoJfzn1CfvnsYI9xC7URJVaJ2lJ5Eox6lYakfeKvfI++nFbbqcy5BclXJMAIoUHNUT7vxbekVPHnxB/E8Mdu3P4MDkXAy4XUxJlSg5HwM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385783; c=relaxed/simple; bh=3JeX3kfiJkV+SDsaXDPJu5yP2rFh1vT9UghvnBJ0jmM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RrtYqGGnP5x/A/6hrVv7rE9sc7AQlAWrSzDXbo+gkd4h9KJ3zEEhimyRlvKdGvFz4FxtDkPUtBMUSO+I8yXLo+AaoYcfHoD20zSqvZCJXDLkOHc6dzdJKDJnIUQo15bk5TB/1aYam2X/wvIUULPOpv1VtL4fyKofc2PE2SfaxUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=lS/TLG30; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lS/TLG30" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768385774; x=1799921774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3JeX3kfiJkV+SDsaXDPJu5yP2rFh1vT9UghvnBJ0jmM=; b=lS/TLG30B77i8F7n6e6Kjc3thZ2UOqZMncW4om1A/JVe72uo8tqdBoAl 5rhfNTNRtg19XTviyyNuJlpKaCuifx8PbkoizKjTh335PErjlbOl2DAE8 XFcRtZaOHF1ZTSFYHMBOJYBzCS65d28p7tOlMHGx7mCD2M9dnFwDmCbT7 Opx+hXxQwpmz+nOAoRZ9QzhxhrywrbsiGnRXPTET2YbiuH1d/WzSk2Gs1 ykHxrdmbHm8uH4KnTRMUWiPajqoGD7yNR2cB4ku3gipz/euV/HjMBvpwT KhQRrz21ZLqpLeTjdvPxQjg5kMDota8kgx7X3Zu+uotzCJ8nwYKOXTKH8 Q==; X-CSE-ConnectionGUID: DPeb/s7nT9CXBg4wH6rexQ== X-CSE-MsgGUID: QP0UyEDxSl29F0BQqI6RgQ== X-IronPort-AV: E=McAfee;i="6800,10657,11670"; a="69765836" X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="69765836" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:14 -0800 X-CSE-ConnectionGUID: Wpgy8ZZWSSSt4c7WkpfkRQ== X-CSE-MsgGUID: 5XnhheJpQyqsGJQ13GGE/w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="208792779" Received: from unknown (HELO fdefranc-mobl3.igk.intel.com) ([10.237.142.167]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:08 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" Subject: [PATCH 3/5 v9] acpi/ghes: Add helper for CPER CXL protocol errors checks Date: Wed, 14 Jan 2026 11:14:23 +0100 Message-ID: <20260114101543.85926-4-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> References: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move the CPER CXL protocol errors validity check out of cxl_cper_post_prot_err() to new 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). Export the new symbol for reuse by ELOG. Reviewed-by: Dave Jiang Reviewed-by: Hanjun Guo Reviewed-by: Jonathan Cameron Signed-off-by: Fabio M. De Francesco --- drivers/acpi/apei/Makefile | 1 + drivers/acpi/apei/ghes.c | 18 +---------------- drivers/acpi/apei/ghes_helpers.c | 33 ++++++++++++++++++++++++++++++++ include/cxl/event.h | 10 ++++++++++ 4 files changed, 45 insertions(+), 17 deletions(-) create mode 100644 drivers/acpi/apei/ghes_helpers.c diff --git a/drivers/acpi/apei/Makefile b/drivers/acpi/apei/Makefile index 2c474e6477e12..5db61dfb46915 100644 --- a/drivers/acpi/apei/Makefile +++ b/drivers/acpi/apei/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_ACPI_APEI) +=3D apei.o obj-$(CONFIG_ACPI_APEI_GHES) +=3D ghes.o +obj-$(CONFIG_ACPI_APEI_PCIEAER) +=3D ghes_helpers.o obj-$(CONFIG_ACPI_APEI_EINJ) +=3D einj.o einj-y :=3D einj-core.o einj-$(CONFIG_ACPI_APEI_EINJ_CXL) +=3D einj-cxl.o diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 0dc767392a6c6..cc4cc7ee8422d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -713,24 +713,8 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec= _prot_err *prot_err, struct cxl_cper_prot_err_work_data wd; u8 *dvsec_start, *cap_start; =20 - if (!(prot_err->valid_bits & PROT_ERR_VALID_AGENT_ADDRESS)) { - pr_err_ratelimited("CXL CPER invalid agent type\n"); + if (cxl_cper_sec_prot_err_valid(prot_err)) return; - } - - if (!(prot_err->valid_bits & PROT_ERR_VALID_ERROR_LOG)) { - pr_err_ratelimited("CXL CPER invalid protocol error log\n"); - return; - } - - if (prot_err->err_len !=3D sizeof(struct cxl_ras_capability_regs)) { - pr_err_ratelimited("CXL CPER invalid RAS Cap size (%u)\n", - prot_err->err_len); - return; - } - - if (!(prot_err->valid_bits & PROT_ERR_VALID_SERIAL_NUMBER)) - pr_warn(FW_WARN "CXL CPER no device serial number\n"); =20 guard(spinlock_irqsave)(&cxl_cper_prot_err_work_lock); =20 diff --git a/drivers/acpi/apei/ghes_helpers.c b/drivers/acpi/apei/ghes_help= ers.c new file mode 100644 index 0000000000000..f3d162139a974 --- /dev/null +++ b/drivers/acpi/apei/ghes_helpers.c @@ -0,0 +1,33 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright(c) 2025 Intel Corporation. All rights reserved + +#include +#include + +int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err) +{ + if (!(prot_err->valid_bits & PROT_ERR_VALID_AGENT_ADDRESS)) { + pr_err_ratelimited("CXL CPER invalid agent type\n"); + return -EINVAL; + } + + if (!(prot_err->valid_bits & PROT_ERR_VALID_ERROR_LOG)) { + pr_err_ratelimited("CXL CPER invalid protocol error log\n"); + return -EINVAL; + } + + if (prot_err->err_len !=3D sizeof(struct cxl_ras_capability_regs)) { + pr_err_ratelimited("CXL CPER invalid RAS Cap size (%u)\n", + prot_err->err_len); + return -EINVAL; + } + + if ((prot_err->agent_type =3D=3D RCD || prot_err->agent_type =3D=3D DEVIC= E || + prot_err->agent_type =3D=3D LD || prot_err->agent_type =3D=3D 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); diff --git a/include/cxl/event.h b/include/cxl/event.h index 6fd90f9cc2034..4d7d1036ea9cb 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -320,4 +320,14 @@ static inline int cxl_cper_prot_err_kfifo_get(struct c= xl_cper_prot_err_work_data } #endif =20 +#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 */ --=20 2.52.0 From nobody Sat Feb 7 11:05:20 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C86F350A0E; Wed, 14 Jan 2026 10:16:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385781; cv=none; b=HDmPPmDISjn4k2sMD7Pc0INNDnD+riPVfjrtRsYk/CzPWxPtFnuaYvlJ3z36+dHavbU6rkz8xyQqLxnIkljGnT1gxZFm1Gh8301+g+PtbrikCWMHOmH3SQ5GvGYrPBQ4FOJX27gORkhu/moSfpZhK7DbKnb9eA0YK9NiC8nCblE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385781; c=relaxed/simple; bh=WAaB4x5EtZX1hdIYOdIBpo/Pu2iiyrIR3CaAw6L8S9w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AzbFa7h961zTkn9kOEHCQOspR16QPXViK/fTvmzJu/20LKpr3hnHmX+340a0aCWJFcmplFxmCP2AhFEhn3arEIdzcAr/N7xkhltctUAMdifQRyluVp1n1NlhWwm9M6yEytFMH9glEBnlnOpE0Hv6NFasJLCyfD47CbWt4soq6mY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=j/3+tmAy; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="j/3+tmAy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768385780; x=1799921780; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WAaB4x5EtZX1hdIYOdIBpo/Pu2iiyrIR3CaAw6L8S9w=; b=j/3+tmAyY4rNum04wH8t1aKGlfMTjO2bX8FSeXh34OBwFqCOvbm59czq 6o+8+WqWZ8OOY4EiBfdkrQacAM4DhEHFQcjeQTyHy9mdBVrtUsh5xl2Aa aOizfZ2Jj9YdXPK0DQGV39cdz8GJ8lff0TDySamiOHQxmhw4W3IaJj7yY 6Fe59iPhgbWpjhROzOyT2tJeE8r+y+XLjayg4XwX7cfC6bu05isgBhAau hz+otxJ4J8mLbN/ruuiq0S1tOZjUrx1jJBxMJnBczMKbJPL+8YCRR8PvI ESYKAhND5ilkKNUZ8uVXnlH9C5fFw7eld8e4DsKsdr13F0LIAPHXFfp4I A==; X-CSE-ConnectionGUID: QPLrE1wfTvGDAUr7FDf2hA== X-CSE-MsgGUID: 9gYsjOkVRLmCbDMeNrWCnQ== X-IronPort-AV: E=McAfee;i="6800,10657,11670"; a="69765855" X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="69765855" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:19 -0800 X-CSE-ConnectionGUID: sSiC9NvLSqmZspQj6bk/5w== X-CSE-MsgGUID: gVtrgyGhS/qZviZ5bbmSIg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="208792798" Received: from unknown (HELO fdefranc-mobl3.igk.intel.com) ([10.237.142.167]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:14 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" Subject: [PATCH 4/5 v9] acpi/ghes: Add helper to copy CPER CXL protocol error info to work struct Date: Wed, 14 Jan 2026 11:14:24 +0100 Message-ID: <20260114101543.85926-5-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> References: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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. Export the new symbol for reuse by ELOG. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Hanjun Guo Signed-off-by: Fabio M. De Francesco --- drivers/acpi/apei/ghes.c | 22 +-------------------- drivers/acpi/apei/ghes_helpers.c | 33 ++++++++++++++++++++++++++++++++ include/cxl/event.h | 10 ++++++++++ 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index cc4cc7ee8422d..79755587871fa 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -711,7 +711,6 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_= prot_err *prot_err, { #ifdef CONFIG_ACPI_APEI_PCIEAER struct cxl_cper_prot_err_work_data wd; - u8 *dvsec_start, *cap_start; =20 if (cxl_cper_sec_prot_err_valid(prot_err)) return; @@ -721,27 +720,8 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec= _prot_err *prot_err, if (!cxl_cper_prot_err_work) return; =20 - switch (prot_err->agent_type) { - case RCD: - case DEVICE: - case LD: - case FMLD: - case RP: - case DSP: - case USP: - memcpy(&wd.prot_err, prot_err, sizeof(wd.prot_err)); - - dvsec_start =3D (u8 *)(prot_err + 1); - cap_start =3D dvsec_start + prot_err->dvsec_len; - - memcpy(&wd.ras_cap, cap_start, sizeof(wd.ras_cap)); - wd.severity =3D cper_severity_to_aer(severity); - break; - default: - pr_err_ratelimited("CXL CPER invalid agent type: %d\n", - prot_err->agent_type); + if (cxl_cper_setup_prot_err_work_data(&wd, prot_err, severity)) return; - } =20 if (!kfifo_put(&cxl_cper_prot_err_fifo, wd)) { pr_err_ratelimited("CXL CPER kfifo overflow\n"); diff --git a/drivers/acpi/apei/ghes_helpers.c b/drivers/acpi/apei/ghes_help= ers.c index f3d162139a974..bc7111b740afb 100644 --- a/drivers/acpi/apei/ghes_helpers.c +++ b/drivers/acpi/apei/ghes_helpers.c @@ -2,6 +2,7 @@ // Copyright(c) 2025 Intel Corporation. All rights reserved =20 #include +#include #include =20 int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err) @@ -31,3 +32,35 @@ int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot= _err *prot_err) return 0; } EXPORT_SYMBOL_GPL(cxl_cper_sec_prot_err_valid); + +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) +{ + u8 *dvsec_start, *cap_start; + + switch (prot_err->agent_type) { + case RCD: + case DEVICE: + case LD: + case FMLD: + case RP: + case DSP: + case USP: + memcpy(&wd->prot_err, prot_err, sizeof(wd->prot_err)); + + dvsec_start =3D (u8 *)(prot_err + 1); + cap_start =3D dvsec_start + prot_err->dvsec_len; + + memcpy(&wd->ras_cap, cap_start, sizeof(wd->ras_cap)); + wd->severity =3D cper_severity_to_aer(severity); + break; + default: + pr_err_ratelimited("CXL CPER invalid agent type: %d\n", + prot_err->agent_type); + return -EINVAL; + } + + return 0; +} +EXPORT_SYMBOL_GPL(cxl_cper_setup_prot_err_work_data); diff --git a/include/cxl/event.h b/include/cxl/event.h index 4d7d1036ea9cb..94081aec597ae 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -322,12 +322,22 @@ static inline int cxl_cper_prot_err_kfifo_get(struct = cxl_cper_prot_err_work_data =20 #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 =20 #endif /* _LINUX_CXL_EVENT_H */ --=20 2.52.0 From nobody Sat Feb 7 11:05:20 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5836A318EE4; Wed, 14 Jan 2026 10:16:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385789; cv=none; b=spuGYDyY0Hy1EMOpzNClYYaYYioWDUYKgnANr0YltMr7JHCKayM0JG7DRAsbdfgnRNdSPghTCes7Jhg42vMi2zXwGlNRG6f0dZfGfx29nDp1/bJz7LmW3gTfmnnHv2H9gLSzgg6a8WbtjUKQr8q820C0m844xvgpXBQ0/HLrelk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768385789; c=relaxed/simple; bh=YiVlGQCr+FTIJ4B2/AoJNeziKA/MhUEzfyR0foaLu2g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bQ+EmadTqleQIAXSIHd9LvJfAffuZ5I8TI7tw8PAkQIxGub71kz31s3pjxlPZYZVkKMLl+8OTJHpuZKqZqWOkTqt9TPP6PC0jAGVIPpP1+JMzYzrYWhld942+WDinWw7B99J4Pz0QN+AsGW4YtVGGAv3eq07MPS8ayq6aIfEpvI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=I1dcJPuz; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="I1dcJPuz" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1768385788; x=1799921788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YiVlGQCr+FTIJ4B2/AoJNeziKA/MhUEzfyR0foaLu2g=; b=I1dcJPuz2nYoNPnUjjbunl0lpVOeCWszrEtND11i/0/66Rvj9vi9jg5z axN+IOMi9hjIS1eYbYwspIcP1Bz9pt9CsVvcPoAgB7wAgnhED71dIIfef RTnafNGOkDKGDPrnpMZFvqb8zDHEdEALcvOf2KumHDJmo+3OXqKNwewsV HpO54hoaWHOe+ZwPF04iPFjF0zQHDrQRutRJxqVoIIj2pSCpOoFt081Z5 eEOC2KISldjxNuugJxmxqLoPgWvbgIqJgcybpxuOcsU3vuwaMrHOlQfEZ DvcRoCBVKt3z9xkTtQGVWUQDaXAhsCHoGtksp0MbKReAjR9QCN8vc6cIA g==; X-CSE-ConnectionGUID: 5gERZoZ8TCqpUooTsb59Bw== X-CSE-MsgGUID: yM7n2W+DQGydcuidfHgZyA== X-IronPort-AV: E=McAfee;i="6800,10657,11670"; a="69765868" X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="69765868" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:25 -0800 X-CSE-ConnectionGUID: rE2LwQp9T36u45hrhdgfxg== X-CSE-MsgGUID: dKpe5iEjRW2dDBf+x62EXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,225,1763452800"; d="scan'208";a="208792833" Received: from unknown (HELO fdefranc-mobl3.igk.intel.com) ([10.237.142.167]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jan 2026 02:16:20 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" , Kuppuswamy Sathyanarayanan Subject: [PATCH 5/5 v9] ACPI: extlog: Trace CPER CXL Protocol Error Section Date: Wed, 14 Jan 2026 11:14:25 +0100 Message-ID: <20260114101543.85926-6-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> References: <20260114101543.85926-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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.11 Appendix N.2.13). 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. Cc: Dan Williams Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Fabio M. De Francesco --- drivers/acpi/Kconfig | 2 ++ drivers/acpi/acpi_extlog.c | 24 ++++++++++++++++++++++++ drivers/cxl/core/ras.c | 3 ++- include/cxl/event.h | 2 ++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index ca00a5dbcf750..df0ff0764d0d5 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -494,6 +494,8 @@ config ACPI_EXTLOG tristate "Extended Error Log support" depends on X86_MCE && X86_LOCAL_APIC && EDAC select UEFI_CPER + select ACPI_APEI + select ACPI_APEI_GHES help Certain usages such as Predictive Failure Analysis (PFA) require more information about the error than what can be described in diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index 88a2237772c26..7ad3b36013cc6 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +163,23 @@ static void extlog_print_pcie(struct cper_sec_pcie *pc= ie_err, #endif } =20 +static void +extlog_cxl_cper_handle_prot_err(struct cxl_cper_sec_prot_err *prot_err, + int severity) +{ +#ifdef ACPI_APEI_PCIEAER + 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_handle_prot_err(&wd); +#endif +} + static int extlog_print(struct notifier_block *nb, unsigned long val, void *data) { @@ -213,6 +231,12 @@ static int extlog_print(struct notifier_block *nb, uns= igned long val, if (gdata->error_data_length >=3D 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 =3D + 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 =3D acpi_hest_get_payload(gdata); =20 diff --git a/drivers/cxl/core/ras.c b/drivers/cxl/core/ras.c index 2731ba3a07993..a90480d07c878 100644 --- a/drivers/cxl/core/ras.c +++ b/drivers/cxl/core/ras.c @@ -63,7 +63,7 @@ static int match_memdev_by_parent(struct device *dev, con= st void *uport) return 0; } =20 -static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *d= ata) +void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) { unsigned int devfn =3D PCI_DEVFN(data->prot_err.agent_addr.device, data->prot_err.agent_addr.function); @@ -104,6 +104,7 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_pr= ot_err_work_data *data) else cxl_cper_trace_uncorr_prot_err(cxlmd, data->ras_cap); } +EXPORT_SYMBOL_GPL(cxl_cper_handle_prot_err); =20 static void cxl_cper_prot_err_work_fn(struct work_struct *work) { diff --git a/include/cxl/event.h b/include/cxl/event.h index 94081aec597ae..ff97fea718d2c 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -340,4 +340,6 @@ cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_= err_work_data *wd, } #endif =20 +void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *wd); + #endif /* _LINUX_CXL_EVENT_H */ --=20 2.52.0