From nobody Sun Feb 8 03:57:15 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 B57C021B9D2; Fri, 17 Oct 2025 13:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708131; cv=none; b=eHq/OO0fSEiyTcNul8B/5d3FWLR0wmGdmeoWk5BczrY9KYC5gUr/ADObqpI9TUXsGtT1xZj6de+osWnV3dP4wVrT2A9fYOYzBHSQqwnDljnPP/mtT41zapBTq+jf4EeumUAgL0I/4NBaMM5sN8hDUT4xvZi03YZ+3+UyZ34kwPw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708131; c=relaxed/simple; bh=wPKd8yUUZ8RO1qltV90gZI04z5ZwdXSuIu40FGC5NBY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iPhn0NoC2vfOI5BokrOdHmM7vsYhMf6rT0XkZnnQnoZtpRsjbNiA+aq1ja6pFwzqCzVUheEC/GXN2bRMDCYJWmvHP5PN0YRMEWBRyqUMvtobEq4KGM+Du8ktyrtHfxSK6J2W2fZNzjvOZHyqwGMrNmLg3y37caSDcS7ykqEhbLU= 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=kah7rwah; arc=none smtp.client-ip=198.175.65.16 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="kah7rwah" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1760708129; x=1792244129; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wPKd8yUUZ8RO1qltV90gZI04z5ZwdXSuIu40FGC5NBY=; b=kah7rwahFUdpJK1ngzT0BUQUu9D/wTQbq64h+nutJAOAWM2nTfPwq+4i BkB4fin17Npns7HyVIzrZ9QPWFgKADrWbxCymHlNBTsGlot359GtAxEKR UzAAS7BfUeri/7iKmBZAkDdEPGXGoOn9a+pZD6Ex6xB8ZD5bO09n3oocu aescTrTc1ZYtsNT7iM17DAuN0WzN5ijCP9GT5/Ate0mtr1Xuazl2Fw9Be z+5YfXBGie9f73axAS9Pzfdm5u16Kb3jRWjodPPj3/6zi5eIBQp8KMQlS jxSJ4DuPTHkKhCMkRBb7+JNC8xFAZVJ8n6nxm1pmPjkGnyg1AZyB7OefE w==; X-CSE-ConnectionGUID: HqS8brfjQnyV3GKgQccETg== X-CSE-MsgGUID: oDtLJBc8T/StockPmIdBRA== X-IronPort-AV: E=McAfee;i="6800,10657,11585"; a="63064916" X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="63064916" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:34:31 -0700 X-CSE-ConnectionGUID: 9RiGHURCRZ2xt3lQF+2aoQ== X-CSE-MsgGUID: OyYsQh36SA+TbGK34FBtrA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="181925064" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.215]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:34:18 -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, Jonathan Cameron , Qiuxu Zhuo Subject: [PATCH 1/6 v5] ACPI: extlog: Trace CPER Non-standard Section Body Date: Fri, 17 Oct 2025 15:30:46 +0200 Message-ID: <20251017133357.1150982-2-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017133357.1150982-1-fabio.m.de.francesco@linux.intel.com> References: <20251017133357.1150982-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.10 Appendix N 2.3), extlog_print() does not. This gap was noticed by a RAS test that injected CXL protocol errors which were notified to extlog_print() via the IOMCA (I/O Machine Check Architecture) mechanism. Bring parity to the extlog_print() path by including a similar log_non_standard_event(). Cc: Dan Williams Reviewed-by: Dan Williams Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron 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 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.51.0 From nobody Sun Feb 8 03:57:15 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 65DCF34F49B; Fri, 17 Oct 2025 13:35:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708133; cv=none; b=lvxJDRocpgoQqeJka6z7Q0uGaX9PdRMxNJGd18StvFzWXEHhVZN5+zWw7cw3F3KkTidFtE4lYVra/TVOFXO4XU6vwGq03caLb/Oewtj922qUOgqtI1AP8Si/aXaQAlcwkwBsof+nlj7Xp8YsT0kC3erIXhzwCy7Fkjoc45aenPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708133; c=relaxed/simple; bh=bgRIanFRT2ymgqXRQN4d1TlIPDUlQDnyWlTaAtzoh/4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bEAamHxdqkDBTzRjTGJIcaIc73ocITuOd9pDjiYIHG+Zmok6fJr2gg6WaKtFlOZS9FvTFyS5kYfij9PWvoU511hOwzXUGGOHE0feqGouNQUluCdxO76S4zItyXSwsHsgi4IUQ6KcFryS81abcolVD1RhZv3/W8gKbJuI40MEQXI= 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=NX1SxlRI; arc=none smtp.client-ip=198.175.65.16 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="NX1SxlRI" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1760708131; x=1792244131; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bgRIanFRT2ymgqXRQN4d1TlIPDUlQDnyWlTaAtzoh/4=; b=NX1SxlRI/og828k+emat76F7Y8b5lg1zJX/sUHYp4iJQw4VrqHJwUZSm sIKktCX2WcpHo4v4dg2+M3UEnexojckxHB1ympSmYM9vjCEfZeraGsMGc WfdDFcJTh1JCitrD5yvtgELfbmoVN6SBJVPmQYv+bz7OcJtZHhBQqp2rs KUrmGX68QVPlfmv7O5GbdRz3dZdnqRajIBEhEbEaF8TlQUnRxcPVL4iIo H9WU39ZUyReyIyU5lsSGJMon9xqsI8SFj59ZW4ya9aT9hittSUnBbezsO JXPY84j7O/qGHD2Bno4dibUJMqTpOwiBBp28FwWvxZPNe4/i/saL4F6mt A==; X-CSE-ConnectionGUID: c1nkS7ufRc62PDwTz9+LbA== X-CSE-MsgGUID: DLHP2KeWS8i37QO2XNRrCw== X-IronPort-AV: E=McAfee;i="6800,10657,11585"; a="63064954" X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="63064954" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:34:45 -0700 X-CSE-ConnectionGUID: hAIrlatWQmKgJd0mEZo9kw== X-CSE-MsgGUID: IP+behsQSvSS5KNgVKZFNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="181925072" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.215]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:34:32 -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 2/6 v5] ACPI: extlog: Trace CPER PCI Express Error Section Date: Fri, 17 Oct 2025 15:30:47 +0200 Message-ID: <20251017133357.1150982-3-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017133357.1150982-1-fabio.m.de.francesco@linux.intel.com> References: <20251017133357.1150982-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.10, 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 | 1 + drivers/acpi/acpi_extlog.c | 32 ++++++++++++++++++++++++++++++++ drivers/pci/pcie/aer.c | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index ca00a5dbcf750..f8a97db075fcd 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -494,6 +494,7 @@ config ACPI_EXTLOG tristate "Extended Error Log support" depends on X86_MCE && X86_LOCAL_APIC && EDAC select UEFI_CPER + select ACPI_APEI_PCIEAER help Certain usages such as Predictive Failure Analysis (PFA) require more information about the error than what can be described in diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index 47d11cb5c9120..cefe8d2d8affc 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 0b5ed4722ac32..1b903e0644d6b 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.0 From nobody Sun Feb 8 03:57:15 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 CE4A73570D8; Fri, 17 Oct 2025 13:35:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708134; cv=none; b=XKZxaBLgWNa6/oaetqGB3Xx2oXzi9mh0NypBdJP3gGH/zIFMAIiv6BK0TJO9QTTHKM03WbvvszhUx1ewNNnTka4J0sNGvZQcfgyHNKfNHOjbf2+SRMbCLMPiJVhtWfCnf+eakWR1D8CSGoisKDZXnCUv+L4xaXivsup3wJ0aSkk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708134; c=relaxed/simple; bh=84zYUBs58TPuLt5DtEUEpeEKcZIouLRzd18oCcQNbrQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N2Pwmvov3qFvM60F+eF+4K7xI1XtPvaeWqqdF061bJjVEUft1TLc9L1K3Afgybk5+/9M/zw/s3kVqAFDHTL9xHat3NIZ4jZb2xQfwZK0ZxtMRDrOTb5ZTaPhhFkkjDq1Az2Sc4hrYAtZSw9B1XOKx/PN7m5ZP2VWpXRQjrqllf4= 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=Yq9jMMiZ; arc=none smtp.client-ip=198.175.65.16 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="Yq9jMMiZ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1760708132; x=1792244132; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=84zYUBs58TPuLt5DtEUEpeEKcZIouLRzd18oCcQNbrQ=; b=Yq9jMMiZ2cbe6MSB67nGTPfl1s8c1dclO9qifocAbIns7CnPe4Jm0opJ WvVm4BqSynsyOB5xqp07dHkNB2CYp09Sp00yvauPFaMJFzbwfjXaz8hty 029d+DHwqKdDJcRdmCvECPFEtd7vV7isk2UhKpN5QOWgNMf+MpDz8WRmR cJ8qQuJksvwYhQVGXBR2WFC6UBbTcYwqEru8B5Fy+U1BBweX6CfgqJm/A pr1BMSG4tsonNLQrGIR6Eny1hH7UrESDQGiwl39bP74xSDp1tDSdLkVtk /VfgcUnC/YY+K9iMIAvbjYSVOD4j6HmZvEpa+vMuFx4KKUmXO5rNkREgU Q==; X-CSE-ConnectionGUID: Gb7c6G6VQmG8dbblLTfJSg== X-CSE-MsgGUID: 8OEEP154TIKO9GqNIKRN2A== X-IronPort-AV: E=McAfee;i="6800,10657,11585"; a="63064991" X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="63064991" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:34:59 -0700 X-CSE-ConnectionGUID: YrbVSnjgSnCOxL/V4X/weg== X-CSE-MsgGUID: bk2G3qJwRzmBCUhwOxHDjQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="181925088" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.215]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:34:45 -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 3/6 v5] acpi/ghes: Select ACPI_APEI_PCIEAER for GHES Date: Fri, 17 Oct 2025 15:30:48 +0200 Message-ID: <20251017133357.1150982-4-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017133357.1150982-1-fabio.m.de.francesco@linux.intel.com> References: <20251017133357.1150982-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). Select ACPI_APEI_PCIEAER for GHES 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 | 1 + drivers/acpi/apei/ghes.c | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/acpi/apei/Kconfig b/drivers/acpi/apei/Kconfig index 070c07d68dfb2..c265b54d810dc 100644 --- a/drivers/acpi/apei/Kconfig +++ b/drivers/acpi/apei/Kconfig @@ -23,6 +23,7 @@ config ACPI_APEI_GHES select ACPI_HED select IRQ_WORK select GENERIC_ALLOCATOR + select ACPI_APEI_PCIEAER select ARM_SDE_INTERFACE if ARM64 help Generic Hardware Error Source provides a way to report diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 97ee19f2cae06..d6fe5f020e96e 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.0 From nobody Sun Feb 8 03:57:15 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 25830146585; Fri, 17 Oct 2025 13:35:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708144; cv=none; b=VSu4QM3Z8uWPEbJKYCxQ5JKoUS+zRih1D+Cy01/c1vYiGdzUPt96hM2UN2Q3IP4jLzvmAAwTgsNhrn0wWcCiwtrY7CTOjzoAioaTo+NcRtZr39k6njKwh8HFC+tmUUOVTdOer5SzhCZat+jkl7RUJZ7sfsQa7WwaXZYYbqESPUU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708144; c=relaxed/simple; bh=wEV3YwZtRuTemBv1zQt7Cmx6AAG3aqi5wz2vKBh//nc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PsivKR8WB1MhXir8UimzP6VuM9JtxwRKr9/RPY8hG2x5YCH1Q4qhyIt8tDlAD+73JA/nMI3slWJkepYky3RVS4KFLoFBr618hthZOPuz22lev5HluE4zVokxVaeziRpnlMyXKvJu+1rEqfUPvlkyz4kjaQzg4DJtXYHWzvoxels= 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=gKtANcpD; arc=none smtp.client-ip=198.175.65.16 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="gKtANcpD" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1760708143; x=1792244143; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wEV3YwZtRuTemBv1zQt7Cmx6AAG3aqi5wz2vKBh//nc=; b=gKtANcpDLThIXUG1r3D65zBMRQNW61wRGeB11l6fbijSHc5rE1ojg404 kYttqWXl+/jb415+dSqxoo3bA0SbN/TqZ5Ub0lOGiYkA4sie+OU9B1C1W GKRZlBefFsiQkk0PVj+4TRiWAQ47YAgVW+wFVfobWpBN5hqcrkpyv/SWl 50NzoBSMpMwAcnwRED6CrgIT+U4dL7mzLn5F/nYZlQplW6CWJnJ4r/SJK b/+gjEpiuGl6JZT9pU3pO1Eo3veQARfEF9Qa6/ukjfnKpPUOjoP1LN7d7 yUSjdigTmqU3D7mx5WB8cWFHeSub7QwG6pLaZ7sp5sKwA7t7QtsHSznPX w==; X-CSE-ConnectionGUID: uffzYFOIRcyAtbBYAoh1WA== X-CSE-MsgGUID: w3cRRXcVTd+DABQxf2pRXA== X-IronPort-AV: E=McAfee;i="6800,10657,11585"; a="63065029" X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="63065029" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:35:13 -0700 X-CSE-ConnectionGUID: K1JgY/+DS+66wNORjTzzJQ== X-CSE-MsgGUID: Ts7J9p6SSUmrc+mIW1x4lg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="181925252" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.215]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:35:00 -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 4/6 v5] acpi/ghes: Add helper for CPER CXL protocol errors checks Date: Fri, 17 Oct 2025 15:30:49 +0200 Message-ID: <20251017133357.1150982-5-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017133357.1150982-1-fabio.m.de.francesco@linux.intel.com> References: <20251017133357.1150982-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 checks out of cxl_cper_post_prot_err() to cxl_cper_sec_prot_err_valid() and check the serial number only for CXL agents that are CXL devices (UEFI v2.10, Appendix N.2.13). Signed-off-by: Fabio M. De Francesco --- 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 d6fe5f020e96e..e69ae864f43d3 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 6fd90f9cc2034..e1deb66c2197e 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 -EINVAL; +} +#endif + #endif /* _LINUX_CXL_EVENT_H */ --=20 2.51.0 From nobody Sun Feb 8 03:57:15 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 D0ADC33033E; Fri, 17 Oct 2025 13:35:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708146; cv=none; b=D1E6Vq4HLkWm8Jj7f6cfSWGqCebPudooIujLVExliluH4IC2J06LhCAvrjwAaUJW/uvRC6QJ2TbYSlEaEZOLZjXmcbgf850MC11+rh7soHWd5GvodkmGrihsc2O0GqR4LseqfHl5WD8URhtU+A5Lq1StGITXvEQdeUjWtGNXwPs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708146; c=relaxed/simple; bh=6cWsfVK2uywEugF7lxsG4Yh9ydRfGMntJrHORzhDVkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m9ECZOoIaA/5j50M5G58tNn21NByqboWCH7VfPZ2Mg5Gk0zyX5kqYOlEqcDUWL9R0FhQVhJCRx1i9DP9fnGdr3UKdxlW3WNa0oLtBtpstNJwX8tcY23KGXsNWWwJxfcWrPh36Hbi4cpYZnqEzV1Eupdf7RCVRJRIj02XdEk1QaM= 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=WzAim2Ft; arc=none smtp.client-ip=198.175.65.16 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="WzAim2Ft" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1760708144; x=1792244144; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6cWsfVK2uywEugF7lxsG4Yh9ydRfGMntJrHORzhDVkE=; b=WzAim2FtNaK35efn8dhpJJP5Y84aGIm5BoHU/qwmF7ewIiAzJCE7bSAK HXtJunTOs+qQj6ciZYLZwV9vf3efzdG2KhU0698aTxyEkpjNUq/Wp/TOo hr0Nw86998s2k6Q3waJklW/eIfzSRmosh3BFOsY4ErirOTnhzUDtVE7mT DkY/woI5P4l5DLO8jngxZcet0A94bsKCXThlf6182P7dmyuDGEEf9/gKX FmXNAr1JfBYXsa5R+r3lzDORr1JcKiKG7lYlN9eENQyRERblnXoSMBd9O 2BKXslX+ytDQx4J7Eps7SiM0Mc9zAb1YxOJbWWnrCfTFkMi9dZIy96rJ7 A==; X-CSE-ConnectionGUID: IqKjX1TWQYuRN+7JDWKy0Q== X-CSE-MsgGUID: WjNz5PaSQR2pcgQxwGderw== X-IronPort-AV: E=McAfee;i="6800,10657,11585"; a="63065069" X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="63065069" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:35:27 -0700 X-CSE-ConnectionGUID: gKeP+cXbT6ax9cP8SQcYig== X-CSE-MsgGUID: H6mglz3GRx+7F8DG4fPbXw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="181925286" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.215]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:35:14 -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 5/6 v5] acpi/ghes: Add helper to copy CXL protocol error info to work struct Date: Fri, 17 Oct 2025 15:30:50 +0200 Message-ID: <20251017133357.1150982-6-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017133357.1150982-1-fabio.m.de.francesco@linux.intel.com> References: <20251017133357.1150982-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. Signed-off-by: Fabio M. De Francesco --- 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 e69ae864f43d3..e0f8b8ed2b7c4 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_sec_prot_err_copy_to_wd(struct cxl_cper_prot_err_work_data *w= d, + 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_sec_prot_err_copy_to_wd); + +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_sec_prot_err_copy_to_wd(&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 e1deb66c2197e..5f06cea5d6005 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_sec_prot_err_copy_to_wd(struct cxl_cper_prot_err_work_data *w= d, + 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 -EINVAL; } +static inline int +cxl_cper_sec_prot_err_copy_to_wd(struct cxl_cper_prot_err_work_data *wd, + struct cxl_cper_sec_prot_err *prot_err, + int severity) +{ + return -EINVAL; +} #endif =20 #endif /* _LINUX_CXL_EVENT_H */ --=20 2.51.0 From nobody Sun Feb 8 03:57:15 2026 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 1525C3570C4; Fri, 17 Oct 2025 13:35:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708146; cv=none; b=FMxLlpO8IVbZ0+czEpDeXS7bEcokfeaQEmxo3Z9a/e9hM7h3g/khmeTp7RfQJFaPSk/Ip8UnU+7FMkvtgKmuEekDhn2aGeRLKavA8t9IVVOnlbiULghyuCa9OyLOlzVmKcoS48yEGvZ9pTsyOcZqY4vdYI7hRhW185rb0oBotcA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760708146; c=relaxed/simple; bh=7OqV225NxO84Qa7aP4Wuqs5k83WRf2r6PR4RfPnLQec=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GMKe7r5OENLB+F5XYL/ttt57mPbwKPyzmGiRmipOVns7DbAs9kL9tsvEH8m4tZRpLtdAojrnpV1SyDTnh7a5Rtg7Luvg8twXKW7F4HMyqcrgG+lM2ixrQ2L+apYMTnTu2t9M+VPRoDYsvlLc3R5FBh2l0PjqlYdq7wnJLAawifI= 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=Vqu9k8Zj; arc=none smtp.client-ip=198.175.65.16 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="Vqu9k8Zj" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1760708145; x=1792244145; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=7OqV225NxO84Qa7aP4Wuqs5k83WRf2r6PR4RfPnLQec=; b=Vqu9k8ZjNfX8tfCRQlWJSjdWVufYo6h7y4VRhypUOYqd4ZWhCok9/chZ ERH9+oi8NfKw7/t0am1nt8ZQN87AyF2db+u41iEDMsXqZmmUPhPYQfe3i 0d0a1gIA/xNzDRyT/XSFdoz+8focli6Pl+1nmJE5KRaV3nW6d/b07X9Xd m5tY4gnR3fZ4ieYq93TOS+dXhY/HWmwdse4+x4MtBeorJamZQqXc8tQm0 TayJTxp4eq3tS5Op/09g5lPSevxYM4PeUscS/DHTNYnKvTt2YksU1QgOy T+eK6443aeUhWdh9cdteoOKDzTt6v7wpvY2eukOEinqkvmm4TvXLSJlWe g==; X-CSE-ConnectionGUID: DHs8lmXJS0mWHehIpGjwCA== X-CSE-MsgGUID: pBYT0zdYTS2gKB8+VCQx3w== X-IronPort-AV: E=McAfee;i="6800,10657,11585"; a="63065104" X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="63065104" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:35:42 -0700 X-CSE-ConnectionGUID: n9d0JGLIRPKcLQivpZhn5Q== X-CSE-MsgGUID: 3oDAhQ/SQSSub8SOjYUUpA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.19,236,1754982000"; d="scan'208";a="181925296" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.215]) by orviesa010-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2025 06:35:28 -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 v5] ACPI: extlog: Trace CPER CXL Protocol Error Section Date: Fri, 17 Oct 2025 15:30:51 +0200 Message-ID: <20251017133357.1150982-7-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251017133357.1150982-1-fabio.m.de.francesco@linux.intel.com> References: <20251017133357.1150982-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 --- 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 cefe8d2d8affc..91dfb6300ecdf 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_sec_prot_err_copy_to_wd(&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 2731ba3a07993..3f527b0c6509c 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 5f06cea5d6005..b762506d229aa 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -340,4 +340,6 @@ cxl_cper_sec_prot_err_copy_to_wd(struct cxl_cper_prot_e= rr_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