From nobody Mon Feb 9 01:21:05 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.9]) (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 0727F3009C1; Thu, 23 Oct 2025 12:27:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761222454; cv=none; b=JTfYoL+I0N9ST9Q0pnnzbd/c/Qy7Tyy0/NpoRMXhxuM73l/fCnGBWjHmccf5qEeSPEmn69JGGZNJ7NsCakZQCCgJRpqCwj0kQ4PdDXrGSb8noOP7iOCyP+7qPv9GnS2gmJuXNzDDnqHfkDqFuUyfPS05w9pCudrrZ8J9t5GhF6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761222454; c=relaxed/simple; bh=/SKJMBBXIi4BBnOq3DOm2MRNiysuabmj3qpcAOW/T14=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rOhOhSSHYJE/FuEabhXUd6vSKPQTqMHH1rMMIvIMDM1qd27+7mgVCqVp6vVnpTpaiyZXjORfuL8WPVUsTw/+p6XZu/hZviLe6uKZoNVuXRs8/ainpVtGX+0yN6Z7jnrjed2FYC/ki74bicNRI6JM3crljaYnw78cDQjTykSwvHU= 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=Xz/Z8lyO; arc=none smtp.client-ip=192.198.163.9 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="Xz/Z8lyO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1761222453; x=1792758453; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/SKJMBBXIi4BBnOq3DOm2MRNiysuabmj3qpcAOW/T14=; b=Xz/Z8lyOu0uxkexq3N4SLJeiIu9pZ9kRh6d00i1UJuFBLAlFax4/8p0N LPspWXX+PC9t56fYN19jlXfBi4yaFp+u43aXEs/rdmylJHXJYTi1MFgDC A3IX7FbY4E6c00htkxTiaG3S/3Q3TvXfou8Kkg1cjjoG16hfrrxLiRA5n UCW6sTDWdP9qOKFDDtDpU/nNNMM2EZH5/+yqNtYMy6v48IxS7d/AAYEae wa83F4R2fA0fhRmUye30m4FXKS66V6lhy8Ns1ZoUF6xqu8XOLhMwZSAPS ZzceJ90Xj4Dd7GNxInsYC+idUq2d/CiWFNr7UXhd3q2K9mcVwIHEi6lFJ A==; X-CSE-ConnectionGUID: a2e/9EDhRTOG5r7QiNZ7qA== X-CSE-MsgGUID: Veidp0jIQ0qwlS9csVLaPg== X-IronPort-AV: E=McAfee;i="6800,10657,11586"; a="74058050" X-IronPort-AV: E=Sophos;i="6.19,249,1754982000"; d="scan'208";a="74058050" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2025 05:27:32 -0700 X-CSE-ConnectionGUID: eVbxBb7SQ/i8LRB8thKqYA== X-CSE-MsgGUID: Ius4tWmQQ0C1CmpM/ISuzg== X-ExtLoop1: 1 Received: from unknown (HELO fdefranc-mobl3.igk.intel.com) ([10.237.142.160]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Oct 2025 05:27:21 -0700 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 , Sunil V L , Xiaofei Tan , Mario Limonciello , Huacai Chen , Heinrich Schuchardt , Arnd Bergmann , "Fabio M . De Francesco" , Peter Zijlstra , Ingo Molnar , Guo Weikang , Xin Li , Will Deacon , Huang Yiwei , Gavin Shan , Smita Koralahalli , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Li Ming , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Kuppuswamy Sathyanarayanan , Karolina Stolarek , Jon Pan-Doh , Lukas Wunner , Shiju Jose , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org Subject: [PATCH 6/6 v6] ACPI: extlog: Trace CPER CXL Protocol Error Section Date: Thu, 23 Oct 2025 14:25:41 +0200 Message-ID: <20251023122612.1326748-7-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251023122612.1326748-1-fabio.m.de.francesco@linux.intel.com> References: <20251023122612.1326748-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.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). Cc: Dan Williams Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Fabio M. De Francesco Reviewed-by: Jonathan Cameron --- drivers/acpi/acpi_extlog.c | 22 ++++++++++++++++++++++ drivers/cxl/core/ras.c | 6 ++++++ include/cxl/event.h | 2 ++ 3 files changed, 30 insertions(+) diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index cefe8d2d8aff..b005918517d1 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -160,6 +161,21 @@ static void extlog_print_pcie(struct cper_sec_pcie *pc= ie_err, pci_dev_put(pdev); } =20 +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, 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 2731ba3a0799..3f527b0c6509 100644 --- a/drivers/cxl/core/ras.c +++ b/drivers/cxl/core/ras.c @@ -105,6 +105,12 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_p= rot_err_work_data *data) cxl_cper_trace_uncorr_prot_err(cxlmd, data->ras_cap); } =20 +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; diff --git a/include/cxl/event.h b/include/cxl/event.h index 94081aec597a..a37eef112411 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_ras_handle_prot_err(struct cxl_cper_prot_err_work_data *wd); + #endif /* _LINUX_CXL_EVENT_H */ --=20 2.51.0