From patchwork Thu Jan 23 08:44:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13948002 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2054.outbound.protection.outlook.com [40.107.93.54]) (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 7156320C03A; Thu, 23 Jan 2025 08:44:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.93.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621883; cv=fail; b=LG6yAaDpurHOXwGYVGh7BiY2Hwem85OF5eR9+txe6pYpym0CLqg7hbKWjCbUuZaf1sF+fXQD9LPRBArbQUGzvDykaCenZzMCfW9HQBXd3PB16RzneO6Rp3E80BldNA+UzxiOwDjNksCp13BkzlehxwPGyn+0vuA0uim4BHaiFBw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621883; c=relaxed/simple; bh=dFATjiEsqWPrNpXInOlOEZiH5vSDzDmvifr8RXVavlw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RxsfeRYhERHXyHvXgHbC9flFQu0Qblb0jXuXid40aVF1V1PMyHH5Kt49UxPv1583/pYun+c8gi7UK2xFkM0m0fMmWp650/m7BBZnU6GNzgFIf7iQTDBM/20S0Rk4cRgIjDjA1Mdxd1Xe2IYvdjm5Lig4DWVLv7yPZ4HhnYgowf8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=kQQ1GGr1; arc=fail smtp.client-ip=40.107.93.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="kQQ1GGr1" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Ts0bElHnc+C9y8b2f8y+M4f7O8irvxFTu+0a9q/XUaLX/IFXneMBGn8F5btTzPNvJhk3QBsPA+Uh4eNSc/Kg3HRmDpTXfG8DOnQHHs5H5ePkAABStM8KIuZgVdy8wHsloWzRcvv6yoKhE3jHCKjJ+cCwIbavT/DUA0IGfJY8mmPUGykjUZJsjrTn24OFqHmnTBRGTRtbyNYL9V1Q1usZokdtoi0wy2rmjpakxPkaevw2HPiE+aP6Cj6SfPIWsy9T2oerdemZ7AOjkCROrgZk1KmoXRGyxnfHO095rNRey2LpQwSols+gXLm0gEif4/GgnzmCL8LNUvIVeBft2bVzCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=JHfzDc8hxvCj/BV+aIO8xtZPQXrTUJi3McVEavgo4pU=; b=iKuwCt+LIwyllPAW5E3D+wRVrDwO+6Q5YbmZATGI3EkDSEPJP06UBD1FKuVIWMIAlX8kHcLQuCUYtO1bX/8EjbEdnyKt+x9VQrHGXfTzRlkiwK6Awxxd356DFo4c6pdBE450CaUOS0OOU7TX+sdA7y18gyBhViS5liSNxGbJ62b2tIhJvVnKuWmZHX9zM7xIqjOIKtRCLUoN4vwVtI4DY6wDE2AfFhjuUWHXU8InLqWaXz7jmQ7F3L1KnDThGzUHA2sh2/sINKe03kf3wsb3/t3XrSCIbr0WQjg8YZWtiqTx1+kxs3bF2d06Ew4wFAG8UE0abSM9YGCSNBnIOkfh3g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JHfzDc8hxvCj/BV+aIO8xtZPQXrTUJi3McVEavgo4pU=; b=kQQ1GGr1/CNxTdsYiy2SFtTWuj6QWQB1IJ9E+N64kwzk8seqtzgeScDkrFEm7B0qq22ys9bCOsZ7X3yHitJmB/IdAyOrawoqbhoD68L6m4EVKEM098y3WE1YNrbLxhDQ8/ntyHIXudfaKWYoy0khGDC+m+DExj5lp+yp4jYf6RI= Received: from BLAP220CA0003.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::8) by CYYPR12MB8853.namprd12.prod.outlook.com (2603:10b6:930:cb::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.16; Thu, 23 Jan 2025 08:44:38 +0000 Received: from BL6PEPF00020E60.namprd04.prod.outlook.com (2603:10b6:208:32c:cafe::fc) by BLAP220CA0003.outlook.office365.com (2603:10b6:208:32c::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Thu, 23 Jan 2025 08:44:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00020E60.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8377.8 via Frontend Transport; Thu, 23 Jan 2025 08:44:37 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 23 Jan 2025 02:44:37 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v6 1/6] efi/cper, cxl: Prefix protocol error struct and function names with cxl_ Date: Thu, 23 Jan 2025 08:44:16 +0000 Message-ID: <20250123084421.127697-2-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> References: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E60:EE_|CYYPR12MB8853:EE_ X-MS-Office365-Filtering-Correlation-Id: d0dba83c-363d-4743-818a-08dd3b8a2b98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: de/tw2GzEEJT49KF7cn1g2t38ZRuxBoNG/N97jnbNEeFCw7t9LsE+S90uhuQ16rSM/ToHaQPPzDOBbxoh+8B3e4Uel5FChJW1pFS5ib95YkZ35EUyKH7GpxCFOrqmFGNghJ1SBEcsnH14WURLzOE0vHRlWIyIRyt9/stpv1P3TaCTAGv/mgj5zfS0uOC4kzcAF87/lN7YrfSYLtLQ8/mkkfI+Kb3KWKeXF7SMjfreR8u+Q//KgVr6bSOQCcno8rvcUVziGPVeMhG8iiTuZ08ljk8KnJqVNLjZwRcwPwZi1HRcuTQthT15fLXZ7J10FAbm8cyLPS0HkVfFnztYkTo8yl8U3i5MQNXmh3NI5uMTCj3Ygd7/1OlOBeuhPJJWzvOYXB97jCp2RMm5YUUayeN6PU7FCD85A+nOQUFu6T5dQKWEqdFKNXaGhbXjqd8iaX+rwWS1dGCLWGYXmDem0UQW8wyHIacBqjByZFx+4YelvgWWNaWKoaZdNbZtoCFXsSkeepHfKS1Gn+UXZmfTYlftrLvEyKd7fILuEvq+32hZQk8Hok/esT5fWmfyUYzjDPcc1TUURKeShsMfNgt0prxPAoJ7hmKMKG0QoxO+PYD6ri86h6Ji88Z2imAK88iiT2LSN1Xr4Q9HKg6tFwHVq6emP3t8wutZbFEW8ni/a1xKuHjZzaVwrkq9F9iQlvtjoS8cesKRg+kPgHB8j6dkDjiYJ1tmqHPppaSUukjApITaTBiM7LbX9Dlx+/HqFhv2Pk9KbgyAjv3UsV4zkB/N+K6SCUbfl1f6DmjPucEZE/I5qd/JkkMs6lCVp0Zmh2m0hvNH/Xx5gjMzFCo0znplEHUQtUr2Muxa8EgThkGtMT+qH0SkcBcDbLRA5ia6wb/Ou2Up3+LlpxBsTNLh8aQImiwOrggZ5O95sWLCksH8gApRJJHeILAApqkarafEEFwuQhzXDCFyIP8xkQITxT333h6zY+TzlS4HM/ZfU7/CkYjIO1MBOZBEHCKUai6sUqCCsy959LW7RqtpmKFrWT9YHdsWlTSdYqnoroJJkEMAP+QYicSUgTbwsUuKOHzrkSWzNlgxfKAtxkToaQeJjCaaiyBgyGXW44KzdfWpA8GrAJM1YVUFi9LOQqbvR89TC9Sra6FASA7SgbqsQQfVBMjks1jgr/Y7uwJaIKKmeDQM7DA7HO4WvvKn0mUwuwTKtbZVulKlbbQiu7ECAqdWWgnCStgUhBbtu+aBxU1xsYwrCwMYgeUNCr/6r7Yrvbkr/hKMw4A7Hc2RoswbhMCU8wNwwMdUn39FrJpGy3T/XfZWK5GFySi+mMKK9wj9dExhOUQPflXTvuZWIrhI28p987njtKjSSI0fsBw6Vynjo8ajASTE23lkdC2QVo5DJo3bOtJP7s90PkO+Wp+CPhga5/O1jp+Y9mC5o7vUDrFbDFQkFSPR82m+/X2ZY4xQCpliU6brBai7qANxpE8LPmlSCoXOUz+sH7eee62gAAipZTJy63jByA= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2025 08:44:37.8637 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0dba83c-363d-4743-818a-08dd3b8a2b98 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E60.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB8853 Rename the protocol error struct from struct cper_sec_prot_err to struct cxl_cper_sec_prot_err and cper_print_prot_err() to cxl_cper_print_prot_err() to maintain naming consistency. No functional changes. Signed-off-by: Smita Koralahalli Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang --- drivers/firmware/efi/cper.c | 4 ++-- drivers/firmware/efi/cper_cxl.c | 3 ++- drivers/firmware/efi/cper_cxl.h | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index b69e68ef3f02..8e5762f7ef2e 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -624,11 +624,11 @@ cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata else goto err_section_too_small; } else if (guid_equal(sec_type, &CPER_SEC_CXL_PROT_ERR)) { - struct cper_sec_prot_err *prot_err = acpi_hest_get_payload(gdata); + struct cxl_cper_sec_prot_err *prot_err = acpi_hest_get_payload(gdata); printk("%ssection_type: CXL Protocol Error\n", newpfx); if (gdata->error_data_length >= sizeof(*prot_err)) - cper_print_prot_err(newpfx, prot_err); + cxl_cper_print_prot_err(newpfx, prot_err); else goto err_section_too_small; } else { diff --git a/drivers/firmware/efi/cper_cxl.c b/drivers/firmware/efi/cper_cxl.c index a55771b99a97..cbaabcb7382d 100644 --- a/drivers/firmware/efi/cper_cxl.c +++ b/drivers/firmware/efi/cper_cxl.c @@ -55,7 +55,8 @@ enum { USP, /* CXL Upstream Switch Port */ }; -void cper_print_prot_err(const char *pfx, const struct cper_sec_prot_err *prot_err) +void cxl_cper_print_prot_err(const char *pfx, + const struct cxl_cper_sec_prot_err *prot_err) { if (prot_err->valid_bits & PROT_ERR_VALID_AGENT_TYPE) pr_info("%s agent_type: %d, %s\n", pfx, prot_err->agent_type, diff --git a/drivers/firmware/efi/cper_cxl.h b/drivers/firmware/efi/cper_cxl.h index 86bfcf7909ec..0e3ab0ba17c3 100644 --- a/drivers/firmware/efi/cper_cxl.h +++ b/drivers/firmware/efi/cper_cxl.h @@ -18,7 +18,7 @@ #pragma pack(1) /* Compute Express Link Protocol Error Section, UEFI v2.10 sec N.2.13 */ -struct cper_sec_prot_err { +struct cxl_cper_sec_prot_err { u64 valid_bits; u8 agent_type; u8 reserved[7]; @@ -61,6 +61,7 @@ struct cper_sec_prot_err { #pragma pack() -void cper_print_prot_err(const char *pfx, const struct cper_sec_prot_err *prot_err); +void cxl_cper_print_prot_err(const char *pfx, + const struct cxl_cper_sec_prot_err *prot_err); #endif //__CPER_CXL_ From patchwork Thu Jan 23 08:44:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13948005 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2083.outbound.protection.outlook.com [40.107.236.83]) (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 C4F0E20C47D; Thu, 23 Jan 2025 08:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.236.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621885; cv=fail; b=pKmk7KmyhBlgFWJ6INznxy9lqyPLnocSe4Y/u2SoVW7LGd/RzN8UeA5NvOT1GReb49pFMIDWdeLlgOfwi+4GGx4i5C/ibXOWRw6FBTBGrG2DP5piIIxUHYINWJEYyRxg4sbtq0tQ++otM2Uw5ADUCz8QJbQByC2ofvZPKtJ+0U4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621885; c=relaxed/simple; bh=UBL/b/K7iVFHLAvBrL5eqfd279v4PDKw8UD8L6hhQQw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TDBFHKW/TUwha0mRGmXWXW8nJ5HT0wMLYyo+Hv4eS8ba3Pgztv6Ln0+kas+A4bNy+71H+ME54KKbIqoWFLdr4TqfL469FPF3fLlgLIlgUP6fMHe8how2EcrcjH2XPVQDzVow4wwqFs+JbmSSv+TF4UxWfq++4CqPjJi3zcz/rC0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=SkboEcmd; arc=fail smtp.client-ip=40.107.236.83 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="SkboEcmd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GMkEsEPwic863AMS8N5Ss0i4MvvcTr3ySrWh35nwjcPEI+lsvBlwtRifSd+c+N/txzw66kqLRLXl4omNDAKqYcoT/O8lhG+vYsTe5H09VLN51i4AQhbBUf+ZWjYa/FmK//7/wti0azezChE6U6DsVS/KurMvO550iFidmjKJl25ztIFuXILYjFc/X9e5Ln+kXo2ZaqXa/pGyw79DZ1Sa9NPF9yFs0JN64zVSC4d3I0F1HumBQw8d0aEsWyWf1ghkUMFGvkz34/gySoWfQJ/H+sqC++YPxiQbk9GbfH/At1RocJECrHOEpsy3anekKEOXMk+XtL0CyzeV320cw7noQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0B94FjdI/9BIi6raps7RIhArGu1oRNOzA/PlrSPnx8E=; b=cdxKA7o7S/atbLu6AjzeFdP+oGBB48t5I9XnIPo46bVewa3R2gbiIDxn1Fh3Y8WFeaZqBo376Aa9sSNQ6In4cAnn/UVPZve/BrvNHu5kbZ9WShe7GKAvG8jQ3O7QZwwp7sDXKikJp5LpghI3MRx3te5ABOO9bCHbFkz/nWj9PIoVyLrKOJIUFigtAeQS625HmNSTDWLX4SO8BgT5SKNTgU7UcJeGF4PR9xEF6ZxPrL+VZoOLiSFi3iu68CPhN5qkHKImSGGBEeO8l/Xo+79cp1AU7Myc3bb4XA7W75I3G6Td+qckGNrKUY+Y9nAdQk8mQ7CTaXrTF0zffwECeRLOFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0B94FjdI/9BIi6raps7RIhArGu1oRNOzA/PlrSPnx8E=; b=SkboEcmdAPgAU+VxpXeh3KDP4/2l81F0Sp3l+sEdXUNoWQTBMkW6yy6l6CjqcAZpfi9jryGZfc3/DK5pmvUqfME4Rz5vYRCytOiye1vpSIMVJDV0d6iBhbZWvgFBr1EPdb30ZLKcoOwQi8Ac+BeU8GH/h/FhhuhrNpBhQtlvFb4= Received: from BLAP220CA0028.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::33) by DS0PR12MB8785.namprd12.prod.outlook.com (2603:10b6:8:14c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8356.21; Thu, 23 Jan 2025 08:44:38 +0000 Received: from BL6PEPF00020E60.namprd04.prod.outlook.com (2603:10b6:208:32c:cafe::4b) by BLAP220CA0028.outlook.office365.com (2603:10b6:208:32c::33) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8377.14 via Frontend Transport; Thu, 23 Jan 2025 08:44:38 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00020E60.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8377.8 via Frontend Transport; Thu, 23 Jan 2025 08:44:38 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 23 Jan 2025 02:44:37 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v6 2/6] efi/cper, cxl: Make definitions and structures global Date: Thu, 23 Jan 2025 08:44:17 +0000 Message-ID: <20250123084421.127697-3-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> References: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E60:EE_|DS0PR12MB8785:EE_ X-MS-Office365-Filtering-Correlation-Id: a387767a-1091-4ad6-f265-08dd3b8a2c0a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|36860700013|82310400026; X-Microsoft-Antispam-Message-Info: a8uA3lXBoTkbwq/pxnilahbRi5IL5CRByYqxRFQm647sYVSYM+IsDe5YjsV1YaP9lLaVi64PpxgXIAKS7XLHLzvisg0ej8WE0X93r3eVJFLrOfzn3DNyKqQeaQGv+25J5zBRyrXbiNSItZoV2HYoV1yTImfrJfrmGYCGhSnDHlifs2zyQYulDKfZo7ovwaOobX32sgLxwvLCFNumy3xN75krbI8Qlgmb1gEgiTl2HhuOYea2XfLogstvGC2WG5EzqN8Q4HCqAJ93XQo14AQ2Jy85JEqqY3zlmTjhZG37ff+ejQCFbHJlzNdrbz3YogpWtut4KFF+m2NlSaekRivD+tB9aejXXLBMpHkty+id1ncfhBTro6zzpsUCQtzVVtQLVAXF1T4Lj5eH8ZTNj4q7RIYyGom7Lfjz9gRdFHRGatR2GKpTK9kRAVlRIfQgu0Bmi2s85Zh6I8Mkt7WOOlYZI8a75/Mup61QUE67kOtfdLQbzZSVhMBCo2WThP9baAt+CZrS2GjuJrptdnenQhM1tNXrpuP94rhRLwxqmXcqfoVhkcU1XuAJ7ZnbL77UE3R1/wmGpEQ+mS1fhzUN7ZsHUd1SCwS35ANeksf+iUscU0dil+tMulg6cYEzhqPxewSJYlWgnSrtiTNdQ1e06eOYmTGJhdkiq7s1TwrD23kt/Pgn0aYZu46/cinNdRWI0iNYUrEUln+FsYw6BDq0WoPA1LLYV/zGYs0m12Ocfn0+yRs1IaUWrTGwcVW0yJsUGYuoWHtqZI6SFJe7DrrOYWQKo1bbJO37x8z0wwEm6/DDh8alnSJJadQJkt+asCO9URoIqGlZSM/BbORmL7QtfWhOQwxS487fye1ZzTjccOStWNAni66Rcypvuv/68gRYaYDT7q/EL8toUungp6NZH8r9Cl7rbMSIiyvP35CqF0p3vECTEWepDg0Cf8FiuSlXLJ6CkNvsUhHc/JL4NjNlK4AwKaGtTS3KeNZdGDE8Tk70Z3EsaZIIL2PZlp5V8JvIG7WUrekbbs5zivMDy/tRaVAea2KmcOFwqWpLpKvOnfvbzsOZAE22lNAZY7Z2GmVYbpXX5k845resuojDg/XN5SfXs+vhDGdcNiDt5xgR1KnB8Y1dhChmG2rpTnk7IZg/KDoRyhiqAnpk+9xTyjzJ1nlT0781oKtjHVLKhwXo3Ts1o17p4RWMFH4fdR7VMNgSAG78nbh3hGnzPc7QIEtdBfMUziz8LeH9dIKUeTbbNeztqX8bZiZFcLma4c8t2hBRbiLXISWefNVbVQ7Fb/flBK1pK8uDiMd12C6ZqRLqJpkV5weiqz256s5/pfg8W5nkMkTp+hBlqWDgqR1wgZo/IPX0codjW7fd4BheXfqlj64LVBdB0xrwOf1Q+mVuRDvCBvyEyn13MjGtkzu7t/KO/FysDO42+GPc75n2O40WmYVya4DYo4NI83C842UPw/2fIn1bjvrjMQpgAQL8iBY1i13FGlzmKRpOmV2PUhJpA/nRs7Y= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(36860700013)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2025 08:44:38.6294 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a387767a-1091-4ad6-f265-08dd3b8a2c0a X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E60.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8785 In preparation to add tracepoint support, move protocol error UUID definition to a common location, Also, make struct CXL RAS capability, cxl_cper_sec_prot_err and CPER validation flags global for use across different modules. Signed-off-by: Smita Koralahalli Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny Reviewed-by: Dave Jiang --- drivers/firmware/efi/cper.c | 1 + drivers/firmware/efi/cper_cxl.c | 35 +-------------- drivers/firmware/efi/cper_cxl.h | 51 --------------------- include/cxl/event.h | 80 +++++++++++++++++++++++++++++++++ include/linux/cper.h | 4 ++ 5 files changed, 86 insertions(+), 85 deletions(-) diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index 8e5762f7ef2e..ae1953e2b214 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "cper_cxl.h" /* diff --git a/drivers/firmware/efi/cper_cxl.c b/drivers/firmware/efi/cper_cxl.c index cbaabcb7382d..64c0dd27be6e 100644 --- a/drivers/firmware/efi/cper_cxl.c +++ b/drivers/firmware/efi/cper_cxl.c @@ -8,27 +8,9 @@ */ #include +#include #include "cper_cxl.h" -#define PROT_ERR_VALID_AGENT_TYPE BIT_ULL(0) -#define PROT_ERR_VALID_AGENT_ADDRESS BIT_ULL(1) -#define PROT_ERR_VALID_DEVICE_ID BIT_ULL(2) -#define PROT_ERR_VALID_SERIAL_NUMBER BIT_ULL(3) -#define PROT_ERR_VALID_CAPABILITY BIT_ULL(4) -#define PROT_ERR_VALID_DVSEC BIT_ULL(5) -#define PROT_ERR_VALID_ERROR_LOG BIT_ULL(6) - -/* CXL RAS Capability Structure, CXL v3.0 sec 8.2.4.16 */ -struct cxl_ras_capability_regs { - u32 uncor_status; - u32 uncor_mask; - u32 uncor_severity; - u32 cor_status; - u32 cor_mask; - u32 cap_control; - u32 header_log[16]; -}; - static const char * const prot_err_agent_type_strs[] = { "Restricted CXL Device", "Restricted CXL Host Downstream Port", @@ -40,21 +22,6 @@ static const char * const prot_err_agent_type_strs[] = { "CXL Upstream Switch Port", }; -/* - * The layout of the enumeration and the values matches CXL Agent Type - * field in the UEFI 2.10 Section N.2.13, - */ -enum { - RCD, /* Restricted CXL Device */ - RCH_DP, /* Restricted CXL Host Downstream Port */ - DEVICE, /* CXL Device */ - LD, /* CXL Logical Device */ - FMLD, /* CXL Fabric Manager managed Logical Device */ - RP, /* CXL Root Port */ - DSP, /* CXL Downstream Switch Port */ - USP, /* CXL Upstream Switch Port */ -}; - void cxl_cper_print_prot_err(const char *pfx, const struct cxl_cper_sec_prot_err *prot_err) { diff --git a/drivers/firmware/efi/cper_cxl.h b/drivers/firmware/efi/cper_cxl.h index 0e3ab0ba17c3..5ce1401ee17a 100644 --- a/drivers/firmware/efi/cper_cxl.h +++ b/drivers/firmware/efi/cper_cxl.h @@ -10,57 +10,6 @@ #ifndef LINUX_CPER_CXL_H #define LINUX_CPER_CXL_H -/* CXL Protocol Error Section */ -#define CPER_SEC_CXL_PROT_ERR \ - GUID_INIT(0x80B9EFB4, 0x52B5, 0x4DE3, 0xA7, 0x77, 0x68, 0x78, \ - 0x4B, 0x77, 0x10, 0x48) - -#pragma pack(1) - -/* Compute Express Link Protocol Error Section, UEFI v2.10 sec N.2.13 */ -struct cxl_cper_sec_prot_err { - u64 valid_bits; - u8 agent_type; - u8 reserved[7]; - - /* - * Except for RCH Downstream Port, all the remaining CXL Agent - * types are uniquely identified by the PCIe compatible SBDF number. - */ - union { - u64 rcrb_base_addr; - struct { - u8 function; - u8 device; - u8 bus; - u16 segment; - u8 reserved_1[3]; - }; - } agent_addr; - - struct { - u16 vendor_id; - u16 device_id; - u16 subsystem_vendor_id; - u16 subsystem_id; - u8 class_code[2]; - u16 slot; - u8 reserved_1[4]; - } device_id; - - struct { - u32 lower_dw; - u32 upper_dw; - } dev_serial_num; - - u8 capability[60]; - u16 dvsec_len; - u16 err_len; - u8 reserved_2[4]; -}; - -#pragma pack() - void cxl_cper_print_prot_err(const char *pfx, const struct cxl_cper_sec_prot_err *prot_err); diff --git a/include/cxl/event.h b/include/cxl/event.h index 0bea1afbd747..66d85fc87701 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -152,6 +152,86 @@ struct cxl_cper_work_data { struct cxl_cper_event_rec rec; }; +#define PROT_ERR_VALID_AGENT_TYPE BIT_ULL(0) +#define PROT_ERR_VALID_AGENT_ADDRESS BIT_ULL(1) +#define PROT_ERR_VALID_DEVICE_ID BIT_ULL(2) +#define PROT_ERR_VALID_SERIAL_NUMBER BIT_ULL(3) +#define PROT_ERR_VALID_CAPABILITY BIT_ULL(4) +#define PROT_ERR_VALID_DVSEC BIT_ULL(5) +#define PROT_ERR_VALID_ERROR_LOG BIT_ULL(6) + +/* + * The layout of the enumeration and the values matches CXL Agent Type + * field in the UEFI 2.10 Section N.2.13, + */ +enum { + RCD, /* Restricted CXL Device */ + RCH_DP, /* Restricted CXL Host Downstream Port */ + DEVICE, /* CXL Device */ + LD, /* CXL Logical Device */ + FMLD, /* CXL Fabric Manager managed Logical Device */ + RP, /* CXL Root Port */ + DSP, /* CXL Downstream Switch Port */ + USP, /* CXL Upstream Switch Port */ +}; + +#pragma pack(1) + +/* Compute Express Link Protocol Error Section, UEFI v2.10 sec N.2.13 */ +struct cxl_cper_sec_prot_err { + u64 valid_bits; + u8 agent_type; + u8 reserved[7]; + + /* + * Except for RCH Downstream Port, all the remaining CXL Agent + * types are uniquely identified by the PCIe compatible SBDF number. + */ + union { + u64 rcrb_base_addr; + struct { + u8 function; + u8 device; + u8 bus; + u16 segment; + u8 reserved_1[3]; + }; + } agent_addr; + + struct { + u16 vendor_id; + u16 device_id; + u16 subsystem_vendor_id; + u16 subsystem_id; + u8 class_code[2]; + u16 slot; + u8 reserved_1[4]; + } device_id; + + struct { + u32 lower_dw; + u32 upper_dw; + } dev_serial_num; + + u8 capability[60]; + u16 dvsec_len; + u16 err_len; + u8 reserved_2[4]; +}; + +#pragma pack() + +/* CXL RAS Capability Structure, CXL v3.0 sec 8.2.4.16 */ +struct cxl_ras_capability_regs { + u32 uncor_status; + u32 uncor_mask; + u32 uncor_severity; + u32 cor_status; + u32 cor_mask; + u32 cap_control; + u32 header_log[16]; +}; + #ifdef CONFIG_ACPI_APEI_GHES int cxl_cper_register_work(struct work_struct *work); int cxl_cper_unregister_work(struct work_struct *work); diff --git a/include/linux/cper.h b/include/linux/cper.h index 265b0f8fc0b3..5c6d4d5b9975 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h @@ -89,6 +89,10 @@ enum { #define CPER_NOTIFY_DMAR \ GUID_INIT(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \ 0x72, 0x2D, 0xEB, 0x41) +/* CXL Protocol Error Section */ +#define CPER_SEC_CXL_PROT_ERR \ + GUID_INIT(0x80B9EFB4, 0x52B5, 0x4DE3, 0xA7, 0x77, 0x68, 0x78, \ + 0x4B, 0x77, 0x10, 0x48) /* CXL Event record UUIDs are formatted as GUIDs and reported in section type */ /* From patchwork Thu Jan 23 08:44:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13948003 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2046.outbound.protection.outlook.com [40.107.223.46]) (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 0743E20C47F; Thu, 23 Jan 2025 08:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621884; cv=fail; b=A05ca1x2BCxR41XfSF6jbqJVlFgjOxTdnGqTDoxnnIUdZP4ZAnc9YN2QbrLg5Kb/LDcLmieUcCtowMei5nksgLIQcsgkE4etjmibgWPT2ZGM+41SEozTBMmG3xSu9zgHfiSxUeLQEsEy49e+epAiikrQIng7ATIZM7LwT8mWzww= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621884; c=relaxed/simple; bh=nYaiLCXwtGA1yzQ3FpywASE+43Fss8ZM46Nq9admaHA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RzBSRCFo9klqb4iDyjWZhWRwBNLhYa90EmBwnPWAxW6qYjZoUDDI9hbny8hnzaYtIuJIJnzp79+JJNsUOreAE04CGjwgQk+61P+hM6jEiUphHQ/IorQKEi+VWHojisGHaDUhgF0NslY5aUwaKAe6dfgHMjxGTYqgHAUB6ha8YT8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=m8N2Tr7P; arc=fail smtp.client-ip=40.107.223.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="m8N2Tr7P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=f6oEGuEp5u0eyVbx0l+0qLtuTatMajDk+CEChVQsgrnd9tXMYIw6fb49Dl/3UX39cSWmH1owVsio1MOhYvb4VuYw8VV2dDWn2E0m180jzBXUOOBYPoaKN/xKdExIopGoM5ZoLqhIaIERi+hS3mbQscTGIOsfkkQjjhusLCQmJHInJOSn7Uv4yOAoa28tpQHgggfgAcc/S71noukOMBx53Yf+rjxt3XrP+Zgz6jI3TwrY9EGOprJGsH20gHjwNwEKMnwe2fPjc4Mx57IQ6jbHrOr5Pzfo24R69hTm8n1Mhr6psf1yel/4lBiocji7i503P0S8VipIHEuKR0+F8f9+kQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wnv0NAjgwjzZ0rGP2HqkEEsTfMC6mOSy6sVEKS7KizI=; b=valKCg4RGBkEd1auJ0UVOifSu8bFQflWoiVmyjevsXpY0suA8T7CekTQxBl8IZ+e6voTyMK7FnuyZCPrtpcukwb7L4WvLDwPA8osBMuWOE3pnJs5mJUGmaqdnEALluoIzqj1+MwEDbDH5j9oKHrZksLkQjOyJj3aaZ9vdVbg8tvZT7hpucVpWuPHXJYSrb8ftZdRhemNMQMrea8c1VHrn+mnQhmEDKSP25cXQXgHnagsZkO5gwUFbiBepar9jBN5fvRGyYeh3Bp50rSW9Xa3pOkpOM2rPMvlaoeQnuH+sWTJnA0EZmr1IkXSKT2VD74x6aL8gxRRfjGCiUtNoWlrvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wnv0NAjgwjzZ0rGP2HqkEEsTfMC6mOSy6sVEKS7KizI=; b=m8N2Tr7Ph4GKHqgpQnIkMgQY1QOxoyYdFv0fjrlspqWfRHS5oDUYTwaCL9bYq9vdi+vLlgvLHa0kB4QRVHzK1aPfeQ5d8KzCLY376Wa3SWA2767wVdmoaTpNX6TJraBdjfRDvd7X1Mf2rRn31mOykddXSb1oEv4T1QICh+/v6iU= Received: from BLAP220CA0013.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::18) by CH3PR12MB7738.namprd12.prod.outlook.com (2603:10b6:610:14e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.18; Thu, 23 Jan 2025 08:44:39 +0000 Received: from BL6PEPF00020E60.namprd04.prod.outlook.com (2603:10b6:208:32c:cafe::56) by BLAP220CA0013.outlook.office365.com (2603:10b6:208:32c::18) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.22 via Frontend Transport; Thu, 23 Jan 2025 08:44:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00020E60.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8377.8 via Frontend Transport; Thu, 23 Jan 2025 08:44:39 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 23 Jan 2025 02:44:38 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v6 3/6] efi/cper, cxl: Remove cper_cxl.h Date: Thu, 23 Jan 2025 08:44:18 +0000 Message-ID: <20250123084421.127697-4-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> References: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E60:EE_|CH3PR12MB7738:EE_ X-MS-Office365-Filtering-Correlation-Id: af4b372b-49f0-472d-29a9-08dd3b8a2c63 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: /MBbsBX8axbRdq0LHb8IZuiAmCey7i38zjMhfHelA0OmZTTLeExBvyBPTakQaMucxtu1v3qBgPIC60bVnacnPAajBgq26HKzk83fRjsq6RkUy66q9lbcZlf6/3o06h1ObEoEbszuil4yM1yTNLvK20cgz0P2Wag8XDv+YdGfLhJodcGz6npzJgs5+YhM5GZceNL7GVIJAJrjsGPyBPN7zuX2++9NHyPjVrNt4ZC+P2V9DskV9HIMOGokZ0jFRqu3hN6/FVFMNzPvSRYNNzUh+NraifzMpZaQjWFoP8PBErrgB0luwReUOMsUpHeREJqobvYzZyi4LeZzHYn30boB//ZEjnO4QpWAEWjn8TnqlSS5R1OqtzWFunkF+0GC6PIbFHOCRH1XcD0tZSVuZHRnPMBMhzKeV5xb9VJg82g88JI4zUb3sa31oIO66R30U3I7fEMQnAOTeCXhEAXNCtvwSBF8Vbo/VSMIjgb2RyCOOBccNJTAOuXb6BzDAaBTLDDfbtLDM+47F/jIOYBSd76CLLAY1FzO3Xahf686DkU/YgB8J/bmY2VBgqd1RjsQlY8DQ8jp89/RB/7z/YWEFJf+gHFqaXHtVhoFLG4TvJt5RKUbEmJtAz0usvVmnISHi0iq80wFIgx+ZLf6baRpglh0cl3JQ9V+8yabKzx+mX2RYe1SnubLzEf3+rdDtIyf2qvLehhIYLPVCGahHNrrkL6WbyBvvSmEpGET20tntPorbfxbtNumtCV+VdUWXAUItEa0d8rDigj8f9dEwuLIuNqqeD08H2hZtQFWltTyVvtxLog0D/U1og3NtaUjxLZri+FZZaHuUVgmp9br4YTqhIjcEpkIDUTRdlIY2nkL4AvEwVxledDoCrA9vxPeRzjRNIP80X56CEAuyMt8twoHftcFP4ilPwXTuwGYaIqgv0H3qlzaIXe18u8H9jbga2PPNizKuSFIz93ItdYRu0ancjHjrCjCxClDrjYFIhhZCVfv9JahljeZJskm+gsz8XZpwnV7YTbl9Cash2+GiyKKP1NhrNZgd1M+PGM9N2Y5hxyrTDAaxSHfQmKcPtORt6fWTV4GVV5lqeUBsKGjEYgEjbP63Ebd9rgMA/bGqUEvTu/v8jIDdnMI8UEHYhWyET3FboauV9JsZxbiyYF1OzwmJqqV20jphR4eVV9ulE+lnYorYqbgFL57xpmAG3Fgdwka9PSvBaFlXPaEZTwPbhgmUaw8fE1E2ZRKAJUnVZjduyDhQbJJko7YdO++oTNoYOp/PWZJQWlFogEFpaQlnIKmo2NVg9jLWSrFcfqmvlfzslx5fNJfNpXdjbbH6SUNCCiCt7DMmiRsmyRPT5RCxs1fi1VS4qjXojovwVK7QBTq79o1T/jPNzgoKrmBX9Ab6/sZi3DjY8SUcMXUBmsk8M5+mVYTsTnzQtu+P3oShi+6izRhvJWiTxh1Dk++nW87F5IeJvD88ySZFG3ZVcEvj3+66y5chiyrRoAO5BWoPTCLqOx9y+8= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2025 08:44:39.1919 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: af4b372b-49f0-472d-29a9-08dd3b8a2c63 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E60.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB7738 Move the declaration of cxl_cper_print_prot_err() to include/linux/cper.h to avoid maintaining a separate header file just for this function declaration. Remove drivers/firmware/efi/cper_cxl.h as its contents have been reorganized. No functional changes. Signed-off-by: Smita Koralahalli Reviewed-by: Ira Weiny Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang --- drivers/firmware/efi/cper.c | 1 - drivers/firmware/efi/cper_cxl.c | 1 - drivers/firmware/efi/cper_cxl.h | 16 ---------------- include/linux/cper.h | 4 ++++ 4 files changed, 4 insertions(+), 18 deletions(-) delete mode 100644 drivers/firmware/efi/cper_cxl.h diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index ae1953e2b214..928409199a1a 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -25,7 +25,6 @@ #include #include #include -#include "cper_cxl.h" /* * CPER record ID need to be unique even after reboot, because record diff --git a/drivers/firmware/efi/cper_cxl.c b/drivers/firmware/efi/cper_cxl.c index 64c0dd27be6e..8a7667faf953 100644 --- a/drivers/firmware/efi/cper_cxl.c +++ b/drivers/firmware/efi/cper_cxl.c @@ -9,7 +9,6 @@ #include #include -#include "cper_cxl.h" static const char * const prot_err_agent_type_strs[] = { "Restricted CXL Device", diff --git a/drivers/firmware/efi/cper_cxl.h b/drivers/firmware/efi/cper_cxl.h deleted file mode 100644 index 5ce1401ee17a..000000000000 --- a/drivers/firmware/efi/cper_cxl.h +++ /dev/null @@ -1,16 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ -/* - * UEFI Common Platform Error Record (CPER) support for CXL Section. - * - * Copyright (C) 2022 Advanced Micro Devices, Inc. - * - * Author: Smita Koralahalli - */ - -#ifndef LINUX_CPER_CXL_H -#define LINUX_CPER_CXL_H - -void cxl_cper_print_prot_err(const char *pfx, - const struct cxl_cper_sec_prot_err *prot_err); - -#endif //__CPER_CXL_ diff --git a/include/linux/cper.h b/include/linux/cper.h index 5c6d4d5b9975..0ed60a91eca9 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h @@ -605,4 +605,8 @@ void cper_estatus_print(const char *pfx, int cper_estatus_check_header(const struct acpi_hest_generic_status *estatus); int cper_estatus_check(const struct acpi_hest_generic_status *estatus); +struct cxl_cper_sec_prot_err; +void cxl_cper_print_prot_err(const char *pfx, + const struct cxl_cper_sec_prot_err *prot_err); + #endif From patchwork Thu Jan 23 08:44:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13948004 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2061.outbound.protection.outlook.com [40.107.244.61]) (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 062DB20C47E; Thu, 23 Jan 2025 08:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621884; cv=fail; b=ikBYiwF3UgCjhq/FGYQ77h0r5V06+C1ai5DF8PMbklwU8n2yDijueJ3Gid7f7k8wygezzzPtI0goyNqk1fIwrgooVhgprN0Rgy1gjS47/a2mogRe8DLN2zY8FBLdfYnQawu2RvmtjDNmDb4+HFQNTUSFXYW1uZ5+e37z+tuAGRU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621884; c=relaxed/simple; bh=o/cfLS0LzY97UQA1bDoPwyPOCutGIVQXH6VTybP3K3c=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oxxtuCTHNe92Dkb0Cd+fuqYbTxG+fM8uSFnYmG6T+Lmdav/hsrmK2wpuRXfZGOllFX6MLBzp1Y9kPxcrfDtPH7EZq5Ug3BhDpTLP3oR9vVsS12R9gy/7mUjUcJNTgAYQhXgSR6gCoHw4BT8fB86reCoE6I6TRGsh9xHwhO+mmow= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=wbmqThpY; arc=fail smtp.client-ip=40.107.244.61 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="wbmqThpY" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ahB3qy9+mZZIVAoRkQwYyuK94p/z+4DtcFolADyTBl9WKkPkK7K76c3A6c59NrZaitNI+/OxDbEocXzr/PO8Bw9gu0pGYkGL9ePD7X6/UDhZhgqQiyFhOlZIjY+C/JGS6M7GnXAAk6UTI/5RXCyWWyt0vEwUKDACwN/6q5PqZH5a1XEXqMKmB43/Uur21gSRlvhhiSMELdS8hCjwx/e0aLR7tumsdtXcG+p1/ZzbsZl1dM01OFNECO0b+msVmADjvssTRUroqY8wcR2zo1S7zN92vQnnh6FebsmdRPpCVW9hm5B+LK2bLFRluxRVeaSlN8MritLgpB8z7o9W2IPYYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=6Op9a0KynB/zw5oh+MjgW5BPVdnRtQD3w/I0Wb8xFik=; b=q8xxmALiSfWQTLXucGDVeegYZKJFuGip7rxCGrkfGT8xUgbQOGfKmL5iF6X0pUc62YFA4qz+0fb6BkRBvu3BDILZQdlAIoUTsrWQpikIdDGK9oYd1E6XXjeZuIaVIjoQEiuj42dlxkFacjRF99QWYwz4moOaKcwpDYmMGSv5p5wyoOBDx11W92C1dlZIwbGNwiFLPyeTyuwWgG2O5zUmBbRh+/l2F4LDpXjg+mK1Gm4SXLT+cwD2N1zM/bu+qH2j7IHwbO1l57dCqKxrFG3hwq+7ZpR8JT9Gs62zSpFHLM7R8rKqTsiLN0j4opgMtjl0x/VBhusSIpHVrJvpMLSA6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6Op9a0KynB/zw5oh+MjgW5BPVdnRtQD3w/I0Wb8xFik=; b=wbmqThpYs1RdQ3urcWLSSi3HqsTxs/vLPwFNM+tO/VHq0ODmW6xiYKNOMVmkJxTk5Dte/dhDumd/WIo+DNvsypTtXQTfR/NqHCi7oul3SG1/k5VFWaVongQHBKKVbn2XVJLrUBvZk/nmAmPkrBq95rwx8eLPQhvFR003axJMDso= Received: from BLAP220CA0002.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::7) by SN7PR12MB6743.namprd12.prod.outlook.com (2603:10b6:806:26d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.18; Thu, 23 Jan 2025 08:44:40 +0000 Received: from BL6PEPF00020E60.namprd04.prod.outlook.com (2603:10b6:208:32c:cafe::fd) by BLAP220CA0002.outlook.office365.com (2603:10b6:208:32c::7) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Thu, 23 Jan 2025 08:44:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00020E60.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8377.8 via Frontend Transport; Thu, 23 Jan 2025 08:44:39 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 23 Jan 2025 02:44:38 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v6 4/6] acpi/ghes, cper: Recognize and cache CXL Protocol errors Date: Thu, 23 Jan 2025 08:44:19 +0000 Message-ID: <20250123084421.127697-5-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> References: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E60:EE_|SN7PR12MB6743:EE_ X-MS-Office365-Filtering-Correlation-Id: d4b76e9c-9ef5-45f1-6203-08dd3b8a2c9c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: 6IuH8iaejKBxgyTayWvdIyq2HH/Hq/jIKBnll4hYbaXx3kAl0xjgF1Uwg/rEpwa3yJoPzbfIy0zA1KUNqQEl9YvuZYv/VkOZyBEOdAAJrOd+MDh38RZFl24aVOBC8xh1Br4k1/ZmoTVTSSZsfZE4jGmna3wNOaM4gkBwszjfEPnBCWyAdo+yi589PgVjqxHoucYCmSe8mtdGkcjK5fxZH+TNwncrwOTM4WAOZIatqNX2C3Yt2IbKIbIoJhCypFS0TogCc7cYZwYieorAq1mJLvflpCbjuCSJi89ibIXHNSaMq42aOo390uxEkj2m+DtxgLm8AoMCr9XFKS6xWwSdIufF3fwaiONsC4skKHn+ocEDrnqGfuJNq7mrZe7VYPh/0m1bOQZisjLcIfIpdUJGZPReL11UcdQH8rckVpNIOIz/VohIbyltf7cxqw6S8LEmNipE+1on41Jp50xOD4M5uUg9waaSQb4eKImO860iIdiVZy46+qZmnQBAAN6DqP77U9XV2IhMDnk9hhBvXbqgPVQQ4+3SnkjtHoIg50Zh3VzUc153TPcPoD1pq91MdR2R/vYC4YbcUhQEI7xsffuTDF1rqI6sBrGIuPQNhQVoTXORLgu/nClBsDl25ysIu6Oz1vQvaGSJ5ZYMMPrCW6OJsHfOfrwBI3X8yri3nvmWCBcUUYM0dOqo6S+IWGvwiJFWyoppRzAx2PrxSezJklWukL9p8gpgJcbip6GKTBcoagjuicsD0Xd02i7XsdxmS2TNILHnrI8ejKXlOK83p50M4xVrtTim5Km9Jbi88kOm2ttm9+NtY7U/ItwrBhNsDcEujhkKAtr+ttLIP3SE+PhPIgSKy6461namFsW4WT2EonuBqcRhYScAcqJh+MLhgT5Kiqlkcn9kxIzDhYV/bnqVuSLmZrA+j/SWiw/JKYrmF982s+9SXGU62jm2QXc2TjcfSXFPJBtBfIUn3awUK/cmTxsJh1xz/0lVsNfRYcSOABwwigyx3mlEv7h7ZNFDpTowHHh5kNk1G/RxcT80mZ79eyBaI9kcqw6CKlpRKNBK2mV9lR+sizxSok5zV9J5XMZQhTaluC3hprb+KHG/RWENkI1ibiIk2WjvU8IO5cZyBmxUVHZPE1NSnkHmoY7ezCRb/jN5lo1e+0bqI0Hl30wU5y2B9eMkmh527Cle61buLBZUTTHLId4n03Soao65FCe2E0Qa/J1gp1TgHON1olYwU21yo4SUepxtKXJp8RO251OcjsTV+HfnU6d52EOFJkOFADtWxt/8qzhiifghNhRQ11a5eKlnxfDsWxkUTedzf+Iu/a8O8kLNAY+scWudUM9y+lpHj5Shfc/CBCtZALkgY2LUQdF7QeZQqejluN90Lb1PLAwLO9gxhg4ry3P7cIWZyy+MIuF+MwWD8cfTUOuWiav2DNGBiN2nh9s5ytWd+9Ch+DwP1VdWvYmY4P53HQjQMLMoQOyJpL3GP/GDcVwaNzVptnkIdJT9s5VL0wERGhY= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(36860700013)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2025 08:44:39.5669 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d4b76e9c-9ef5-45f1-6203-08dd3b8a2c9c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E60.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6743 Add support in GHES to detect and process CXL CPER Protocol errors, as defined in UEFI v2.10, section N.2.13. Define struct cxl_cper_prot_err_work_data to cache CXL protocol error information, including RAS capabilities and severity, for further handling. These cached CXL CPER records will later be processed by workqueues within the CXL subsystem. Signed-off-by: Smita Koralahalli Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Reviewed-by: Ira Weiny --- drivers/acpi/apei/ghes.c | 54 ++++++++++++++++++++++++++++++++++++++++ include/cxl/event.h | 6 +++++ 2 files changed, 60 insertions(+) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index b72772494655..4d725d988c43 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -674,6 +674,56 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata, schedule_work(&entry->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; + + if (!(prot_err->valid_bits & PROT_ERR_VALID_AGENT_ADDRESS)) { + pr_err_ratelimited("CXL CPER invalid agent type\n"); + 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 != 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"); + + 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 = (u8 *)(prot_err + 1); + cap_start = dvsec_start + prot_err->dvsec_len; + + memcpy(&wd.ras_cap, cap_start, sizeof(wd.ras_cap)); + wd.severity = cper_severity_to_aer(severity); + break; + default: + pr_err_ratelimited("CXL CPER invalid agent type: %d\n", + prot_err->agent_type); + return; + } +#endif +} + /* Room for 8 entries for each of the 4 event log queues */ #define CXL_CPER_FIFO_DEPTH 32 DEFINE_KFIFO(cxl_cper_fifo, struct cxl_cper_work_data, CXL_CPER_FIFO_DEPTH); @@ -777,6 +827,10 @@ static bool ghes_do_proc(struct ghes *ghes, } else if (guid_equal(sec_type, &CPER_SEC_PROC_ARM)) { queued = ghes_handle_arm_hw_error(gdata, sev, sync); + } else if (guid_equal(sec_type, &CPER_SEC_CXL_PROT_ERR)) { + struct cxl_cper_sec_prot_err *prot_err = acpi_hest_get_payload(gdata); + + cxl_cper_post_prot_err(prot_err, gdata->error_severity); } else if (guid_equal(sec_type, &CPER_SEC_CXL_GEN_MEDIA_GUID)) { struct cxl_cper_event_rec *rec = acpi_hest_get_payload(gdata); diff --git a/include/cxl/event.h b/include/cxl/event.h index 66d85fc87701..ee1c3dec62fa 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -232,6 +232,12 @@ struct cxl_ras_capability_regs { u32 header_log[16]; }; +struct cxl_cper_prot_err_work_data { + struct cxl_cper_sec_prot_err prot_err; + struct cxl_ras_capability_regs ras_cap; + int severity; +}; + #ifdef CONFIG_ACPI_APEI_GHES int cxl_cper_register_work(struct work_struct *work); int cxl_cper_unregister_work(struct work_struct *work); From patchwork Thu Jan 23 08:44:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13948007 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2042.outbound.protection.outlook.com [40.107.100.42]) (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 8B2CD20C493; Thu, 23 Jan 2025 08:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.100.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621886; cv=fail; b=IvybtHCgGib94Z8v3243D/FcN5P/mbXSKnlD4USBk8iRKg65SRIQfbiKepaKW6q0bxY/QHjghL3yUgJPzUSkT70S01GeqCqcvsRQIcTG1t08fzz9B+bMe5dqfY9lpDzf27WscZmDC7wumEHedsssfkdzZ1ThoAZ5peShhiHXkx4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621886; c=relaxed/simple; bh=dpyyD7H+tDpsxviEFRpt8Cuy7h7MRuWBMCjs7WvKLho=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=H8/ZrTmrVfnLZgiwCIt1qxTU1vAWbYHt210vYG3W0/KyBhWvpluM3eKJ+XEXljeny6kUkKZ8fNuvFilpzXeRZoKuCwQEfkkGT9FEhE4lcuDAWLJVq4iuDtK0wDoHM/peysmIfzuWG622k2w2fXp6vi5cshtbIl4dga6laTXoG+k= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=weBflZkW; arc=fail smtp.client-ip=40.107.100.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="weBflZkW" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yykX8DtB6ZQOsPfweXs9a82tmWYAidksdvkcOiwgoNMv3qtHtoBhZadwrvI/LHFs9IeMgQH8ggmh9OeRCBldx+O6gJ3jF8j+4EKNTof1y8B1bVgxOj0b+uVrgb014235Spc0Vd+qFR0g5qiyJftVB+cxYQbNxVhUpxuBh5UzUDS2i13VPTBL0pDluqsITOtxX80xk/ds35PMqJI42cF24+UnN/nV5BS9kMDE04sSD7M1z/ZKCgHrNoMJCgt+qCFXFf3ear4l0ujdkTWkhJcvWWRSbIGawOz4F5PZl3nc4Vvb+bx3X/YH5dgdwFJYGI+jOh6Jw6E8uv7yTLQvwC0cnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LF/JMimVRWY4uHrdxO6dWiqIWgpb8KLSjEjMWyuvX94=; b=Y/IcpZC57mYdMzVvPOSlAnTZW9cGVdf16DyUqOw1WL9IsTaUEEchQ7c72IjJ4zEUnzuSAiVbAhCWY3xHnX3Uv5nsAntF8zF5Gp3ghkaqebiWsUXByfJ06tRSJLigzCXv6IgSKX0kLoOm1r+0xh3eXMMK6sLbxnIzn/7iH/vX3N/azCWMnj+tFklgXLF9r5scRCUCmcRi6m4sUCsysV75icehib3AgwM7JXAO4ExF8MmTV+BDu8oq2ob2sKKleWVyAsiwjjnIwfOowNAykXyZ8KBT/0bzc204ykFZ1B6UA5d6lqCws/aHB3cEqV0OUCWRkC5MvNpY1jovX0WjsHaSqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LF/JMimVRWY4uHrdxO6dWiqIWgpb8KLSjEjMWyuvX94=; b=weBflZkWCNsdm/bfeUUm1jXTcQN9ySWYzoqGns9vzrlf/9qZR/hF2kp/Zy0dR5QWn5g991KIgz/SGSejxd6RJznXnGLv8DgOJCM4C2PUhwKZTPZ/5VcXckElQD8GQH6CqP5up2N0wkgod3Nvzjx6Y95xKoE2DPI2IYrAgrlh8cU= Received: from BLAP220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::34) by IA1PR12MB7757.namprd12.prod.outlook.com (2603:10b6:208:422::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.17; Thu, 23 Jan 2025 08:44:40 +0000 Received: from BL6PEPF00020E60.namprd04.prod.outlook.com (2603:10b6:208:32c:cafe::49) by BLAP220CA0029.outlook.office365.com (2603:10b6:208:32c::34) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8356.21 via Frontend Transport; Thu, 23 Jan 2025 08:44:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00020E60.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8377.8 via Frontend Transport; Thu, 23 Jan 2025 08:44:40 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 23 Jan 2025 02:44:39 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v6 5/6] acpi/ghes, cxl/pci: Process CXL CPER Protocol Errors Date: Thu, 23 Jan 2025 08:44:20 +0000 Message-ID: <20250123084421.127697-6-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> References: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E60:EE_|IA1PR12MB7757:EE_ X-MS-Office365-Filtering-Correlation-Id: ab3c4bda-5b96-44b9-849f-08dd3b8a2d00 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|1800799024|376014; X-Microsoft-Antispam-Message-Info: eyv8FUDlweVdOPDLiYVC5IHkiecFGawy/1kPQYnfYLapQ+gBJPH5seTsnDIgIIJmxhnJvK9c/fMIdbkVGV5WzbwDV9LbdvW4oRcW8Po2HDqzNJTT76Tr3KomTexh2ZG5Ub9ux7nE+dlF5c+IuDpIzkjyyOHTBLodCsk4v+7LGncp0vDZV3W66ai0I9RyZ8cDjZSDIhskRo233SYdgdM8S6jTTOu3H7ZdvS1pAYrRTbtYyu3xqz8GUqDbh46pGgna/0Q4hUmBaVikS/mtA7CR63hlvRxsLc37T6hY5ZjewGj95KDL11RSeeTwdB5NZ5gnVkNjkhtIMDAkcyOIOidatMv6GKioyGS6SeHFteWvIPN121k5sgjMBAiCWQbae7nQ9S7/Z4BEiNh0WGOb36fyfIlJA0i8XpZNvIQspN5ORMb0n/Dp0bmxn8f2kD1t61WsMVn3CS8EB99HDY4u4s4gLhyT9qWEmfSjbU0EeSWsDS4uCQEaE1LMVE2P0W5odBufDejUU7tKGYoPmSFwbqe9XEpnrIA0Nc/SYIg9CsJWHQDQRiswgE+6kOLG05ncdo/8FUxeTINIgFtSXlyCjfBroKsa3BpLnUWbFwuYPdXeJNhtuhOa8IoeDq3pSnpkGG/e3oXCd3sk5DOGX9w7/ka4sGK/hJM+326nbag0a2MOd8rpHIZuL4R+0Q/ccV+IAweaD5gcgRoZEdfojeozKu8fKkDuf87zjOCmnzJNKPcGgcw/y9toZL2eA8YF0s8eeyGaqNmuj7FITfEjxjnL2xVZN7VC/U3pGsuWH47yJzif05psLtT1i+YQFrGUgDJBv3phB1A1V1a4KWXk2Sk4UdWfWFZCg5fdi5dSqFPEo7tPo/mMj7wJsHhTm7VQ/2/iv4WlDnvH1Z8IQx0BSV6acXXCVnRIxtEtNoXoVF76hv0xJQm4KvGMZ70c0xSIXQyoMGSr2ZbQLgL/X9BxvyKxwWJNmrmYuY4jEQdgb/Bk+YDHW1Y/rfZaoGwvEjRDEMDlO9v0KhL9sTq3IU90iZQIziUInD/3B00WPUU7X0fdfqZrZbIuZEr18pWAQ6rPpgNoMjlY+412iZ15+ox8MdH7AMd+T/bhrYyNr/EwH83fJwk0qVzlj+hYMLFYDWI5qy/jCWJxUiu8+0POL1NkOp71zwawQ0r5yTX8x79WdNCglSdGtCKb+l4LQBi2fcZY+s7FaLKjGst2OrUHz4JyB1Ug/Zln0Em/lzcskWNJQgDCfL09CuAzVketwKID/8hct9Eurtp6sn19p/QlpFYNzjfx/le/0PBVMdoNVhyJknPN1jGyWbWe6/PggEyMiO1wPWw/55xwfzfXJO069RNCN7NDIh0g2soJOYzTK1n7Ko90rfM9E6bq6yxkA8IdzcG3SMj4dqoK7r7MFgCfsTtH/NAHwr+XeMZuUCSj91g50SQ3wVfTqkUs7nKLszcHuaxFqKg8gChmtN14k3VANbP09NoLZoPwzSLKxvLcZeLSnf2VEWSCjhY= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(1800799024)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2025 08:44:40.2387 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab3c4bda-5b96-44b9-849f-08dd3b8a2d00 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E60.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7757 When PCIe AER is in FW-First, OS should process CXL Protocol errors from CPER records. Introduce support for handling and logging CXL Protocol errors. The defined trace events cxl_aer_uncorrectable_error and cxl_aer_correctable_error trace native CXL AER endpoint errors. Reuse them to trace FW-First Protocol errors. Since the CXL code is required to be called from process context and GHES is in interrupt context, use workqueues for processing. Similar to CXL CPER event handling, use kfifo to handle errors as it simplifies queue processing by providing lock free fifo operations. Add the ability for the CXL sub-system to register a workqueue to process CXL CPER protocol errors. Signed-off-by: Smita Koralahalli Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Ira Weiny --- drivers/acpi/apei/ghes.c | 49 ++++++++++++++++++++++++++++++++++++++++ drivers/cxl/core/pci.c | 36 +++++++++++++++++++++++++++++ drivers/cxl/cxlpci.h | 5 ++++ drivers/cxl/pci.c | 46 ++++++++++++++++++++++++++++++++++++- include/cxl/event.h | 15 ++++++++++++ 5 files changed, 150 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 4d725d988c43..289e365f84b2 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -674,6 +674,15 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata, schedule_work(&entry->work); } +/* Room for 8 entries */ +#define CXL_CPER_PROT_ERR_FIFO_DEPTH 8 +static DEFINE_KFIFO(cxl_cper_prot_err_fifo, struct cxl_cper_prot_err_work_data, + CXL_CPER_PROT_ERR_FIFO_DEPTH); + +/* Synchronize schedule_work() with cxl_cper_prot_err_work changes */ +static DEFINE_SPINLOCK(cxl_cper_prot_err_work_lock); +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) { @@ -700,6 +709,11 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err, if (!(prot_err->valid_bits & PROT_ERR_VALID_SERIAL_NUMBER)) pr_warn(FW_WARN "CXL CPER no device serial number\n"); + 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: @@ -721,9 +735,44 @@ static void cxl_cper_post_prot_err(struct cxl_cper_sec_prot_err *prot_err, prot_err->agent_type); return; } + + if (!kfifo_put(&cxl_cper_prot_err_fifo, wd)) { + pr_err_ratelimited("CXL CPER kfifo overflow\n"); + return; + } + + schedule_work(cxl_cper_prot_err_work); #endif } +int cxl_cper_register_prot_err_work(struct work_struct *work) +{ + if (cxl_cper_prot_err_work) + return -EINVAL; + + guard(spinlock)(&cxl_cper_prot_err_work_lock); + cxl_cper_prot_err_work = work; + return 0; +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_register_prot_err_work, "CXL"); + +int cxl_cper_unregister_prot_err_work(struct work_struct *work) +{ + if (cxl_cper_prot_err_work != work) + return -EINVAL; + + guard(spinlock)(&cxl_cper_prot_err_work_lock); + cxl_cper_prot_err_work = NULL; + return 0; +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_unregister_prot_err_work, "CXL"); + +int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd) +{ + return kfifo_get(&cxl_cper_prot_err_fifo, wd); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_prot_err_kfifo_get, "CXL"); + /* Room for 8 entries for each of the 4 event log queues */ #define CXL_CPER_FIFO_DEPTH 32 DEFINE_KFIFO(cxl_cper_fifo, struct cxl_cper_work_data, CXL_CPER_FIFO_DEPTH); diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c index 9d58ab9d33c5..5840056bb9a3 100644 --- a/drivers/cxl/core/pci.c +++ b/drivers/cxl/core/pci.c @@ -650,6 +650,42 @@ void read_cdat_data(struct cxl_port *port) } EXPORT_SYMBOL_NS_GPL(read_cdat_data, "CXL"); +void cxl_cper_trace_corr_prot_err(struct pci_dev *pdev, + struct cxl_ras_capability_regs ras_cap) +{ + u32 status = ras_cap.cor_status & ~ras_cap.cor_mask; + struct cxl_dev_state *cxlds; + + cxlds = pci_get_drvdata(pdev); + if (!cxlds) + return; + + trace_cxl_aer_correctable_error(cxlds->cxlmd, status); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_trace_corr_prot_err, "CXL"); + +void cxl_cper_trace_uncorr_prot_err(struct pci_dev *pdev, + struct cxl_ras_capability_regs ras_cap) +{ + u32 status = ras_cap.uncor_status & ~ras_cap.uncor_mask; + struct cxl_dev_state *cxlds; + u32 fe; + + cxlds = pci_get_drvdata(pdev); + if (!cxlds) + return; + + if (hweight32(status) > 1) + fe = BIT(FIELD_GET(CXL_RAS_CAP_CONTROL_FE_MASK, + ras_cap.cap_control)); + else + fe = status; + + trace_cxl_aer_uncorrectable_error(cxlds->cxlmd, status, fe, + ras_cap.header_log); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_trace_uncorr_prot_err, "CXL"); + static void __cxl_handle_cor_ras(struct cxl_dev_state *cxlds, void __iomem *ras_base) { diff --git a/drivers/cxl/cxlpci.h b/drivers/cxl/cxlpci.h index 4da07727ab9c..e457616373ed 100644 --- a/drivers/cxl/cxlpci.h +++ b/drivers/cxl/cxlpci.h @@ -129,4 +129,9 @@ void read_cdat_data(struct cxl_port *port); void cxl_cor_error_detected(struct pci_dev *pdev); pci_ers_result_t cxl_error_detected(struct pci_dev *pdev, pci_channel_state_t state); +struct cxl_ras_capability_regs; +void cxl_cper_trace_corr_prot_err(struct pci_dev *pdev, + struct cxl_ras_capability_regs ras_cap); +void cxl_cper_trace_uncorr_prot_err(struct pci_dev *pdev, + struct cxl_ras_capability_regs ras_cap); #endif /* __CXL_PCI_H__ */ diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 6d94ff4a4f1a..9d4b5f39b21a 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -1160,6 +1160,37 @@ static void cxl_cper_work_fn(struct work_struct *work) } static DECLARE_WORK(cxl_cper_work, cxl_cper_work_fn); +static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) +{ + unsigned int devfn = PCI_DEVFN(data->prot_err.agent_addr.device, + data->prot_err.agent_addr.function); + struct pci_dev *pdev __free(pci_dev_put) = + pci_get_domain_bus_and_slot(data->prot_err.agent_addr.segment, + data->prot_err.agent_addr.bus, + devfn); + + if (!pdev) + return; + + guard(device)(&pdev->dev); + if (pdev->driver != &cxl_pci_driver) + return; + + if (data->severity == AER_CORRECTABLE) + cxl_cper_trace_corr_prot_err(pdev, data->ras_cap); + else + cxl_cper_trace_uncorr_prot_err(pdev, data->ras_cap); +} + +static void cxl_cper_prot_err_work_fn(struct work_struct *work) +{ + struct cxl_cper_prot_err_work_data wd; + + while (cxl_cper_prot_err_kfifo_get(&wd)) + cxl_cper_handle_prot_err(&wd); +} +static DECLARE_WORK(cxl_cper_prot_err_work, cxl_cper_prot_err_work_fn); + static int __init cxl_pci_driver_init(void) { int rc; @@ -1170,7 +1201,18 @@ static int __init cxl_pci_driver_init(void) rc = cxl_cper_register_work(&cxl_cper_work); if (rc) - pci_unregister_driver(&cxl_pci_driver); + goto err_unreg; + + rc = cxl_cper_register_prot_err_work(&cxl_cper_prot_err_work); + if (rc) + goto err_unregister_work; + + return 0; + +err_unregister_work: + cxl_cper_unregister_work(&cxl_cper_work); +err_unreg: + pci_unregister_driver(&cxl_pci_driver); return rc; } @@ -1178,7 +1220,9 @@ static int __init cxl_pci_driver_init(void) static void __exit cxl_pci_driver_exit(void) { cxl_cper_unregister_work(&cxl_cper_work); + cxl_cper_unregister_prot_err_work(&cxl_cper_prot_err_work); cancel_work_sync(&cxl_cper_work); + cancel_work_sync(&cxl_cper_prot_err_work); pci_unregister_driver(&cxl_pci_driver); } diff --git a/include/cxl/event.h b/include/cxl/event.h index ee1c3dec62fa..359a8f44a2e0 100644 --- a/include/cxl/event.h +++ b/include/cxl/event.h @@ -242,6 +242,9 @@ struct cxl_cper_prot_err_work_data { int cxl_cper_register_work(struct work_struct *work); int cxl_cper_unregister_work(struct work_struct *work); int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd); +int cxl_cper_register_prot_err_work(struct work_struct *work); +int cxl_cper_unregister_prot_err_work(struct work_struct *work); +int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd); #else static inline int cxl_cper_register_work(struct work_struct *work) { @@ -256,6 +259,18 @@ static inline int cxl_cper_kfifo_get(struct cxl_cper_work_data *wd) { return 0; } +static inline int cxl_cper_register_prot_err_work(struct work_struct *work) +{ + return 0; +} +static inline int cxl_cper_unregister_prot_err_work(struct work_struct *work) +{ + return 0; +} +static inline int cxl_cper_prot_err_kfifo_get(struct cxl_cper_prot_err_work_data *wd) +{ + return 0; +} #endif #endif /* _LINUX_CXL_EVENT_H */ From patchwork Thu Jan 23 08:44:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Smita Koralahalli X-Patchwork-Id: 13948008 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2075.outbound.protection.outlook.com [40.107.220.75]) (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 C543920CCCD; Thu, 23 Jan 2025 08:45:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.220.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621905; cv=fail; b=loVz9aYWYxz+hOp7y0uYDGm2ss0KqdOiumgFqAgT5B04uxU2p6sNO25dInNa23HIp/2IMBBHcwncupl7XUUvi9owfHo6+l+Z6k4q4TONNKWOtmMAAEvIoTbEDUthkucWoomISQZy29pDGEU5YmtaNLLsxlt3geNg1HvuMSMC68c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737621905; c=relaxed/simple; bh=nYtZtn05jrbRiNXU330/UdKXSRXBc7NR1p+Qrj5Y2L8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=QTXipmB8YDbzfKGqBvuKQvwnSNcF7V2gEY9yroqH7rihlM14SAro8EYgA5uN7mph+ljS9TAXGr4Dxi+PueDMNODx4X4AeWpJ/W8IyP/WcU2FwEyyYap/0aN1pU4hd1EeR1AC/eZuDIByOnSQQ6IsUdDxX/dzhJ1M7tPTjB0iYN8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=iLYVXiLN; arc=fail smtp.client-ip=40.107.220.75 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="iLYVXiLN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qmyWnMYc206yAiWxFYlbj8iE9DBQPz1I4V0TTJhFQz8mekvFS53JTeN//4d7GRYz95oAH02KUQ7lwjt81MQURv2v6pBpPUxEAiwQIJqc4uIP0KnKUwhVNVj2YG7293ZxbqbirqNETNSR/Fk49spY6VCRQmtLj/l+c6DQof/1Llm/+ch9Q75mUXimDM5NIbtxngaMFSz1byLQJsZ3LccCrqC/dnbsIU3wQz97j+vyxO13y8WJyEMQXxfWlV7S/VdyDVhGxCkeLVRbfSa6iVMzQ3JgvYKabr/x0Ghk3frS2z+fzFOyuf6cMFQBVUE06DGFhMlyyaJ3dSSam3Ierbwrlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RUOSl0l/6+oCAycMRhw0c2mCUCrmhGHOPECc0DqVCCY=; b=dwHof2aORdPMT2eDM1/lAit+/RUJY55bN3XER0/QD5u87p1m1vFAyMqXe+Ky5ntQYrlnn27Wyhk5vO8Dd/Ii4Wf41Fuv08fwpKNmInjRhawoAHoKmVw+kEDixjJNwj7sr1R97quf3SMFB+gw+nDgJ/jRMCiTACz2XoLA9Z4NXfuNXZsTV21BWVQR2L+Q5h/hIoj8nW/vhVqdK4ir1TlkJcAJPymqNP9/c0cbQizn7PGsUwxGTcQ8EuDWcFUN+hopKm59A6wOvgHB9JoCtbtujdNYurcaV/0AMjHo9VYf7iPXicWGzmfCXOMjaFULIu8kFlAb+xwrhovxYCh4mmr6Hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RUOSl0l/6+oCAycMRhw0c2mCUCrmhGHOPECc0DqVCCY=; b=iLYVXiLNPCMNaICElPUfkXEbe7y8bhjuXj2SLEQ1mVDLG6s3HxJeTUewa7idq0ZYmWd1e4rVOXq1rJevfOjKsbPfzd7gwyWjeBuMaGmqzx0LF7vIwIGpdjxuRFVCHU9hsdwQw96wMRJ/mJxVZM/pTRgc80cdw+lmkLHxz3Z/sfM= Received: from BLAP220CA0019.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:32c::24) by IA0PR12MB8861.namprd12.prod.outlook.com (2603:10b6:208:487::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8377.16; Thu, 23 Jan 2025 08:44:40 +0000 Received: from BL6PEPF00020E60.namprd04.prod.outlook.com (2603:10b6:208:32c:cafe::e4) by BLAP220CA0019.outlook.office365.com (2603:10b6:208:32c::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8377.17 via Frontend Transport; Thu, 23 Jan 2025 08:44:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL6PEPF00020E60.mail.protection.outlook.com (10.167.249.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.8377.8 via Frontend Transport; Thu, 23 Jan 2025 08:44:40 +0000 Received: from ethanolx50f7host.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39; Thu, 23 Jan 2025 02:44:39 -0600 From: Smita Koralahalli To: , , CC: Ard Biesheuvel , Alison Schofield , Vishal Verma , "Ira Weiny" , Dan Williams , Jonathan Cameron , Yazen Ghannam , Terry Bowman , "Smita Koralahalli" Subject: [PATCH v6 6/6] cxl/pci: Add trace logging for CXL PCIe Port RAS errors Date: Thu, 23 Jan 2025 08:44:21 +0000 Message-ID: <20250123084421.127697-7-Smita.KoralahalliChannabasappa@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> References: <20250123084421.127697-1-Smita.KoralahalliChannabasappa@amd.com> Precedence: bulk X-Mailing-List: linux-cxl@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF00020E60:EE_|IA0PR12MB8861:EE_ X-MS-Office365-Filtering-Correlation-Id: b81f9cfa-9fcf-442c-5ac8-08dd3b8a2d37 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|82310400026|36860700013; X-Microsoft-Antispam-Message-Info: FJCX2z0bOwkiENF6J7XB2SGhpcY4V7h/M+ZiAFyAsPioT+oJ+aW7w/anYb2JAOD3ozMfZtwVgn/bn0R0mdqZyA9YWdz+jRhnQnEJi1eFN9OEsqs5/3c7gtVH5RnflC7ApRUGHt5Fck6mO9iqDs71/o5kw5EZx11q3BwAl41MV+/6VusqZkbmzBUqU8I5R3nEsm8gBIFTKllx1x+4zYJLO6Ue+9d/c6ypTj0TMNg8iXXU8lDszQ4Z0eGaRpotVJnFf1vyZIIbO33fkZF6Xcx+zssSGsuMJTz0wfBfnhMgHZgDpmdCwX+VdvJgVy8lNoWW5Krsipzz025Yx4aCqVefSkyFtV9TCdgUeB9elBcp2X0uIL3SfR/W5Sy9oDWieA7T62jOGudPNcpfjB+q7vX7vDDsZEHo0Z6LMeSJPRSpppoHGI2/9zmie1FOdl9So3KbMZU0po1+uZ3PDqMo/Ychha5AIf49nPWvUmIhT3971EcEjVzTTt6RLiS0F1y5a4fQBNQ5HX5+eiwF7KgDj7dk0+kJNWBlQXp2wStQTGOsgy6lHXvnEWeeAAwlZ/avHTJOGf7lHXd27Qy5IvIWTZGyeSYjb7owxIVprGuSqjN0TTaSu54NLAenYm49c/Bwokvt8ruO+E2IwRUKPNkRwO7lMUK3uiDre/yDGXB71A26cJ769ulYQxU9pVaLZ9/qMrgw0Bs2V7qj5U7p93RNiA6XhKJGTjdQtGKcNVqgLQH77854PjZ1S4+0gCmRKgmkA4FjLj2JRaC9XLnDMhorcEy+xh85p4Bwd/QGHn3cyTkyHKUujhJB3rBCjG6cBH28lVXBDGe0vyN1pZPRbFBXClufNOJaToXZeomUCjG87+ReWaZ7PoUilviJSL44K1fj5y34PAU+Zp884/3JUlaWaPQ4dtlLkIX/7iqSwE1npNP7FEDkUFPzFUjNGW1586YzjDSJN3TgFlLUb1U/36HQC1RkAENAps5CzlXUOgfUJtfE+OE6mv33p8v3t3RL49rkhQuILXmBT8KvPb4PewTBqqYa9t6zGLGKGJHgfZ3gy3SZmbud2yT+l1WdsHbRWLZpwMEtib3jKA14mly1k/Yqjkk/eTxW0vuTdgoXEu/f2FU7UVFPwuOu1idI9yFmHYq6VavSAPl/yQ5b0f5yVx2v9OTg/QILwwldF8XUXLUG66LjC3RTg5USvXC+3AF5l0e1KgGX0HkDcz6ACXwbcuOmfhE7qBuxKBSHFRVpkwfM+VUCIf9yMLjLHM//2ZdymzOEfxzrhu+/IJcOCyvdEwVv51tcK3mMJyE0+CFkOHlAANRCr1sZbBprL/buoUi/xByvfzPhIsM+1LALYpVpCLa3b6CTKgi5QWDJSjriH2eMvByPdv3LGdXjaxTS9GGLo1vr9FRXtk3wG8z2RVENihJRDBroXwH6je97Z23gr1cc9GLeRByHAoc6tEkRPLO+oXMdoCs9At25MGcisaM3jrgiKQdQikAx0l2cPjuRUCWa6PhVO04= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(1800799024)(82310400026)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2025 08:44:40.5981 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b81f9cfa-9fcf-442c-5ac8-08dd3b8a2d37 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF00020E60.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB8861 The CXL drivers use kernel trace functions for logging endpoint and Restricted CXL host (RCH) Downstream Port RAS errors. Similar functionality is required for CXL Root Ports, CXL Downstream Switch Ports, and CXL Upstream Switch Ports. Introduce trace logging functions for both RAS correctable and uncorrectable errors specific to CXL PCIe Ports. Use them to trace FW-First Protocol errors. Co-developed-by: Terry Bowman Signed-off-by: Terry Bowman Signed-off-by: Smita Koralahalli Reviewed-by: Ira Weiny --- drivers/cxl/core/pci.c | 26 ++++++++++++++++++++++ drivers/cxl/core/trace.h | 47 ++++++++++++++++++++++++++++++++++++++++ drivers/cxl/cxlpci.h | 4 ++++ drivers/cxl/pci.c | 13 +++++++++++ 4 files changed, 90 insertions(+) diff --git a/drivers/cxl/core/pci.c b/drivers/cxl/core/pci.c index 5840056bb9a3..b535da901dec 100644 --- a/drivers/cxl/core/pci.c +++ b/drivers/cxl/core/pci.c @@ -686,6 +686,32 @@ void cxl_cper_trace_uncorr_prot_err(struct pci_dev *pdev, } EXPORT_SYMBOL_NS_GPL(cxl_cper_trace_uncorr_prot_err, "CXL"); +void cxl_cper_trace_corr_port_prot_err(struct pci_dev *pdev, + struct cxl_ras_capability_regs ras_cap) +{ + u32 status = ras_cap.cor_status & ~ras_cap.cor_mask; + + trace_cxl_port_aer_correctable_error(&pdev->dev, status); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_trace_corr_port_prot_err, "CXL"); + +void cxl_cper_trace_uncorr_port_prot_err(struct pci_dev *pdev, + struct cxl_ras_capability_regs ras_cap) +{ + u32 status = ras_cap.uncor_status & ~ras_cap.uncor_mask; + u32 fe; + + if (hweight32(status) > 1) + fe = BIT(FIELD_GET(CXL_RAS_CAP_CONTROL_FE_MASK, + ras_cap.cap_control)); + else + fe = status; + + trace_cxl_port_aer_uncorrectable_error(&pdev->dev, status, fe, + ras_cap.header_log); +} +EXPORT_SYMBOL_NS_GPL(cxl_cper_trace_uncorr_port_prot_err, "CXL"); + static void __cxl_handle_cor_ras(struct cxl_dev_state *cxlds, void __iomem *ras_base) { diff --git a/drivers/cxl/core/trace.h b/drivers/cxl/core/trace.h index 8389a94adb1a..f684a2ae14e8 100644 --- a/drivers/cxl/core/trace.h +++ b/drivers/cxl/core/trace.h @@ -48,6 +48,34 @@ { CXL_RAS_UC_IDE_RX_ERR, "IDE Rx Error" } \ ) +TRACE_EVENT(cxl_port_aer_uncorrectable_error, + TP_PROTO(struct device *dev, u32 status, u32 fe, u32 *hl), + TP_ARGS(dev, status, fe, hl), + TP_STRUCT__entry( + __string(devname, dev_name(dev)) + __string(parent, dev_name(dev->parent)) + __field(u32, status) + __field(u32, first_error) + __array(u32, header_log, CXL_HEADERLOG_SIZE_U32) + ), + TP_fast_assign( + __assign_str(devname); + __assign_str(parent); + __entry->status = status; + __entry->first_error = fe; + /* + * Embed the 512B headerlog data for user app retrieval and + * parsing, but no need to print this in the trace buffer. + */ + memcpy(__entry->header_log, hl, CXL_HEADERLOG_SIZE); + ), + TP_printk("device=%s host=%s status: '%s' first_error: '%s'", + __get_str(devname), __get_str(parent), + show_uc_errs(__entry->status), + show_uc_errs(__entry->first_error) + ) +); + TRACE_EVENT(cxl_aer_uncorrectable_error, TP_PROTO(const struct cxl_memdev *cxlmd, u32 status, u32 fe, u32 *hl), TP_ARGS(cxlmd, status, fe, hl), @@ -96,6 +124,25 @@ TRACE_EVENT(cxl_aer_uncorrectable_error, { CXL_RAS_CE_PHYS_LAYER_ERR, "Received Error From Physical Layer" } \ ) +TRACE_EVENT(cxl_port_aer_correctable_error, + TP_PROTO(struct device *dev, u32 status), + TP_ARGS(dev, status), + TP_STRUCT__entry( + __string(devname, dev_name(dev)) + __string(parent, dev_name(dev->parent)) + __field(u32, status) + ), + TP_fast_assign( + __assign_str(devname); + __assign_str(parent); + __entry->status = status; + ), + TP_printk("device=%s host=%s status='%s'", + __get_str(devname), __get_str(parent), + show_ce_errs(__entry->status) + ) +); + TRACE_EVENT(cxl_aer_correctable_error, TP_PROTO(const struct cxl_memdev *cxlmd, u32 status), TP_ARGS(cxlmd, status), diff --git a/drivers/cxl/cxlpci.h b/drivers/cxl/cxlpci.h index e457616373ed..23f2b1c9bd13 100644 --- a/drivers/cxl/cxlpci.h +++ b/drivers/cxl/cxlpci.h @@ -134,4 +134,8 @@ void cxl_cper_trace_corr_prot_err(struct pci_dev *pdev, struct cxl_ras_capability_regs ras_cap); void cxl_cper_trace_uncorr_prot_err(struct pci_dev *pdev, struct cxl_ras_capability_regs ras_cap); +void cxl_cper_trace_corr_port_prot_err(struct pci_dev *pdev, + struct cxl_ras_capability_regs ras_cap); +void cxl_cper_trace_uncorr_port_prot_err(struct pci_dev *pdev, + struct cxl_ras_capability_regs ras_cap); #endif /* __CXL_PCI_H__ */ diff --git a/drivers/cxl/pci.c b/drivers/cxl/pci.c index 9d4b5f39b21a..766447c169c8 100644 --- a/drivers/cxl/pci.c +++ b/drivers/cxl/pci.c @@ -1168,6 +1168,7 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) pci_get_domain_bus_and_slot(data->prot_err.agent_addr.segment, data->prot_err.agent_addr.bus, devfn); + int port_type; if (!pdev) return; @@ -1176,6 +1177,18 @@ static void cxl_cper_handle_prot_err(struct cxl_cper_prot_err_work_data *data) if (pdev->driver != &cxl_pci_driver) return; + port_type = pci_pcie_type(pdev); + if (port_type == PCI_EXP_TYPE_ROOT_PORT || + port_type == PCI_EXP_TYPE_DOWNSTREAM || + port_type == PCI_EXP_TYPE_UPSTREAM) { + if (data->severity == AER_CORRECTABLE) + cxl_cper_trace_corr_port_prot_err(pdev, data->ras_cap); + else + cxl_cper_trace_uncorr_port_prot_err(pdev, data->ras_cap); + + return; + } + if (data->severity == AER_CORRECTABLE) cxl_cper_trace_corr_prot_err(pdev, data->ras_cap); else