From nobody Fri Dec 19 10:58:58 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 72AEE334363; Tue, 4 Nov 2025 18:25:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280708; cv=none; b=o+vjDKy8fH1qxcqIXwVzbstQaJCkHihOnDGMB4ylRq7hWIZ7kyl5ax8gEEL9MFUKdHuJTa1rVy822sdhxoErF3FxKqSTtAMxG5J6+7DI+TadmI1LJp3iF6rdlPDgOGOGvaSq0HZ+jzB14Y8MOKQfhppQvosSEcjIyU55AobQj6E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280708; c=relaxed/simple; bh=JIu0H882zeEEwASgSxIs/RNeqglbdddbmIWfUmz8pZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZaFnQROpOvrJDZ4hWfjzgdwVOT/imSihKQRVGHPprbQAHqpGIlufvwCcpaYm0zYmfDP3WJpGM6oCtejbcgjzEFuKWrHS/eyEwcI8fat1c4MSFMBcHBLyzQlCBe9m10iTNT+sslIqx70FLX3mRAccoafy/FDhhd0pE6Bx9UeZAEE= 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=Z4AxEtc/; arc=none smtp.client-ip=198.175.65.19 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="Z4AxEtc/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762280706; x=1793816706; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JIu0H882zeEEwASgSxIs/RNeqglbdddbmIWfUmz8pZM=; b=Z4AxEtc/9K+JRvTrK0lxqY1lMKmkLRiEgsnc4OEEtLuaWO1smAZ8iPBV 3yBEWkKi9zwrsR489kGAchL0uFcXMAM9ldLMIOZIoAGMiR5WKRKZ04k0K rFCj80swYopmZiC9y3CMdkF05R/S2Cv4Wh/dnB5630bUD4FQP6xGV0C7G MRuXVz42Hi5nqass+ivMQRvCPjJ8f4BQ19szAS8E6NYXzi22jWkud9Be+ IncOLLNOeuvuUh4PeW7HtcrwQKSEuEW2/z7Ux5skRNwas625FZB4jQGVE KdCnV6sZ+SmuN6bh6fcpCFO4kLJkabeszc1wNTWDjLcrP3sxZTMGbq75V Q==; X-CSE-ConnectionGUID: S7SuuvJ2QtG7vsCIVYxNUA== X-CSE-MsgGUID: 7ENhNzuDTkmWmzbgMbqWMA== X-IronPort-AV: E=McAfee;i="6800,10657,11603"; a="64269551" X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="64269551" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2025 10:25:05 -0800 X-CSE-ConnectionGUID: mTIV4eveQ4yH/f/YViQGWw== X-CSE-MsgGUID: QFkgXDdGSxCVwDeZlZjtvQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="191325244" 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:24:59 -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/6 v7] ACPI: extlog: Trace CPER Non-standard Section Body Date: Tue, 4 Nov 2025 19:22:32 +0100 Message-ID: <20251104182446.863422-2-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" 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 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 f6b9562779de..47d11cb5c912 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.51.1 From nobody Fri Dec 19 10:58:58 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 C3A90334363; Tue, 4 Nov 2025 18:25:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.15 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280719; cv=none; b=JQWPZYycX6/ngJL3xojOM21Nt4yc+Y05K+emzHD3NZcBTBcbkr/YBiTWVbeOavy1ARf6npzbDHIijNhYfLJQ+0/uh0cjHgN32mvhiBxJxhUylBt3emJ1JekuyWVzLEy4cfNB01FbBVXjHz/HtNmIL5o5vb1NoDlkYx3IZjsyIX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280719; c=relaxed/simple; bh=nhbt4srhoJt6kX/v4YJMSiHFh71zUOhgkVIdyC1vc9Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=r02Cn6j2PXITpRgqAyIVjzzfvwdyiHMd7WtCHg8rhHAg30fHtL0+8vQjpWWoYKGCfjljOT8qSmR3/RatCMFx9djH+0mzhT3T1FuOyWuG87UJip+GVAD0jxjhVchupBPlCRYEwFXsyBBHNxKUKHS8575SSPRmeQwDZDeLrq2ZJ00= 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=MthR8Xnp; arc=none smtp.client-ip=198.175.65.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="MthR8Xnp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762280718; x=1793816718; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=nhbt4srhoJt6kX/v4YJMSiHFh71zUOhgkVIdyC1vc9Y=; b=MthR8Xnpymkk6szht1DJh8rgQ38HZiJiqttV8/vMe3CmePV4834APQKk SPjVCmG/8Ec3SgJ/cXCK5EKog1vExkYGUORn4hynrQJXPQVBuHN9oCeQd 2Ptn21+G6K1VpxBXS2w125nUAzo6OM3ECz9E9sP5mEWFjqzJRj2cZI011 g0k7OfBghqa92g112n7eu1BoTh5G2kwK+9PIFQPyLZneJT1xvNwJBJeM4 Dc6EA4rsQQOSAO+x1fwRGChQbBaEKsiJW2PGflJ5zvkwFJgpBVF97FEGu 63oV2ZneTzzV4GZRXDQwt8Su0X7Lx8tmM1vaR4OjZUgvHfJC/i59zlOky A==; X-CSE-ConnectionGUID: tlUM9eKrQuG5zHCGdIhJCQ== X-CSE-MsgGUID: zpPeidVJSh2sO5KnbwuZhQ== X-IronPort-AV: E=McAfee;i="6800,10657,11603"; a="68040778" X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="68040778" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa107.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2025 10:25:13 -0800 X-CSE-ConnectionGUID: 7rXFkehdSG6ES/llyUnt3g== X-CSE-MsgGUID: hauzHddjRH2wxLDSXXOzeg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="191325264" 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:06 -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/6 v7] ACPI: extlog: Trace CPER PCI Express Error Section Date: Tue, 4 Nov 2025 19:22:33 +0100 Message-ID: <20251104182446.863422-3-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" 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/Kconfig | 6 +++++- drivers/acpi/acpi_extlog.c | 32 ++++++++++++++++++++++++++++++++ drivers/pci/pcie/aer.c | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index ca00a5dbcf75..be02634f2320 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -492,7 +492,11 @@ config ACPI_WATCHDOG =20 config ACPI_EXTLOG tristate "Extended Error Log support" - depends on X86_MCE && X86_LOCAL_APIC && EDAC + depends on X86_MCE && X86_LOCAL_APIC + select EDAC + select PCIEAER + select ACPI_APEI + select ACPI_APEI_PCIEAER select UEFI_CPER help Certain usages such as Predictive Failure Analysis (PFA) require diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index 47d11cb5c912..b3976ceb4ee4 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -132,6 +132,34 @@ static int print_extlog_rcd(const char *pfx, return 1; } =20 +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 =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); +} + 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, 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 0b5ed4722ac3..1b903e0644d6 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -971,7 +971,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.51.1 From nobody Fri Dec 19 10:58:58 2025 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.17]) (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 4CFBD335097; Tue, 4 Nov 2025 18:25:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.17 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280721; cv=none; b=T30NxZFL6AOuhrgOmyqTvaWKWL2nAIM13yNvFBT6Ujaq3XMIQGJbxmaiyYx5nO90LRik+OP9j50f7LSqGUhiDPcfIpdsktHg/srvs/5yxrdXE9/MgpvudqU2uCJWary2ik/9JlqOzIxnCO8kCtcpd61ama3d5O3gegyTVjmIelU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280721; c=relaxed/simple; bh=QnhXMP7wXOVrP174faH3L+NNwVmNt29iN5MSC3ZkiGw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sJqkMWrXLwaIy0RqLF8TkmGCNZ+/mUR+jX0Nc8YncklxfVLnVfQjFy7f7qqLambnSYRSMFDPU+FgzjFuI7uBZMhWDplBUfS8ZTS+E4eZD1VqvwC/UsRpfBmkL1UJSvzAoSV3RMzXkAPbw9Z3rbCjnJh6UXfC41th2z7GpRCOrmY= 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=XNxm05mg; arc=none smtp.client-ip=198.175.65.17 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="XNxm05mg" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762280719; x=1793816719; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=QnhXMP7wXOVrP174faH3L+NNwVmNt29iN5MSC3ZkiGw=; b=XNxm05mgOPpd8bjXHEnxAhNCXz7diOdlLrhrmqDHa5bJkl87tTdBw1qY B6Loag7iK3rE7sDrrqiFqNskLI7oe/VGvSRX7qFr6+Wk6Uabxae2aFM7u 3QkeID4gakQq7DZS9ClcL8TUcZidGw97VnfRFU8xOHVeHEK0DfBQCO85y Op4AJtTXAvey0KD95B0Tvp3jm+7BHrmepkpOmpwLMG4KEmO9kA5JMskVm IqElIltxlb3q8B/QgcJ5VXfK8DRTeW2NDKquLZUOJYlDO9ZQSYNd2N7Zg rMBNeHVXPV4BTkJrdhvnBlFXEBjROSz0Cf2W5rI5g2axLjJo2WjvJl2nH Q==; X-CSE-ConnectionGUID: x6O0u16QRfScNlWK5vGGHw== X-CSE-MsgGUID: N+4yg0GeSumvjw9Q8VUJ2Q== X-IronPort-AV: E=McAfee;i="6800,10657,11531"; a="64310728" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="64310728" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa109.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2025 10:25:18 -0800 X-CSE-ConnectionGUID: TFUlblptQpmM9/IBwY0GSw== X-CSE-MsgGUID: 5/n0eOw7TxOgKhGVuQFCFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="191325308" 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:13 -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/6 v7] acpi/ghes: Make GHES select ACPI_APEI_PCIEAER Date: Tue, 4 Nov 2025 19:22:34 +0100 Message-ID: <20251104182446.863422-4-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" GHES 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. Signed-off-by: Fabio M. De Francesco --- drivers/acpi/apei/Kconfig | 2 ++ drivers/acpi/apei/ghes.c | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 070c07d68dfb..cdf3cfa233b9 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig @@ -23,6 +23,8 @@ config ACPI_APEI_GHES select ACPI_HED select IRQ_WORK select GENERIC_ALLOCATOR + select PCIEAER + select ACPI_APEI_PCIEAER select ARM_SDE_INTERFACE if ARM64 help Generic Hardware Error Source provides a way to report diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 97ee19f2cae0..d6fe5f020e96 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -613,7 +613,6 @@ static bool ghes_handle_arm_hw_error(struct acpi_hest_g= eneric_data *gdata, */ static void ghes_handle_aer(struct acpi_hest_generic_data *gdata) { -#ifdef CONFIG_ACPI_APEI_PCIEAER struct cper_sec_pcie *pcie_err =3D acpi_hest_get_payload(gdata); =20 if (pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID && @@ -646,7 +645,6 @@ static void ghes_handle_aer(struct acpi_hest_generic_da= ta *gdata) (struct aer_capability_regs *) aer_info); } -#endif } =20 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; =20 @@ -767,7 +764,6 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_= prot_err *prot_err, } =20 schedule_work(cxl_cper_prot_err_work); -#endif } =20 int cxl_cper_register_prot_err_work(struct work_struct *work) --=20 2.51.1 From nobody Fri Dec 19 10:58:58 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 3C453335097; Tue, 4 Nov 2025 18:25:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280727; cv=none; b=VwuS0FXreh4aCHua415W/h4jxfjfZNPYu8Lbf9Pw8CmwCEAm1Xvhd/y/Dny3R0jJodh7gR9IfT8Zfy3TSHzLcshaYhhkVxKR8uUc8nqR09t87fU/03ayptuT3Kylcfh1ZYwpqmIla6GBCvA0hb0yVGz1AGYzVsU7yJRvmi8T8aQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280727; c=relaxed/simple; bh=juJtXgSRiOYqNUeFtIDyt8rosY/EPjrWHvZ2ju4d47g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IlRmqYKHGG62vGUOZtaByHpJWpcG9eZARFzqsZG6Cf+/otf5dV+wy6wyu3E6ZPhbrATJBAzd70QSa4Gn3m8rvb2USMFbHDjSrmZZ0tLMKGrFn/4LmiG6c80nZ9IQxddlpyrhmxFaPg049sffcbgXd/GQja5Uc2EdAlDERWK1xZA= 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=WNO8xnsA; arc=none smtp.client-ip=192.198.163.19 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="WNO8xnsA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762280726; x=1793816726; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=juJtXgSRiOYqNUeFtIDyt8rosY/EPjrWHvZ2ju4d47g=; b=WNO8xnsAxpj182AmrZxWdDHmU4S/CNGhsFJywxFtbhtWhC40OnK0Ls1p qCSp0zER7kxlRKnDzn5UTlhnI0MFzuczRN+eU4sTakSc4SvSsYr0iTJwJ zoL9kzohkKAPryHQu7AU0HFT2xx2T8NuuxdS3tliG08yu0hNHY4yX93pR SfHLJCZHn94cpeEltj3GiJfJh9MXsg5gphnXV/d7maPuvjeR/zQXM0u+a B1gym1tQbWm7+ejHW0Ffv2O3OAqEjymu/fNc+3LmAhXVjfQeCNFjx3GAv tPNWCTK6RrkbRk09C9QV3B3gONKWcHX0xrKEUDkfF6//kEaGqOwUzQRyD A==; X-CSE-ConnectionGUID: cWEziSosR2256WCeala49w== X-CSE-MsgGUID: hxUFiOLFRhOh7kw3XZNjtw== X-IronPort-AV: E=McAfee;i="6800,10657,11603"; a="63394796" X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="63394796" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2025 10:25:25 -0800 X-CSE-ConnectionGUID: 8m5SSZNuSw+bS+yaYbMORg== X-CSE-MsgGUID: HMQrkF8GQnGkdgOGnzhoCA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="191325327" 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:19 -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/6 v7] acpi/ghes: Add helper for CXL protocol errors checks Date: Tue, 4 Nov 2025 19:22:35 +0100 Message-ID: <20251104182446.863422-5-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" 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. Signed-off-by: Fabio M. De Francesco Reviewed-by: Dave Jiang > --- Reviewed-by: Hanjun Guo Reviewed-by: Jonathan Cameron --- drivers/acpi/apei/ghes.c | 32 ++++++++++++++++++++++---------- include/cxl/event.h | 10 ++++++++++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index d6fe5f020e96..e69ae864f43d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -706,30 +706,42 @@ static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cx= l_cper_prot_err_work_data, static DEFINE_SPINLOCK(cxl_cper_prot_err_work_lock); struct work_struct *cxl_cper_prot_err_work; =20 -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; } =20 if (!(prot_err->valid_bits & PROT_ERR_VALID_ERROR_LOG)) { pr_err_ratelimited("CXL CPER invalid protocol error log\n"); - return; + return -EINVAL; } =20 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; + return -EINVAL; } =20 - 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 =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); + +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; =20 guard(spinlock_irqsave)(&cxl_cper_prot_err_work_lock); =20 diff --git a/include/cxl/event.h b/include/cxl/event.h index 6fd90f9cc203..4d7d1036ea9c 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.51.1 From nobody Fri Dec 19 10:58:58 2025 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (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 A605433B970; Tue, 4 Nov 2025 18:25:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280734; cv=none; b=aig8OZuoYbMFs5WiRQJ71ZyzxskREzEAfZ6MtnmN4Z0a2w32czc5HsQbLj++1CeaNkyGCLS9UQ+c7k5pmY8lxjk/AegRkl8VUU+/L60wU7RuY7rEffZSjt8E35VgBu/XTuTNx2juHnCqJJTrPKKb17L1A8LFMa/WZ2piFNZ3ibc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762280734; c=relaxed/simple; bh=GBn/A1IbxV67Oj1kHdw3DMepECJGqqMVcqVRyVu6olg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eb3UrAVmXXggjNqT0ZILx5lMHzmdiiG+7Z2+HopZssFjGNKZ4AdedEz3qeQbcMc83L0WHAvODQQa2+1Z8MYp1nqUehY/iu2YH/Kk7isyG1Dfv2ahjoHpEvbmIYDEulC0w87HreUKWZ2O4S6HMHjEgZwfswxMYEE3OMP8KFvGgZU= 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=Cyp5yDMx; arc=none smtp.client-ip=192.198.163.13 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="Cyp5yDMx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1762280732; x=1793816732; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GBn/A1IbxV67Oj1kHdw3DMepECJGqqMVcqVRyVu6olg=; b=Cyp5yDMxgbMRf407/yxvVSngDFQwQN5tY9UGC/MW4HCO1ExslqF6nufA C4Q62CYYQRmxT6ntgvwXgi8Ox5gYzbbh5pJ9f2+8b3E0glQh/BUhhu9IS rDgxPIMF+SifJFimIIA3wlCGrdPnglK+Ijz4+AGETMUI9zTcOxoQUnI/V mv9AgsOdhabMZfG2EARV33iN5cdykg3Dff2NH6soWmconwI0/0EQYRdZ8 A7t8ZuHAnWbM6NiX1LyNpbLiUiIc+6yuu74tK0mYfkHSewWP3sYbXYYaQ bk78rMV4fC3kaK3+60ADXzNVFcqo4ZJgRXquDW91Aq/6RLMnJXYwFQqes w==; X-CSE-ConnectionGUID: vbph9f0bSsS/ePHJqMflZg== X-CSE-MsgGUID: INvR29V5Ss+UiC3/9n6Xfg== X-IronPort-AV: E=McAfee;i="6800,10657,11603"; a="67001218" X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="67001218" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Nov 2025 10:25:32 -0800 X-CSE-ConnectionGUID: ZS0uiCCCQyON71XiTKHqiQ== X-CSE-MsgGUID: 1qHsqwyZQgK1P5Ij5D3+EA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,279,1754982000"; d="scan'208";a="191325356" 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:26 -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 5/6 v7] acpi/ghes: Add helper to copy CXL protocol error info to work struct Date: Tue, 4 Nov 2025 19:22:36 +0100 Message-ID: <20251104182446.863422-6-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" 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: Jonathan Cameron Signed-off-by: Fabio M. De Francesco Reviewed-by: Dave Jiang > --- Reviewed-by: Hanjun Guo --- drivers/acpi/apei/ghes.c | 42 ++++++++++++++++++++++++++-------------- include/cxl/event.h | 10 ++++++++++ 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index e69ae864f43d..2f4632d9855a 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -734,20 +734,12 @@ int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_p= rot_err *prot_err) } EXPORT_SYMBOL_GPL(cxl_cper_sec_prot_err_valid); =20 -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; =20 - 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_se= c_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)); =20 dvsec_start =3D (u8 *)(prot_err + 1); cap_start =3D dvsec_start + prot_err->dvsec_len; =20 - memcpy(&wd.ras_cap, cap_start, sizeof(wd.ras_cap)); - wd.severity =3D cper_severity_to_aer(severity); + 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; + return -EINVAL; } =20 + 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; diff --git a/include/cxl/event.h b/include/cxl/event.h index 4d7d1036ea9c..94081aec597a 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.51.1 From nobody Fri Dec 19 10:58:58 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