From nobody Fri Dec 19 12:31:29 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.18]) (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 0A7A833EAEA; Tue, 4 Nov 2025 18:25:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280741; cv=none; b=PSNbZFAa38OGozVftPfXWbdziCvMeszy1uQ+sU4Kbab2Q3CgXhenvHHWNYdohjwbQ7fI2eczrJCY6aGCnKR7h+Lxbook4fMtsYtMe8GW4JcjBqfiQ6kvlBXBn25fHkm9qtljG0TNJjS/zcOS60gY0VBJ1ZVq8f6p7TDDsWvoCeY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280741; c=relaxed/simple; bh=1Fu4iM7tbneRIMbypPYeW7I7oM9KknGnXt01E741tEs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=euakAkRYgWXyfWSf3isXuufgl7C1WoIqronyVCHE54tBW3DiUWxQGCRgZcLBRaHo5Odtlfz5Mj8bAK3NUadAkMug0j6OlH7VnxfFYt4+H8sxYLUDosB2eN9yGuB07pYiqU+nVqxoAh9bbpvQcndJx39XKR1ULw8uWZotL3fe9n0= 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=eS/+hMqQ; arc=none smtp.client-ip=192.198.163.18 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="eS/+hMqQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762280740; x=1793816740; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1Fu4iM7tbneRIMbypPYeW7I7oM9KknGnXt01E741tEs=; b=eS/+hMqQ2PYFEhRstdUbDMagt+rlshByZnGIrzR9TdHwV58Z7aM1X+cz o+BvFUCkWIaZEwi8juCqx5CBMUa9SR6nFYBVGtanOEL38Pb5cLq4Ocmsw omL298mf2cgD3jo5MAfi8OGkXS7p325Fzd8j3roStdi8EErMqsTDnnOMO ZyLx/x+SoC8ghpaZro4FiO8P9LANLEgeO35EMHGi+wCwdvhE2U2sgzJDC LZROhozn1ZP1jxK3RLxTFHLl3rReF1EYQmYI2emHURq5erWPLdNF8dtLO D+h2o6bEaU5RpGRlzUxifdGef48J4vksSoZQdM8B9HFBL0zpiDlDz4oXY A==; X-CSE-ConnectionGUID: Mxz0LE6OQrycegHxVND2Bw== X-CSE-MsgGUID: lRlCVOyURI6fOIjiZmpOrQ== X-IronPort-AV: E=McAfee;i="6800,10657,11603"; a="63591213" X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="63591213" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa112.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2025 10:25:39 -0800 X-CSE-ConnectionGUID: VshGvM/2TPGyJ8OwJOTWtQ== X-CSE-MsgGUID: 4QWvbD9TTb6/n0rbmUSpxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="191325388" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.211]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2025 10:25:32 -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 6/6 v7] ACPI: extlog: Trace CPER CXL Protocol Error Section Date: Tue, 4 Nov 2025 19:22:37 +0100 Message-ID: <20251104182446.863422-7-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251104182446.863422-1-fabio.m.de.francesco@linux.intel.com> References: <20251104182446.863422-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: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Fabio M. De Francesco Reviewed-by: Dave Jiang > --- --- drivers/acpi/Kconfig | 1 + drivers/acpi/acpi_extlog.c | 22 ++++++++++++++++++++++ drivers/cxl/core/ras.c | 3 ++- include/cxl/event.h | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index be02634f2320..c2ad24e77ddf 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -498,6 +498,7 @@ config ACPI_EXTLOG select ACPI_APEI select ACPI_APEI_PCIEAER select UEFI_CPER + select CXL_BUS 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 b3976ceb4ee4..e6fb25395984 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_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..a90480d07c87 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 94081aec597a..ff97fea718d2 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.51.1