From nobody Sun Feb 8 01:22:45 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 D7EA274C14; Fri, 19 Dec 2025 12:41:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148062; cv=none; b=f9tDOQQKP5JmwDQDzTiSXhI+kY3CrwkKdmoY65shCTy4MYpvOyNKXHQ6UbBeEXwRi0yJid66UMHRAbBpLQlQX5ygb2RqnbiuwowLrVTH/RYEuPr4SmRthX/FoEp9+bXL820y2qA+RSjPYcgVUw6f5pAtB850lgE4v+jeM8Ovn3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148062; c=relaxed/simple; bh=EQyaSRv2w/jZw5GCerkw7EGbCpvexnkcYc/L8RPqTcw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MjLpgGfKKdlqPZ6B6pdhE2/rYve+zAWaGqyIHlqIEnKFalcenGErRb/Ac0Qk9Rlq6sVyQbgfyxFVcthT58H+p/YXXXvex0KD/w2zMGO/0vrADa7wR/a6kuruoKtP2k3xXk2NYTfik+6upGEFisO/0sihPkNF5Lp5NKNsgU/k4Lg= 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=ODGorOGy; arc=none smtp.client-ip=192.198.163.11 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="ODGorOGy" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1766148061; x=1797684061; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EQyaSRv2w/jZw5GCerkw7EGbCpvexnkcYc/L8RPqTcw=; b=ODGorOGyYbXSOqg/exlE72et3wEe1x38ee/Gy3Fq6kChoPNUq5MS0feI iNhw2AfybcqmpvaLthbkgtXI0RKmJXN6eUt2CoAl2dw/0DC6m3PTdlHgR 4uX2017iUjPetsa9HlFT3E3kwPiZnUPLireejb090Qr9UrDnJ+tXX7rSP hWw0Qk7DFWWzR+3ArWuA65UaMbejW1qNGJyD82AmQeNNlGRs/OfogH0GC bDJB9TNSpOt760o077McFCcNkhBlfvvMUacc4zFdEorc3NeCoZMtagUIM BdFCr1S+PKsVIp6xQ93t8NdHV8I8ta+RMblADhfjH+9Dpzk3aS1FypYX8 w==; X-CSE-ConnectionGUID: 37pHIzCtQpmEBcMWVXFEZQ== X-CSE-MsgGUID: PoP32FFiTu6lZAj6USlxNw== X-IronPort-AV: E=McAfee;i="6800,10657,11646"; a="78742705" X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="78742705" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41:00 -0800 X-CSE-ConnectionGUID: xl+YCUIBQbqwZlhYPX8/tg== X-CSE-MsgGUID: wJiKn0tRR+e6iMG0x6N5kQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="198444382" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.52]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:40:54 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" , Jonathan Cameron , Kuppuswamy Sathyanarayanan , Qiuxu Zhuo Subject: [PATCH 1/5 v8] ACPI: extlog: Trace CPER Non-standard Section Body Date: Fri, 19 Dec 2025 13:39:40 +0100 Message-ID: <20251219124042.3759749-2-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> References: <20251219124042.3759749-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 Reviewed-by: Shuai Xue --- drivers/acpi/acpi_extlog.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index f6b9562779de0..47d11cb5c9120 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -183,6 +183,12 @@ static int extlog_print(struct notifier_block *nb, uns= igned long val, if (gdata->error_data_length >=3D sizeof(*mem)) trace_extlog_mem_event(mem, err_seq, fru_id, fru_text, (u8)gdata->error_severity); + } else { + void *err =3D acpi_hest_get_payload(gdata); + + log_non_standard_event(sec_type, fru_id, fru_text, + gdata->error_severity, err, + gdata->error_data_length); } } =20 --=20 2.52.0 From nobody Sun Feb 8 01:22:45 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 6577E74C14; Fri, 19 Dec 2025 12:41:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148069; cv=none; b=u0TOl2AkbfaIXaZk1yHzFChWSClT8q/0Vz5yVl2AhcHAybte7Wby8G5i975ckmma/hwYWaWPh06QuTQa3nmUdMfO3VDj6lgnSLTg1c0BHQ2Ea5Vk2wv4MUknuR3JWJfAJb6n9GySq8a8q+WaXEFzmojEMGcBBbKwvj39NCsS+lc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148069; c=relaxed/simple; bh=qBAGDUoxoUz1GVnALDeA12vJreI1EPv7zHhPC8BpEP4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nWMLCxwO/j1HjufNQjFdps6PuM6+8olfvYT71OnNVLL2nJTv6sr/2q0XS3WON+ePt6BAD1YBVQbuHRtTrOxqzrPbrZFKjHDIMEBLi43qbxXpHLenJC3UBbP1lKzFfcDd+pgbueyGakFtLl+ynNMqHxpHp8kDdrs9ex1kW5W6KHk= 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=kyHY6w0f; arc=none smtp.client-ip=192.198.163.11 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="kyHY6w0f" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1766148066; x=1797684066; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qBAGDUoxoUz1GVnALDeA12vJreI1EPv7zHhPC8BpEP4=; b=kyHY6w0fiqqhiXaPEybqZFT033VRjEcscwBXeDrb2fcXb2omYBjSB85f jaNyF1ZU0zcWpmoYFErfHcgivplH1GaBa6M/YvMl3BmZ7s+cw/LnuvKb1 Lq8gYOjbAF3FcvRvOwtloePc7D5OjrEUdBwB1rpxphAa6bHjYhRoha6gk YtggKh8kNXCfTsZC/vk8QrKsc9bnOdwdh0bMwV1cbZiXrA/G4lmC65aav 3eEtdkTPL62tDGFfBTBXysjEhxJ5eNfDSMiX7EWTwSYa9VFamQzedUjtq YHj3ln0M6mNIDBTaLr1nH5aKwRcq7nVKdEfi936VUf8CLJA+7bwOMd8+T w==; X-CSE-ConnectionGUID: bHN5rbVNRo6t5qJfDL7lxg== X-CSE-MsgGUID: B6nOTcYdRMyryaH+uTJp6g== X-IronPort-AV: E=McAfee;i="6800,10657,11646"; a="78742717" X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="78742717" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41:06 -0800 X-CSE-ConnectionGUID: JV1KnbaxQt23YuFmIBPhWQ== X-CSE-MsgGUID: aOJ52LCiSSKLzXtMLLJWFw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="198444401" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.52]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41:00 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" Subject: [PATCH 2/5 v8] ACPI: extlog: Trace CPER PCI Express Error Section Date: Fri, 19 Dec 2025 13:39:41 +0100 Message-ID: <20251219124042.3759749-3-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> References: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" I/O Machine Check Architecture events may signal failing PCIe components or links. The AER event contains details on what was happening on the wire when the error was signaled. Trace the CPER PCIe Error section (UEFI v2.11, Appendix N.2.7) reported by the I/O MCA. Cc: Dan Williams Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Signed-off-by: Fabio M. De Francesco --- drivers/acpi/acpi_extlog.c | 34 ++++++++++++++++++++++++++++++++++ drivers/pci/pcie/aer.c | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index 47d11cb5c9120..88a2237772c26 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -132,6 +132,36 @@ static int print_extlog_rcd(const char *pfx, return 1; } =20 +static void extlog_print_pcie(struct cper_sec_pcie *pcie_err, + int severity) +{ +#ifdef ACPI_APEI_PCIEAER + struct aer_capability_regs *aer; + struct pci_dev *pdev; + unsigned int devfn; + unsigned int bus; + int aer_severity; + int domain; + + if (!(pcie_err->validation_bits & CPER_PCIE_VALID_DEVICE_ID && + pcie_err->validation_bits & CPER_PCIE_VALID_AER_INFO)) + return; + + aer_severity =3D cper_severity_to_aer(severity); + aer =3D (struct aer_capability_regs *)pcie_err->aer_info; + domain =3D pcie_err->device_id.segment; + bus =3D pcie_err->device_id.bus; + devfn =3D PCI_DEVFN(pcie_err->device_id.device, + pcie_err->device_id.function); + pdev =3D pci_get_domain_bus_and_slot(domain, bus, devfn); + if (!pdev) + return; + + pci_print_aer(pdev, aer_severity, aer); + pci_dev_put(pdev); +#endif +} + static int extlog_print(struct notifier_block *nb, unsigned long val, void *data) { @@ -183,6 +213,10 @@ static int extlog_print(struct notifier_block *nb, uns= igned long val, if (gdata->error_data_length >=3D sizeof(*mem)) trace_extlog_mem_event(mem, err_seq, fru_id, fru_text, (u8)gdata->error_severity); + } else if (guid_equal(sec_type, &CPER_SEC_PCIE)) { + struct cper_sec_pcie *pcie_err =3D acpi_hest_get_payload(gdata); + + extlog_print_pcie(pcie_err, gdata->error_severity); } else { void *err =3D acpi_hest_get_payload(gdata); =20 diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c index e0bcaa896803c..71ee4f5064ded 100644 --- a/drivers/pci/pcie/aer.c +++ b/drivers/pci/pcie/aer.c @@ -973,7 +973,7 @@ void pci_print_aer(struct pci_dev *dev, int aer_severit= y, pcie_print_tlp_log(dev, &aer->header_log, info.level, dev_fmt(" ")); } -EXPORT_SYMBOL_NS_GPL(pci_print_aer, "CXL"); +EXPORT_SYMBOL_GPL(pci_print_aer); =20 /** * add_error_device - list device to be handled --=20 2.52.0 From nobody Sun Feb 8 01:22:45 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 DEEE4329C70; Fri, 19 Dec 2025 12:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148073; cv=none; b=MQwmm3Dy+ArQTKejaWQq53qMxREAaOgL1p8WNhruKHFXvyrzVfOuKPL0fYKpQ3/FqBYbzaDh3bWamYTibdOi9eDL+UO3r7ix31SjtpO07k4DNhvibjoJpvV8sCjVmOacqYkOmGPrQI9ciFqJhzYnwJJOkzsUX5lkYXDNdZgw8K4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148073; c=relaxed/simple; bh=xtGkngAANOsjOQY4ax0NDddGMXb8GpZwHOBIxpkLkGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YwEANNsATPYwISbjmSnqKEdwbP/G6ukZX/wl8EY7HkhwWWe9kqwICNG0CWGCvk41HLsT8+ssBbUB66uDxE+/x31uebeAFuxNIXwNiTjFrfAkzdLgxaPbfvG+VQoJndbChiflSjSAN920AJIA2YJ0oH8hFZVCVycInjCL6q4o6N4= 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=BAak62jO; arc=none smtp.client-ip=192.198.163.11 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="BAak62jO" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1766148072; x=1797684072; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xtGkngAANOsjOQY4ax0NDddGMXb8GpZwHOBIxpkLkGg=; b=BAak62jOwNNSGGzLBRQrK0yd1Ctdck6shU28iXxL21LdcXJCYKcMjntK jfhqmqT/U3b0UBjSXX0MDB5KFlyjue5S1KJBsRkrVij8LKj3uCtHR3Ovh cqagL9iOVsMI2+L3dL5TqTzApouWllwSZKzDSEz04qK6Zij+pLQn9EEgv XvK283D2cipeABMf3VviQSYYvys7laf15pzd7vHOTXPUrrUM34OP9ymwl GW4VyVviaH2wYIB0hQAPE4T48Abdj5KXyKJsm05kD8a7q98L/+Jl3fRAF JX79b6t7rx6ZKhKtVSnT3XUVjPRtUQOLFQIElLQHMVAaeUeuURjGDycV1 A==; X-CSE-ConnectionGUID: CqVfqbXdS7Krlt3NAjGBeQ== X-CSE-MsgGUID: dh5Ci/CgQweAbYVNYnaTJw== X-IronPort-AV: E=McAfee;i="6800,10657,11646"; a="78742731" X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="78742731" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41:11 -0800 X-CSE-ConnectionGUID: mnVNdJvhQm+gt9YRWNi9/Q== X-CSE-MsgGUID: hGhj7prCQaqNlZcEkzsvrQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="198444419" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.52]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41: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 3/5 v8] acpi/ghes: Add helper for CPER CXL protocol errors checks Date: Fri, 19 Dec 2025 13:39:42 +0100 Message-ID: <20251219124042.3759749-4-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> References: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move the CPER CXL protocol errors validity check out of cxl_cper_post_prot_err() to new cxl_cper_sec_prot_err_valid() and limit the serial number check only to CXL agents that are CXL devices (UEFI v2.10, Appendix N.2.13). Export the new symbol for reuse by ELOG. Reviewed-by: Dave Jiang Reviewed-by: Hanjun Guo Reviewed-by: Jonathan Cameron Signed-off-by: Fabio M. De Francesco --- drivers/acpi/apei/Makefile | 1 + drivers/acpi/apei/ghes.c | 18 +----------------- drivers/acpi/apei/ghes_helpers.c | 32 ++++++++++++++++++++++++++++++++ include/cxl/event.h | 10 ++++++++++ 4 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 drivers/acpi/apei/ghes_helpers.c diff --git a/drivers/acpi/apei/Makefile b/drivers/acpi/apei/Makefile index 2c474e6477e12..5db61dfb46915 100644 --- a/drivers/acpi/apei/Makefile +++ b/drivers/acpi/apei/Makefile @@ -1,6 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 obj-$(CONFIG_ACPI_APEI) +=3D apei.o obj-$(CONFIG_ACPI_APEI_GHES) +=3D ghes.o +obj-$(CONFIG_ACPI_APEI_PCIEAER) +=3D ghes_helpers.o obj-$(CONFIG_ACPI_APEI_EINJ) +=3D einj.o einj-y :=3D einj-core.o einj-$(CONFIG_ACPI_APEI_EINJ_CXL) +=3D einj-cxl.o diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 0dc767392a6c6..cc4cc7ee8422d 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -713,24 +713,8 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec= _prot_err *prot_err, struct cxl_cper_prot_err_work_data wd; u8 *dvsec_start, *cap_start; =20 - if (!(prot_err->valid_bits & PROT_ERR_VALID_AGENT_ADDRESS)) { - pr_err_ratelimited("CXL CPER invalid agent type\n"); + if (cxl_cper_sec_prot_err_valid(prot_err)) return; - } - - if (!(prot_err->valid_bits & PROT_ERR_VALID_ERROR_LOG)) { - pr_err_ratelimited("CXL CPER invalid protocol error log\n"); - return; - } - - if (prot_err->err_len !=3D sizeof(struct cxl_ras_capability_regs)) { - pr_err_ratelimited("CXL CPER invalid RAS Cap size (%u)\n", - prot_err->err_len); - return; - } - - if (!(prot_err->valid_bits & PROT_ERR_VALID_SERIAL_NUMBER)) - pr_warn(FW_WARN "CXL CPER no device serial number\n"); =20 guard(spinlock_irqsave)(&cxl_cper_prot_err_work_lock); =20 diff --git a/drivers/acpi/apei/ghes_helpers.c b/drivers/acpi/apei/ghes_help= ers.c new file mode 100644 index 0000000000000..e5f65f57d9ec7 --- /dev/null +++ b/drivers/acpi/apei/ghes_helpers.c @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: GPL-2.0-only +// Copyright(c) 2025 Intel Corporation. All rights reserved + +#include + +int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err) +{ + if (!(prot_err->valid_bits & PROT_ERR_VALID_AGENT_ADDRESS)) { + pr_err_ratelimited("CXL CPER invalid agent type\n"); + return -EINVAL; + } + + if (!(prot_err->valid_bits & PROT_ERR_VALID_ERROR_LOG)) { + pr_err_ratelimited("CXL CPER invalid protocol error log\n"); + return -EINVAL; + } + + if (prot_err->err_len !=3D sizeof(struct cxl_ras_capability_regs)) { + pr_err_ratelimited("CXL CPER invalid RAS Cap size (%u)\n", + prot_err->err_len); + return -EINVAL; + } + + if ((prot_err->agent_type =3D=3D RCD || prot_err->agent_type =3D=3D DEVIC= E || + prot_err->agent_type =3D=3D LD || prot_err->agent_type =3D=3D FMLD) = && + !(prot_err->valid_bits & PROT_ERR_VALID_SERIAL_NUMBER)) + pr_warn_ratelimited(FW_WARN + "CXL CPER no device serial number\n"); + + return 0; +} +EXPORT_SYMBOL_GPL(cxl_cper_sec_prot_err_valid); diff --git a/include/cxl/event.h b/include/cxl/event.h index 6fd90f9cc2034..4d7d1036ea9cb 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -320,4 +320,14 @@ static inline int cxl_cper_prot_err_kfifo_get(struct c= xl_cper_prot_err_work_data } #endif =20 +#ifdef CONFIG_ACPI_APEI_PCIEAER +int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err); +#else +static inline int +cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err) +{ + return -EOPNOTSUPP; +} +#endif + #endif /* _LINUX_CXL_EVENT_H */ --=20 2.52.0 From nobody Sun Feb 8 01:22:45 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 DEB4A2D7DE3; Fri, 19 Dec 2025 12:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148080; cv=none; b=Tky4QX848/GyrqQRyInA53Wz9hNlPPGJcPb3xeJG3R0uh1ZXKlIrvsLLFVgz3hy7RRC5QwpscgkZ/NpQxr5/BA8ifP1q1fLOiwhZpgGGsFxNTYMjDnAzUTsLRbO4W02I95h3z5kttp0cw+WT3aA9wcCrvzNHpUshgtblWoIyy+g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148080; c=relaxed/simple; bh=bMRmGR1rGj4puoieARiNtp/gc4NLDWlWUing+a+sS1g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ltVNNpQcKaYYhZbRifci+AczUh4PkrL123f9KENPV74AdYr+x6jroUUkIaz31gdDqBbEtCXEw54i/mVuNGT+sNG1WaSCEigTRB/93R1/nk3sBnY5ZcykAzhN0+lj/B0cvab2VmJ0JMCPX0rHDKrEZah23Pmh39x2PJybtfHKbnU= 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=LdUlP+xf; arc=none smtp.client-ip=192.198.163.11 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="LdUlP+xf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1766148078; x=1797684078; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=bMRmGR1rGj4puoieARiNtp/gc4NLDWlWUing+a+sS1g=; b=LdUlP+xfmcneijlqWJzWEpaKYCxwIW7kVKcKlBduLwx9QUlUma4Obal6 INqW7IxnxXvTcqGiOjVNkaglBodZkyCn96hlPSIeU7759g8RXq9H16N2H l4HcERWAGdQrawsEfW0FRdTD9wxM+DMBdOXjgUm2ckVj/YB7isvOZxIna 2gQzbxmPYX0ruIc9CzIvHKsq9Lm1IwUGcou8Y+4HMV7i/L84Gf9PcBPO8 kn+IcQsMgTA6t6TaTYyPKB7AnGkwvk9IKCrtVN7eLq71PSfHLO8kJ/ZtK qySIgMrWeLS7EWOGQkbPiC61OWUfNigAIGlyCmlNJYDl5W2WFMznei4zm Q==; X-CSE-ConnectionGUID: mD1C63YQSK64Nj36qD29ig== X-CSE-MsgGUID: D1jWcGOkRAyYGcvRQ/lfBQ== X-IronPort-AV: E=McAfee;i="6800,10657,11646"; a="78742746" X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="78742746" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41:17 -0800 X-CSE-ConnectionGUID: H3MnhiU1To6NKkiRpLISDg== X-CSE-MsgGUID: Jdb60cRFRhSXGqIZaj8JAQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="198444429" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.52]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41:11 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" Subject: [PATCH 4/5 v8] acpi/ghes: Add helper to copy CPER CXL protocol error info to work struct Date: Fri, 19 Dec 2025 13:39:43 +0100 Message-ID: <20251219124042.3759749-5-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> References: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Make a helper out of cxl_cper_post_prot_err() that checks the CXL agent type and copy the CPER CXL protocol errors information to a work data structure. Export the new symbol for reuse by ELOG. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Hanjun Guo Signed-off-by: Fabio M. De Francesco --- drivers/acpi/apei/ghes.c | 22 +-------------------- drivers/acpi/apei/ghes_helpers.c | 33 ++++++++++++++++++++++++++++++++ include/cxl/event.h | 10 ++++++++++ 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index cc4cc7ee8422d..79755587871fa 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -711,7 +711,6 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_= prot_err *prot_err, { #ifdef CONFIG_ACPI_APEI_PCIEAER struct cxl_cper_prot_err_work_data wd; - u8 *dvsec_start, *cap_start; =20 if (cxl_cper_sec_prot_err_valid(prot_err)) return; @@ -721,27 +720,8 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec= _prot_err *prot_err, if (!cxl_cper_prot_err_work) return; =20 - switch (prot_err->agent_type) { - case RCD: - case DEVICE: - case LD: - case FMLD: - case RP: - case DSP: - case USP: - memcpy(&wd.prot_err, prot_err, sizeof(wd.prot_err)); - - dvsec_start =3D (u8 *)(prot_err + 1); - cap_start =3D dvsec_start + prot_err->dvsec_len; - - memcpy(&wd.ras_cap, cap_start, sizeof(wd.ras_cap)); - wd.severity =3D cper_severity_to_aer(severity); - break; - default: - pr_err_ratelimited("CXL CPER invalid agent type: %d\n", - prot_err->agent_type); + if (cxl_cper_setup_prot_err_work_data(&wd, prot_err, severity)) return; - } =20 if (!kfifo_put(&cxl_cper_prot_err_fifo, wd)) { pr_err_ratelimited("CXL CPER kfifo overflow\n"); diff --git a/drivers/acpi/apei/ghes_helpers.c b/drivers/acpi/apei/ghes_help= ers.c index e5f65f57d9ec7..8b7f330c97b29 100644 --- a/drivers/acpi/apei/ghes_helpers.c +++ b/drivers/acpi/apei/ghes_helpers.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only // Copyright(c) 2025 Intel Corporation. All rights reserved =20 +#include #include =20 int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err) @@ -30,3 +31,35 @@ int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot= _err *prot_err) return 0; } EXPORT_SYMBOL_GPL(cxl_cper_sec_prot_err_valid); + +int cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_err_work_data *= wd, + struct cxl_cper_sec_prot_err *prot_err, + int severity) +{ + u8 *dvsec_start, *cap_start; + + switch (prot_err->agent_type) { + case RCD: + case DEVICE: + case LD: + case FMLD: + case RP: + case DSP: + case USP: + memcpy(&wd->prot_err, prot_err, sizeof(wd->prot_err)); + + dvsec_start =3D (u8 *)(prot_err + 1); + cap_start =3D dvsec_start + prot_err->dvsec_len; + + memcpy(&wd->ras_cap, cap_start, sizeof(wd->ras_cap)); + wd->severity =3D cper_severity_to_aer(severity); + break; + default: + pr_err_ratelimited("CXL CPER invalid agent type: %d\n", + prot_err->agent_type); + return -EINVAL; + } + + return 0; +} +EXPORT_SYMBOL_GPL(cxl_cper_setup_prot_err_work_data); diff --git a/include/cxl/event.h b/include/cxl/event.h index 4d7d1036ea9cb..94081aec597ae 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -322,12 +322,22 @@ static inline int cxl_cper_prot_err_kfifo_get(struct = cxl_cper_prot_err_work_data =20 #ifdef CONFIG_ACPI_APEI_PCIEAER int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err); +int cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_err_work_data *= wd, + struct cxl_cper_sec_prot_err *prot_err, + int severity); #else static inline int cxl_cper_sec_prot_err_valid(struct cxl_cper_sec_prot_err *prot_err) { return -EOPNOTSUPP; } +static inline int +cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_err_work_data *wd, + struct cxl_cper_sec_prot_err *prot_err, + int severity) +{ + return -EOPNOTSUPP; +} #endif =20 #endif /* _LINUX_CXL_EVENT_H */ --=20 2.52.0 From nobody Sun Feb 8 01:22:45 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) (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 3EC4232ABC1; Fri, 19 Dec 2025 12:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.11 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148085; cv=none; b=ZP1qTn53J/vIPD42ZVs51shPKmTUPQrsIQ4rfQ/CDSaSmgVwhdLc3IzEb7TCZ6LIYf82LkTO8cXpqG1mY5GPk6K8Uhuh2dzDMzk1ujQn1xOCWLdTJd4rgIhiHlZ08ZQV7c/qvo0UIOSWBRP/rlh5hzjjGGpRBAjraqUKJn1Umqs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766148085; c=relaxed/simple; bh=YiVlGQCr+FTIJ4B2/AoJNeziKA/MhUEzfyR0foaLu2g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=husHebaQxETbJKsZhwV+hYjnOHPdjzCzeu05QvunEn4S2PGtlaKzk6jn6S3tUH2xY3YvqPnr0SlXEnL0z19O2/cpWS0pNmp7kXE44ttGi7C6ow3nkIJ/odkFJlfXMA5cMcnD05sLYRqvr88J/Hx8FNVfJ8VQXkrUXbyatAItV2s= 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=i2UGar3y; arc=none smtp.client-ip=192.198.163.11 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="i2UGar3y" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1766148083; x=1797684083; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=YiVlGQCr+FTIJ4B2/AoJNeziKA/MhUEzfyR0foaLu2g=; b=i2UGar3yXwWQbaAHjyKf6qzFrUqkP1yEVIG//RjHIWT1TySNftplhsXI xXj8jwgRu96qpsjPIMtp2QqQDIwH4p4fbCloSQn01xdGkgWLel0hKoPu7 pzXxcTctHzDUzObhkVXIm27jLj4fQcgV0N18JLjQBIPbhKokpmX3JKonS +hcTClf63fjFS0780PDgiyBh1Z1j7BUuKjq+bO+mXirltCF3GwJ0b2Ijh s+sbQJJjghgdNJwW0umAR9nzk0cR4Bk/5oWrKGsqIfuoSZsgd1OLb7GIW iTM3OEV/XXHa0pvEhWHJl3dtxezjSuuixcTF2aoHhuRHvio7QdO2Eg+RJ Q==; X-CSE-ConnectionGUID: COthT8mgRHqM5Y+8B14zpA== X-CSE-MsgGUID: zqK5nn2SSTOz7XLAmUdKww== X-IronPort-AV: E=McAfee;i="6800,10657,11646"; a="78742760" X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="78742760" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41:23 -0800 X-CSE-ConnectionGUID: /mUh9VRuT1iN9qqHBweqWg== X-CSE-MsgGUID: dTwCf6M5QyixEW97DiZ4Pw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,161,1763452800"; d="scan'208";a="198444435" Received: from fdefranc-mobl3.ger.corp.intel.com (HELO fdefranc-mobl3.intel.com) ([10.245.246.52]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2025 04:41:17 -0800 From: "Fabio M. De Francesco" To: linux-cxl@vger.kernel.org Cc: Rafael J Wysocki , Len Brown , Tony Luck , Borislav Petkov , Hanjun Guo , Mauro Carvalho Chehab , Shuai Xue , Davidlohr Bueso , Jonathan Cameron , Dave Jiang , Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Mahesh J Salgaonkar , Oliver O'Halloran , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-pci@vger.kernel.org, "Fabio M. De Francesco" , Kuppuswamy Sathyanarayanan Subject: [PATCH 5/5 v8] ACPI: extlog: Trace CPER CXL Protocol Error Section Date: Fri, 19 Dec 2025 13:39:44 +0100 Message-ID: <20251219124042.3759749-6-fabio.m.de.francesco@linux.intel.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> References: <20251219124042.3759749-1-fabio.m.de.francesco@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When Firmware First is enabled, BIOS handles errors first and then it makes them available to the kernel via the Common Platform Error Record (CPER) sections (UEFI 2.11 Appendix N.2.13). Linux parses the CPER sections via one of two similar paths, either ELOG or GHES. The errors managed by ELOG are signaled to the BIOS by the I/O Machine Check Architecture (I/O MCA). Currently, ELOG and GHES show some inconsistencies in how they report to userspace via trace events. Therefore, make the two mentioned paths act similarly by tracing the CPER CXL Protocol Error Section. Cc: Dan Williams Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Kuppuswamy Sathyanarayanan Signed-off-by: Fabio M. De Francesco --- drivers/acpi/Kconfig | 2 ++ drivers/acpi/acpi_extlog.c | 24 ++++++++++++++++++++++++ drivers/cxl/core/ras.c | 3 ++- include/cxl/event.h | 2 ++ 4 files changed, 30 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index ca00a5dbcf750..df0ff0764d0d5 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig @@ -494,6 +494,8 @@ config ACPI_EXTLOG tristate "Extended Error Log support" depends on X86_MCE && X86_LOCAL_APIC && EDAC select UEFI_CPER + select ACPI_APEI + select ACPI_APEI_GHES help Certain usages such as Predictive Failure Analysis (PFA) require more information about the error than what can be described in diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index 88a2237772c26..7ad3b36013cc6 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -162,6 +163,23 @@ static void extlog_print_pcie(struct cper_sec_pcie *pc= ie_err, #endif } =20 +static void +extlog_cxl_cper_handle_prot_err(struct cxl_cper_sec_prot_err *prot_err, + int severity) +{ +#ifdef ACPI_APEI_PCIEAER + struct cxl_cper_prot_err_work_data wd; + + if (cxl_cper_sec_prot_err_valid(prot_err)) + return; + + if (cxl_cper_setup_prot_err_work_data(&wd, prot_err, severity)) + return; + + cxl_cper_handle_prot_err(&wd); +#endif +} + static int extlog_print(struct notifier_block *nb, unsigned long val, void *data) { @@ -213,6 +231,12 @@ static int extlog_print(struct notifier_block *nb, uns= igned long val, if (gdata->error_data_length >=3D sizeof(*mem)) trace_extlog_mem_event(mem, err_seq, fru_id, fru_text, (u8)gdata->error_severity); + } else if (guid_equal(sec_type, &CPER_SEC_CXL_PROT_ERR)) { + struct cxl_cper_sec_prot_err *prot_err =3D + acpi_hest_get_payload(gdata); + + extlog_cxl_cper_handle_prot_err(prot_err, + gdata->error_severity); } else if (guid_equal(sec_type, &CPER_SEC_PCIE)) { struct cper_sec_pcie *pcie_err =3D acpi_hest_get_payload(gdata); =20 diff --git a/drivers/cxl/core/ras.c b/drivers/cxl/core/ras.c index 2731ba3a07993..a90480d07c878 100644 --- a/drivers/cxl/core/ras.c +++ b/drivers/cxl/core/ras.c @@ -63,7 +63,7 @@ static int match_memdev_by_parent(struct device *dev, con= st void *uport) return 0; } =20 -static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *d= ata) +void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) { unsigned int devfn =3D PCI_DEVFN(data->prot_err.agent_addr.device, data->prot_err.agent_addr.function); @@ -104,6 +104,7 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_pr= ot_err_work_data *data) else cxl_cper_trace_uncorr_prot_err(cxlmd, data->ras_cap); } +EXPORT_SYMBOL_GPL(cxl_cper_handle_prot_err); =20 static void cxl_cper_prot_err_work_fn(struct work_struct *work) { diff --git a/include/cxl/event.h b/include/cxl/event.h index 94081aec597ae..ff97fea718d2c 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -340,4 +340,6 @@ cxl_cper_setup_prot_err_work_data(struct cxl_cper_prot_= err_work_data *wd, } #endif =20 +void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *wd); + #endif /* _LINUX_CXL_EVENT_H */ --=20 2.52.0