From patchwork Mon Jan 15 17:20:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 762771 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2060.outbound.protection.outlook.com [40.107.244.60]) (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 3FAFE17C79; Mon, 15 Jan 2024 17:20:41 +0000 (UTC) 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="0XzMCFCj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAFLZR6JYWGTbExrvR3JoGr9UEX/dHaW6KqMUlBhSV0eq/2EjZwjgObTbKuoFrs2Ul2usHOFBrlIQQDr6XBYw/0JfVIR13FFEWLZW6aZHuUhUje9nOFXIxq7D5+2Ogv6+TDre+A1MBrSi26iBVFh5BRo5TiCnHxXbgl7rVNURBGpxnHgVk6InW+qCUtgKQE1kkbX7gedVdc5hXiBcldDxNNlsZa98dcIoP4HD8cOpvPyMoK3OG9J5AP2DACeyCyJKUzDERkaSyMSlVdX9dIJAc3sPIhVE7ArpCP3b755BPRO55JeRjQQ/S1PIzvfVwsqaP0CrdD8Dd/pLP9BjZZhqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=LE1Nayuo6cmerUv2S5v/MoIHyvnDMrrJcnis/eL0ayE=; b=b3U6EY+YCr2oM0J17hkHwmbgNuOyF39BW7hSAmobaKXWNIZhKz4j8G1Do7ngmuOw1EEanvT4u7OQUsFYmTtU0pMbBkrd/W+Y/PpCdVsCtYGHrQOD08kdBhUK7hx0PZRZmnUXuPb32ezsPmZ03d6OXII4J3kcsQXtlSt5u2a0pnPhuwub23FCCVsNje5VuaR27o3qkBhfR+md0qVQ0Yb95SOaxHIhLNpyLzJsaBgC0eYbcT1C2DhqjOeU5KQMhO39zq8ARRgej/qypdqc1/amDw6QOUyF51q1Alksjcd4rcoQ108YAce8846uuenm4YHxl/MLZdeGYZ0SG9s3scSOdg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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=LE1Nayuo6cmerUv2S5v/MoIHyvnDMrrJcnis/eL0ayE=; b=0XzMCFCjbSg2SYtBQxEcUIuWBsOwTYwH51qdS2nLPVG2QriX3xChIHqC7bsNV3lEcYgAFkr0xwexoRJ8c+kc1CLaIoWG2oSG0y2h5Ya0U98zouGXvcV/oe8P6XbvMM0GM0x50YaCexnGnKJ3UM8HB4dZXiJCShMbtgotUHeqpao= Received: from BL1PR13CA0238.namprd13.prod.outlook.com (2603:10b6:208:2bf::33) by SN7PR12MB7178.namprd12.prod.outlook.com (2603:10b6:806:2a6::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23; Mon, 15 Jan 2024 17:20:39 +0000 Received: from BL6PEPF0001AB4D.namprd04.prod.outlook.com (2603:10b6:208:2bf:cafe::a) by BL1PR13CA0238.outlook.office365.com (2603:10b6:208:2bf::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.15 via Frontend Transport; Mon, 15 Jan 2024 17:20: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 BL6PEPF0001AB4D.mail.protection.outlook.com (10.167.242.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Mon, 15 Jan 2024 17:20:38 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.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.34; Mon, 15 Jan 2024 11:20:36 -0600 From: Ben Cheatham To: , , , , , , , CC: , , Subject: [PATCH v9 1/5] cxl, ACPI, APEI, EINJ: Add CXL_EINJ Kconfig option Date: Mon, 15 Jan 2024 11:20:03 -0600 Message-ID: <20240115172007.309547-2-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> References: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4D:EE_|SN7PR12MB7178:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ad1a214-eed0-4b48-d7eb-08dc15ee4b4e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9dLcGQpLNVJvTo1n0MKLPakcYkLa30N1crZPzN0djtFisoW+0YlSjQbQnhi3RECHoTzCcWqDI7+VzaTPrUeeG6N7RN9VQLqgUeB0y0cbbnQhyt11t3aK63mhrnukM6Q0gtzPWIjPAveF6jrIIMcHobwpJeooy3nsCZZtEn7O3px/V1klIlac1Os9xF9e/PIl8wzhNPsYpcWs2UrTXWFl/yNUZajr7LRrRzj2F53M6AkyaettB4bdTGWdpCYRNuZIK/5FZcS5/D8899ZcIKllwiT6fBJxB/TShgi9qWQwnO51pFWb9OEohK7mNYoooJ2kyJJdMSw/sPTaJCcyubQOBi/fTZoU7ThQ7ayGL+aSXBPzqQ+MLS0Zo2cy17vukiBlY0olnLmL85g0eLy1haKj+uw9SxSrWGgkF5Tfiw5RJ0M4WbcQGRGxZHK4pbv2FK1dw6h/72COSPTKowlgoTIVvDd96yl7kKhL1iUI6siGeJJpXVFLttl64tLMBF9T0QD2GsS38I1GAJvU0DY8N1QZSclH1AdtHtqXxowTLJJ0mYeVTVoLrQbzae2Yhj9rg/1JYS6zou3BEwBqqnnidVdkXS8QT7K4mjAde19e2WPMJGqKcwTnNkt8WrEnbWSmu4yaAGUsNfH9jhZImV3ERQf8bqyPmoYcBnhyxDeBpBuecqh0SF3JMAgoQe/+76J3nnscHOfNnpxMxlRrK66RMvrVHCAJG6oYeOcu/+jamuiSo+Pwmo7zu6/vj+QoGzh6tQpG3jhG93qxm1KFfGYh1Wq4mxPSfP6zsuuNTXNPrhJDoWA= 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:(13230031)(4636009)(346002)(39860400002)(396003)(136003)(376002)(230922051799003)(451199024)(82310400011)(186009)(1800799012)(64100799003)(40470700004)(46966006)(36840700001)(16526019)(6666004)(336012)(426003)(2616005)(26005)(7696005)(86362001)(47076005)(7416002)(5660300002)(2906002)(110136005)(41300700001)(83380400001)(8676002)(70206006)(54906003)(70586007)(8936002)(316002)(4326008)(36860700001)(478600001)(81166007)(356005)(36756003)(82740400003)(1076003)(40460700003)(40480700001)(36900700001)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:20:38.9157 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4ad1a214-eed0-4b48-d7eb-08dc15ee4b4e 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: BL6PEPF0001AB4D.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7178 Add CONFIG_CXL_EINJ to cxl/Kconfig. This option will allow for the CXL core module to access helpers inside the EINJ module, while also giving users the option of disabling CXL EINJ error types at build time. Also update CONFIG_ACPI_APEI_EINJ to set CONFIG_CXL_EINJ by default. Signed-off-by: Ben Cheatham --- drivers/cxl/Kconfig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/cxl/Kconfig b/drivers/cxl/Kconfig index 67998dbd1d46..95f215a2e5dc 100644 --- a/drivers/cxl/Kconfig +++ b/drivers/cxl/Kconfig @@ -157,4 +157,16 @@ config CXL_PMU monitoring units and provide standard perf based interfaces. If unsure say 'm'. + +config CXL_EINJ + bool "CXL Error INJection Support" + default ACPI_APEI_EINJ + depends on ACPI_APEI_EINJ >= CXL_BUS + help + Support for CXL protocol Error INJection through debugfs/cxl. + Availability and which errors are supported is dependent on + the host platform. Look to ACPI v6.5 section 18.6.4 and kernel + EINJ documentation for more information. + + If unsure say 'n' endif From patchwork Mon Jan 15 17:20:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 763312 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2051.outbound.protection.outlook.com [40.107.237.51]) (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 88A0817C7B; Mon, 15 Jan 2024 17:20:57 +0000 (UTC) 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="PwMMT0l/" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ONMb4Ysek26MFxgXkr+2vpHO/yvna/m6+byHZhB7ULBboGnMeE4iT0OhdExXY+99AMeIFI9dJlHB6E7cfTz3M9RpkjAhx71F8psvkliFmw3jJz5S2ROmBfgmwoY6SlV0a3uEo0tjcKF5uC5Z1q4UVCAhnau+fEAC23Yx4kNIaErMSh4akE6FbFlDRJicYoDiW5K3f24aDof5fM0olURKTCV41NQzLjVlPfOG4f8sVXz+2HSzF9Nv9NAoqG6eONhRm85qOpwiUE8gWBotu8fSrmMN0kznSphvCF+0mWMxbfWlZK9ZaAZIyNQ5vU5XbsMNbmfD479KwyjgXUmtwFPt8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=1kzjgVKOBXPLOd9x0CGGBOaqaprj3QY2UgevqnYifa4=; b=mAdv6HlYEcmPqOwkZEAj2d8k+kwY6waZkNtzXESP/BDXCOzcbFu6dibHTqJFgIbehkfOgprO2Mdm/S2u2Zjb61HEjgh91IJCrSaNcLwOtsVrkOkir2jbylnBoNN0yenotvb0w/bPm9HgiMR+FFahvpG/suNJMp315Lwxp00n/4nnmx4OxTgGqxEmGfxbXur+btkrnEIJ4PRvWvzPohtiQikHC8EqXYM5HbHC6fjXzpI8eI+cSCmZyFf++1eYY+q7Zd0OMzQIXEVQ9fc4am219juWxJmtm+j/e4PqHUxlIqKz41C4qZk5PE1Cs34jMF943gGacyVetH8F1gGM5OmKUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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=1kzjgVKOBXPLOd9x0CGGBOaqaprj3QY2UgevqnYifa4=; b=PwMMT0l/FTPO1K8a1zEJNxRotwt+0+zq/e9uJIhfCrrPmzyPvX/qrU3guvoHKMVr3H+miQZ/VWlDOhaiCwRoIp0YeOIfPI4E10vk2aMczvdNnDa+G2I/SwZEjQjxmj/lqmE+89fzX6E3ve3GoT6QhgchvzoHhLHbwUTf6o6RTfM= Received: from MN2PR10CA0028.namprd10.prod.outlook.com (2603:10b6:208:120::41) by SJ1PR12MB6267.namprd12.prod.outlook.com (2603:10b6:a03:456::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.21; Mon, 15 Jan 2024 17:20:53 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:120:cafe::13) by MN2PR10CA0028.outlook.office365.com (2603:10b6:208:120::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26 via Frontend Transport; Mon, 15 Jan 2024 17:20:53 +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 BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Mon, 15 Jan 2024 17:20:53 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.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.34; Mon, 15 Jan 2024 11:20:50 -0600 From: Ben Cheatham To: , , , , , , , CC: , , Subject: [PATCH v9 2/5] ACPI: Add CXL protocol error defines Date: Mon, 15 Jan 2024 11:20:04 -0600 Message-ID: <20240115172007.309547-3-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> References: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|SJ1PR12MB6267:EE_ X-MS-Office365-Filtering-Correlation-Id: 8be4db05-4256-48ae-93e5-08dc15ee53fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: LcpIfmn26mbXiFOqHMph7EZvyqabvZUi+inl0LWJjL6HaDlnAHnnjDyz+Ya5dpbMidpeR98LCusuIUofC1xQctDILZPnWvVo7+a8D706T2SLPdyAMumtKbEuOycSArxJYY5ldinKTNajxbJA8L8N84eRvsxlg40pe15gEw5t2YtJ/WtwLG2mFcknVmlUncvEEhmF6G7CBCAwaXmnsm6OJfK6k23wX1Xs/JJavheYOfzbK1sP2jCFv4RCFgW+Z7uQcW86seQ5z+t4/v2n3xfRhNUP/CqeStOYfDiPFMfiE2ReQvV2mjs1V/nk8d4EdSuCHBSyB2oGGRQFxobwBB8HETtx1HPaqxLFBx6cVN8p+k0XF27SEdl3gy0kz/QGB9UrgZtraoszmwZ1XgEGeHpnFUE48MzrnpVnl9mzQQsj8EVvpmI2bp1erSgk1CJolYuSiHtad9T2Maqy3LxbUwMLszH6b6nmeWkQ7INaqI+I63Ob1avImDfglDvO8lFOxO/bJIVg6THv8iR8Q4IZfsreS1T8ehpFD3/4QFW182MLvYjYHpYTCWmYexCPD5/ld47qFplvI1PktWwI/8An4HRtjVmsA5h2RtNhXv4G/qemJU+sX0/8EDg8Pmhbc2DX6Q+2+OkE7ahbrRy+kq1dcNDn05XDJUaHTyd0f8l96koYi/vdz+yLE4Moqoqi2UaS7LXmDIo5W9FprHXo+Mu7Bi78eSp2sxjwCJSIKmINUCQ111/HxbaHja4Lbt0XFc6GgnkkeI6X2Yh+bgWx0H8JO4lY8nWr0PZDVKtPJJphcOeOYTQ= 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:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(230922051799003)(1800799012)(451199024)(64100799003)(82310400011)(186009)(36840700001)(40470700004)(46966006)(426003)(26005)(2616005)(336012)(16526019)(83380400001)(1076003)(41300700001)(7416002)(47076005)(40480700001)(40460700003)(36756003)(86362001)(5660300002)(82740400003)(36860700001)(478600001)(2906002)(316002)(966005)(54906003)(110136005)(8936002)(8676002)(4326008)(70206006)(70586007)(356005)(6666004)(81166007)(7696005)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:20:53.4916 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8be4db05-4256-48ae-93e5-08dc15ee53fc 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: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6267 Add CXL protocol error defines to include/actbl1.h. Signed-off-by: Ben Cheatham --- I made a pull request for this support in the ACPICA project which has been accepted (link below), so this patch is temporary and I expect it to be dropped once the kernel updates from ACPICA. [1]: Link: https://github.com/acpica/acpica/pull/884 Signed-off-by: Ben Cheatham --- include/acpi/actbl1.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index a33375e055ad..1f58c5d86869 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1096,6 +1096,12 @@ enum acpi_einj_command_status { #define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9) #define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10) #define ACPI_EINJ_PLATFORM_FATAL (1<<11) +#define ACPI_EINJ_CXL_CACHE_CORRECTABLE (1<<12) +#define ACPI_EINJ_CXL_CACHE_UNCORRECTABLE (1<<13) +#define ACPI_EINJ_CXL_CACHE_FATAL (1<<14) +#define ACPI_EINJ_CXL_MEM_CORRECTABLE (1<<15) +#define ACPI_EINJ_CXL_MEM_UNCORRECTABLE (1<<16) +#define ACPI_EINJ_CXL_MEM_FATAL (1<<17) #define ACPI_EINJ_VENDOR_DEFINED (1<<31) /******************************************************************************* From patchwork Mon Jan 15 17:20:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 762770 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2065.outbound.protection.outlook.com [40.107.102.65]) (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 72AD917C91; Mon, 15 Jan 2024 17:21:25 +0000 (UTC) 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="Q9jTaIE9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YiANAB8l0Y5krQ/BJc5jmtGV323UBtfRBPJWDSO9rEOh+FTqWnrCxmRZQi5yl/u8SicMz/MkDQK9ldIBYTnQM1R4iECkOSihdLzfPweQ95CCcMWBqUm9JFFdAwqIcAFaluAptA6np+psMxvewORI/s7G/U3GQ2xJJj2bE1i9xCKshz287BV65r92sdjKCTIBKpfqheAAjJNpizA6rYhaFtMVA0RqjIxqzlAdPAoaBVqkznrT0EbTMLgmsF2cINmicG+o2s1tr5hyBzdMWLFghWr/BWnEFqv/J2gJ3AO1b4yqJws3laRFJfi1cRFjhL0kdoTHAf45SJLdAgUumMGrIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=rJyjJYbCMD2x8Xb2JmY1Wencn+Zl2nLMRH1pGy0ldVU=; b=lvfR83RkELlfhuCToFlqFHLQU29berxSiksJFXd+AXEpKzLL8YIrfdJ8EXwq6CwWgVCgmpKErY3eHkTcaRTSudO0Bg/bT+yl2MGJSj2Cnv6+YHh26sX0MEKmOQ+i4kSmVBP/xZ90BbrZeLWbbUwDZxK7ifTjWLotAqA5Jqv0PggQN35OAczlJdET6QUjrv5FhteTdnjSGUH4vPVLDmKskUmMJCMpImcU8mk6fHLxB2Rp5nU/uPvtVPO7GSicXRPoKdSxBqZuZZg/raQN23MA+p/DD36mFD+g3BZPVkh8xZq6zzzmwXA6xhUF79guPo1RszfuaQv57S9roSOarnLE2A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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=rJyjJYbCMD2x8Xb2JmY1Wencn+Zl2nLMRH1pGy0ldVU=; b=Q9jTaIE9XBonv9EGBWEMU58TLmYnf4cFBXmUdqQUZfl1R95frEiewXivtVkN7rpaocAOJ50DetXD9rzoIFQoww2Cadi1+eyXyDH/ufbwQK1G/uIGUe32w9tah/qq6gyu1gw4CBMTjDdW0kHaIwWmHtrgdVCMyXTnEdcy9InrL9o= Received: from MN2PR10CA0008.namprd10.prod.outlook.com (2603:10b6:208:120::21) by BN9PR12MB5083.namprd12.prod.outlook.com (2603:10b6:408:134::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26; Mon, 15 Jan 2024 17:21:23 +0000 Received: from BL6PEPF0001AB4B.namprd04.prod.outlook.com (2603:10b6:208:120:cafe::f5) by MN2PR10CA0008.outlook.office365.com (2603:10b6:208:120::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26 via Frontend Transport; Mon, 15 Jan 2024 17:21:23 +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 BL6PEPF0001AB4B.mail.protection.outlook.com (10.167.242.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Mon, 15 Jan 2024 17:21:23 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.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.34; Mon, 15 Jan 2024 11:21:20 -0600 From: Ben Cheatham To: , , , , , , , CC: , , Subject: [PATCH v9 3/5] EINJ: Migrate to a platform driver Date: Mon, 15 Jan 2024 11:20:05 -0600 Message-ID: <20240115172007.309547-4-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> References: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4B:EE_|BN9PR12MB5083:EE_ X-MS-Office365-Filtering-Correlation-Id: 304e2bd4-9343-4c8a-73cc-08dc15ee65ba X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L0aGiq2OcxtMYbaCt0nat4pghH9LIetkCCY87K2c2a5iDaiiOX8rGMUpP0UfdKfQmyqOz5XFpEnu5kzNoOKnu+8B7HEs8mqpobIb9dRxCeKgRG/hq9Gm9HB+wQOA3jkpuIglWOyrxXNx6Oia+e4kXsvot8FFMJgCkTrgxLlTrWwL9S/veBunYhM4PfDBUtMNCFdkoJdJ1ot7KEnxnMvShijKtnXcuXDe/Vqz8rYMBtcAD8KCBS+gWg5bEFsUhar3Yab8CTNLHziN0O7vbEHUR1qDgxHV7yfJP9RG2sH/Q8Ceo138MBkIQeOzMLGh3xJgMMFYONoSaX996cFcs4OujmRBrd4diquCQsRFsk9T2MPVfKg+89/VzGxHzH09xTReDDhuHEST/2IVr6TXeu25f42+pJ7T4ieZoWOW4+TgK1/pLf1jmIOLm2zYsKMP8VlMRAzQ1IB9x72QYAeyFfFSb4ZXU9cMCE2rMcyHYNgxTTxbifmV7JcQhuSLZuZFxBOBU+AU8V+lm5AshfX1HTudDRCw6ZotafWVsI8Y2Qpinnc52XzyVM8p+ySTQrSQ4Fv8/ECy13UDjbf57R4tzZ/McQSbhwirsYCmIw/sv2dpMpuL5abcOhTi1pslZ5MhGTaOOBS5LkwRnvLoTdnexpn2hwTsrOnfwdFJWm4wkzvIsTA5Y4lDl221pB7FbFrT7iJaMy/OiWTQKPepFgsA+nO1VkLpUyTwu4V/ROKkdRc8NuBIihHJQg1xHmcqa5i1CHzgApXmlCS7t86Zkc8AqrKJ3/Pp7ULz2UpzW/is+BEr24QwPsFPHoStPRILvjI2stmp8m4IIRRQVwQ2jpKetzJdHQ== 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:(13230031)(4636009)(39860400002)(396003)(136003)(346002)(376002)(230173577357003)(230922051799003)(230273577357003)(451199024)(82310400011)(64100799003)(186009)(1800799012)(46966006)(40470700004)(36840700001)(83380400001)(336012)(26005)(1076003)(426003)(47076005)(7696005)(6666004)(36860700001)(16526019)(2616005)(5660300002)(8676002)(4326008)(8936002)(41300700001)(7416002)(2906002)(478600001)(54906003)(70586007)(316002)(70206006)(110136005)(86362001)(36756003)(82740400003)(81166007)(356005)(40480700001)(40460700003)(2101003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:21:23.2416 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 304e2bd4-9343-4c8a-73cc-08dc15ee65ba 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: BL6PEPF0001AB4B.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5083 Change the EINJ module to install a platform device/driver on module init and move the module init() and exit() functions to driver probe and remove. This change allows the EINJ module to load regardless of whether setting up EINJ succeeds, which allows dependent modules to still load (i.e. the CXL core). Since EINJ may no longer be initialized when the module loads, any functions that are called from dependent/external modules should check the einj_initialized variable before calling any EINJ functions. Signed-off-by: Ben Cheatham --- drivers/acpi/apei/einj.c | 43 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 013eb621dc92..10d51cd73fa4 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "apei-internal.h" @@ -136,6 +137,12 @@ static struct apei_exec_ins_type einj_ins_type[] = { */ static DEFINE_MUTEX(einj_mutex); +/* + * Functions called from dependent modules should check this variable + * before using any EINJ functionality. + */ +static bool einj_initialized; + static void *einj_param; static void einj_exec_ctx_init(struct apei_exec_context *ctx) @@ -684,7 +691,7 @@ static int einj_check_table(struct acpi_table_einj *einj_tab) return 0; } -static int __init einj_init(void) +static int einj_probe(struct platform_device *pdev) { int rc; acpi_status status; @@ -782,7 +789,7 @@ static int __init einj_init(void) return rc; } -static void __exit einj_exit(void) +static void einj_remove(struct platform_device *pdev) { struct apei_exec_context ctx; @@ -801,6 +808,38 @@ static void __exit einj_exit(void) acpi_put_table((struct acpi_table_header *)einj_tab); } +static struct platform_device *einj_dev; +struct platform_driver einj_driver = { + .remove_new = einj_remove, + .driver = { + .name = "einj", + }, +}; + +static int __init einj_init(void) +{ + struct platform_device_info einj_dev_info = { + .name = "einj", + .id = -1, + }; + + einj_dev = platform_device_register_full(&einj_dev_info); + einj_initialized = !platform_driver_probe(&einj_driver, einj_probe); + + if (!(einj_initialized || IS_ERR_OR_NULL(einj_dev))) + platform_device_del(einj_dev); + + return 0; +} + +static void __exit einj_exit(void) +{ + if (einj_initialized) { + platform_driver_unregister(&einj_driver); + platform_device_del(einj_dev); + } +} + module_init(einj_init); module_exit(einj_exit); From patchwork Mon Jan 15 17:20:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 763311 Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2079.outbound.protection.outlook.com [40.107.101.79]) (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 1FE41182A0; Mon, 15 Jan 2024 17:22:09 +0000 (UTC) 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="VQf3Ghzq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FKuX8zVeafZIvzkxj2hHHjLRBxStGKmxzOSCQLhUWSKnHBX5qa9JzoOlyKld5U0i06m8V2rdxH4HTXmVEa19A8KgOWgvNbKcPCl59mHY/M4SeCbUQM3phO+kaFC7mByYtwasXBTrpZ78+anKpqmV+ASV9Gie+ueTj6/LJv6JcuT5FU/Dgs+RpORD5C6GZdtHuVFNabuy5mrIA89y+BJpEisEzjKul72LNXrhfGFlQ7w567B48nlo0zmk9B1Ry59BOX0DcqVTfoPMdPDe9JCsEMR0+8+aQv/MEX6UCWeHmWsourNDvo0PN0LhzVTVNP79BGIqDkoe+L5qSTbCXet6hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=bNDp+8WI+o8Kmu19OIG8jnRx0yj/PKI4GXtYD9cu3RY=; b=VIpYz68jnQPTwk7trjxIogb3+gzMmQYDSpvvpxkXdqRKxbysu6mrblA7R6Bqj34ln3kp7Ubmz9dk3z8Hsgey8a63xMmTrCsw4/PJES8LU9lnzFw4zTxdJWFD63pqZwchZwe5Z64OEtE+y8jmeAnDjGRaNt6Obaij02BL7HexSgjha1AYdK2yIynH2UTT+mp1CTTe/y+N9wd4xiLLZgUxb8AVQSDrm+3K1eFShfV9tUy5dOMfzy5IrDjUwWb130bW7vRIpdYCakqpqro9O60O0TUHneD7w246SDJHXK9XfXQznnTNFfOJ8TR/gvfbilhDwsmZuXB4W7BhXN50W/7aOw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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=bNDp+8WI+o8Kmu19OIG8jnRx0yj/PKI4GXtYD9cu3RY=; b=VQf3GhzqoAW8WGDcuH0HjgGxRIf67s25Yfm+UfNTkUv+n2e+N2Mmw0PYeSAtD9ptSPGZ8rALKjHa7i01Ej4XKHwhXi4ArSPifIbpB4KYqzmD1J3RZLOIkE/AjYPoqMfe/Msbwjm4v20W7Gx97GBnUdETEMT4pusoEeUsT0Ou0zw= Received: from MN2PR19CA0038.namprd19.prod.outlook.com (2603:10b6:208:19b::15) by DM4PR12MB5865.namprd12.prod.outlook.com (2603:10b6:8:64::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.18; Mon, 15 Jan 2024 17:22:05 +0000 Received: from BL6PEPF0001AB4A.namprd04.prod.outlook.com (2603:10b6:208:19b:cafe::e8) by MN2PR19CA0038.outlook.office365.com (2603:10b6:208:19b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23 via Frontend Transport; Mon, 15 Jan 2024 17:22:05 +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 BL6PEPF0001AB4A.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Mon, 15 Jan 2024 17:22:04 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.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.34; Mon, 15 Jan 2024 11:21:35 -0600 From: Ben Cheatham To: , , , , , , , CC: , , Subject: [PATCH v9 4/5] cxl/core, EINJ: Add EINJ CXL debugfs files and EINJ helper functions Date: Mon, 15 Jan 2024 11:20:06 -0600 Message-ID: <20240115172007.309547-5-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> References: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4A:EE_|DM4PR12MB5865:EE_ X-MS-Office365-Filtering-Correlation-Id: f561c14c-704c-4e77-b226-08dc15ee7e6f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZbdstihQ+9C8laGsG+r44sslWziwrLAMsoLzCpbOquRto4WQYyCwQ+dEKmGGtalud9rpQ+kXnhwK1BJ8sCUCGhzvcWvnsVHajLQlidu99tsqitOb1pB5NcDugHbvJ0NgiS1DXSDKfIKVE2OTQsNH8yFfNz3+zuVRM3Qhreol1P0PpZohAxnUHhbAbCOZYP873OdZwwXl/qpecjYS98zLx6K1XPThcsHaFhnWf1LIrQT48TX6Ak9aJK0VFoYjWIwcrrZOTM9rKZsYk5UimweFDV1yjIERwo1GQ3dtkhn1hQFrGPzsyFJDn5hVy/Qsl6r3+TaUPZ4FC1CnpKd4sffMwNIqe92UjLmOkRe7Dqed9RX9p+AjJGq7/58+ucvHdVKloU9GqHWxExi0CQ4DgEDVuP490ZM6HrukH6CVM+63Rnj0PRn+eg869ymwMN1dIg8UOY9bwx4fMc+4YBeKE6rpTbRqnCRLYFgPMK9OKFVtwxWMgPjso31o/EA/4C7T+CqeOsWoqfEeMXhQzx4m+IQ+r/HsKTrF52xNKzOUP/R5EOIR27HSp+0I5WabX4QRX7HPz0TJpTgi9W9wNpdCVPRVyY9fwBAoT9VBtMaaLWpaIyij41gJ5Qb3olAGhDjbfKKm2y63DUclDXfGE999WnuOEYS9tzO21nY5DAC/06qZzEMJSTmgiIwudEaWjFsXzoswhvqkUzbxOJU0ZWgGNkszw/LmCB+XqV7HBPH2bN31aeOkZvluz6ZxXDW0u8LTBJ/MnhNAc7O8uQ8aB+fsF3hOumWURpuVqQGffUUAt7dbXi4= 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:(13230031)(4636009)(396003)(376002)(136003)(346002)(39860400002)(230922051799003)(186009)(82310400011)(64100799003)(1800799012)(451199024)(40470700004)(46966006)(36840700001)(40480700001)(40460700003)(83380400001)(81166007)(36756003)(110136005)(86362001)(41300700001)(82740400003)(26005)(36860700001)(336012)(1076003)(2906002)(2616005)(47076005)(16526019)(426003)(478600001)(8936002)(70586007)(356005)(316002)(6666004)(4326008)(8676002)(54906003)(70206006)(7416002)(5660300002)(30864003)(7696005)(36900700001)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:22:04.6948 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f561c14c-704c-4e77-b226-08dc15ee7e6f 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: BL6PEPF0001AB4A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5865 Implement CXL helper functions in the EINJ module for getting/injecting available CXL protocol error types and export them to sysfs under kernel/debug/cxl. The kernel/debug/cxl/einj_types file will print the available CXL protocol errors in the same format as the available_error_types file provided by the EINJ module. The kernel/debug/cxl/$dport_dev/einj_inject is functionally the same as the error_type and error_inject files provided by the EINJ module, i.e.: writing an error type into $dport_dev/einj_inject will inject said error type into the CXL dport represented by $dport_dev. Signed-off-by: Ben Cheatham --- Documentation/ABI/testing/debugfs-cxl | 22 ++++ drivers/acpi/apei/einj.c | 144 ++++++++++++++++++++++++-- drivers/cxl/core/port.c | 39 +++++++ include/linux/einj-cxl.h | 42 ++++++++ 4 files changed, 237 insertions(+), 10 deletions(-) create mode 100644 include/linux/einj-cxl.h diff --git a/Documentation/ABI/testing/debugfs-cxl b/Documentation/ABI/testing/debugfs-cxl index fe61d372e3fa..bcd985cca66a 100644 --- a/Documentation/ABI/testing/debugfs-cxl +++ b/Documentation/ABI/testing/debugfs-cxl @@ -33,3 +33,25 @@ Description: device cannot clear poison from the address, -ENXIO is returned. The clear_poison attribute is only visible for devices supporting the capability. + +What: /sys/kernel/debug/cxl/einj_types +Date: January, 2024 +KernelVersion: v6.9 +Contact: linux-cxl@vger.kernel.org +Description: + (RO) Prints the CXL protocol error types made available by + the platform in the format "0x ". + The can be written to einj_inject to inject + into a chosen dport. + +What: /sys/kernel/debug/cxl/$dport_dev/einj_inject +Date: January, 2024 +KernelVersion: v6.9 +Contact: linux-cxl@vger.kernel.org +Description: + (WO) Writing an integer to this file injects the corresponding + CXL protocol error into $dport_dev ($dport_dev will be a device + name from /sys/bus/pci/devices). The integer to type mapping for + injection can be found by reading from einj_types. If the dport + was enumerated in RCH mode, a CXL 1.1 error is injected, otherwise + a CXL 2.0 error is injected. diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c index 10d51cd73fa4..c3ec03583946 100644 --- a/drivers/acpi/apei/einj.c +++ b/drivers/acpi/apei/einj.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -37,6 +38,12 @@ #define MEM_ERROR_MASK (ACPI_EINJ_MEMORY_CORRECTABLE | \ ACPI_EINJ_MEMORY_UNCORRECTABLE | \ ACPI_EINJ_MEMORY_FATAL) +#define CXL_ERROR_MASK (ACPI_EINJ_CXL_CACHE_CORRECTABLE | \ + ACPI_EINJ_CXL_CACHE_UNCORRECTABLE | \ + ACPI_EINJ_CXL_CACHE_FATAL | \ + ACPI_EINJ_CXL_MEM_CORRECTABLE | \ + ACPI_EINJ_CXL_MEM_UNCORRECTABLE | \ + ACPI_EINJ_CXL_MEM_FATAL) /* * ACPI version 5 provides a SET_ERROR_TYPE_WITH_ADDRESS action. @@ -544,8 +551,11 @@ static int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, if (type & ACPI5_VENDOR_BIT) { if (vendor_flags != SETWA_FLAGS_MEM) goto inject; - } else if (!(type & MEM_ERROR_MASK) && !(flags & SETWA_FLAGS_MEM)) + } else if (!(type & MEM_ERROR_MASK) && !(flags & SETWA_FLAGS_MEM)) { goto inject; + } else if ((type & CXL_ERROR_MASK) && (flags & SETWA_FLAGS_MEM)) { + goto inject; + } /* * Disallow crazy address masks that give BIOS leeway to pick @@ -597,6 +607,9 @@ static const char * const einj_error_type_string[] = { "0x00000200\tPlatform Correctable\n", "0x00000400\tPlatform Uncorrectable non-fatal\n", "0x00000800\tPlatform Uncorrectable fatal\n", +}; + +static const char * const einj_cxl_error_type_string[] = { "0x00001000\tCXL.cache Protocol Correctable\n", "0x00002000\tCXL.cache Protocol Uncorrectable non-fatal\n", "0x00004000\tCXL.cache Protocol Uncorrectable fatal\n", @@ -622,29 +635,44 @@ static int available_error_type_show(struct seq_file *m, void *v) DEFINE_SHOW_ATTRIBUTE(available_error_type); -static int error_type_get(void *data, u64 *val) +int einj_cxl_available_error_type_show(struct seq_file *m, void *v) { - *val = error_type; + int cxl_err, rc; + u32 available_error_type = 0; + + if (!einj_initialized) + return -ENXIO; + + rc = einj_get_available_error_type(&available_error_type); + if (rc) + return rc; + + for (int pos = 0; pos < ARRAY_SIZE(einj_cxl_error_type_string); pos++) { + cxl_err = ACPI_EINJ_CXL_CACHE_CORRECTABLE << pos; + + if (available_error_type & cxl_err) + seq_puts(m, einj_cxl_error_type_string[pos]); + } return 0; } +EXPORT_SYMBOL_NS_GPL(einj_cxl_available_error_type_show, CXL); -static int error_type_set(void *data, u64 val) +static int validate_error_type(u64 type) { + u32 tval, vendor, available_error_type = 0; int rc; - u32 available_error_type = 0; - u32 tval, vendor; /* Only low 32 bits for error type are valid */ - if (val & GENMASK_ULL(63, 32)) + if (type & GENMASK_ULL(63, 32)) return -EINVAL; /* * Vendor defined types have 0x80000000 bit set, and * are not enumerated by ACPI_EINJ_GET_ERROR_TYPE */ - vendor = val & ACPI5_VENDOR_BIT; - tval = val & 0x7fffffff; + vendor = type & ACPI5_VENDOR_BIT; + tval = type & 0x7fffffff; /* Only one error type can be specified */ if (tval & (tval - 1)) @@ -653,9 +681,105 @@ static int error_type_set(void *data, u64 val) rc = einj_get_available_error_type(&available_error_type); if (rc) return rc; - if (!(val & available_error_type)) + if (!(type & available_error_type)) return -EINVAL; } + + return 0; +} + +static int cxl_dport_get_sbdf(struct pci_dev *dport_dev, u64 *sbdf) +{ + struct pci_bus *pbus; + struct pci_host_bridge *bridge; + u64 seg = 0, bus; + + pbus = dport_dev->bus; + bridge = pci_find_host_bridge(pbus); + + if (!bridge) + return -ENODEV; + + if (bridge->domain_nr != PCI_DOMAIN_NR_NOT_SET) + seg = bridge->domain_nr << 24; + + bus = pbus->number << 16; + *sbdf = seg | bus | dport_dev->devfn; + + return 0; +} + +int einj_cxl_inject_rch_error(u64 rcrb, u64 type) +{ + u64 param1 = 0, param2 = 0, param4 = 0; + u32 flags; + int rc; + + if (!einj_initialized) + return -ENXIO; + + /* Only CXL error types can be specified */ + if (type & ~CXL_ERROR_MASK || (type & ACPI5_VENDOR_BIT)) + return -EINVAL; + + rc = validate_error_type(type); + if (rc) + return rc; + + param1 = (u64) rcrb; + param2 = 0xfffffffffffff000; + flags = 0x2; + + return einj_error_inject(type, flags, param1, param2, 0, param4); +} +EXPORT_SYMBOL_NS_GPL(einj_cxl_inject_rch_error, CXL); + +int einj_cxl_inject_error(struct pci_dev *dport, u64 type) +{ + u64 param1 = 0, param2 = 0, param4 = 0; + u32 flags; + int rc; + + if (!einj_initialized) + return -ENXIO; + + /* Only CXL error types can be specified */ + if (type & ~CXL_ERROR_MASK || (type & ACPI5_VENDOR_BIT)) + return -EINVAL; + + rc = validate_error_type(type); + if (rc) + return rc; + + rc = cxl_dport_get_sbdf(dport, ¶m4); + if (rc) + return rc; + + flags = 0x4; + + return einj_error_inject(type, flags, param1, param2, 0, param4); +} +EXPORT_SYMBOL_NS_GPL(einj_cxl_inject_error, CXL); + +static int error_type_get(void *data, u64 *val) +{ + *val = error_type; + + return 0; +} + +static int error_type_set(void *data, u64 val) +{ + int rc; + + /* CXL error types have to be injected from cxl debugfs */ + if (val & CXL_ERROR_MASK && !(val & ACPI5_VENDOR_BIT)) + return -EINVAL; + + rc = validate_error_type(val); + if (rc) + return rc; + error_type = val; return 0; diff --git a/drivers/cxl/core/port.c b/drivers/cxl/core/port.c index 8c00fd6be730..a41618ce380b 100644 --- a/drivers/cxl/core/port.c +++ b/drivers/cxl/core/port.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -797,6 +798,37 @@ static int cxl_dport_setup_regs(struct device *host, struct cxl_dport *dport, return rc; } +DEFINE_SHOW_ATTRIBUTE(einj_cxl_available_error_type); + +static int cxl_einj_inject(void *data, u64 type) +{ + struct cxl_dport *dport = data; + + if (dport->rch) + return einj_cxl_inject_rch_error(dport->rcrb.base, type); + + return einj_cxl_inject_error(to_pci_dev(dport->dport_dev), type); +} +DEFINE_DEBUGFS_ATTRIBUTE(cxl_einj_inject_fops, NULL, cxl_einj_inject, "%llx\n"); + +static void cxl_debugfs_create_dport_dir(struct cxl_dport *dport) +{ + struct dentry *dir; + + /* + * dport_dev needs to be a PCIe port for CXL 2.0+ ports because + * EINJ expects a dport SBDF to be specified for 2.0 error injection. + */ + if (!IS_ENABLED(CONFIG_CXL_EINJ) || + (!dport->rch && !dev_is_pci(dport->dport_dev))) + return; + + dir = cxl_debugfs_create_dir(dev_name(dport->dport_dev)); + + debugfs_create_file("einj_inject", 0200, dir, dport, + &cxl_einj_inject_fops); +} + static struct cxl_port *__devm_cxl_add_port(struct device *host, struct device *uport_dev, resource_size_t component_reg_phys, @@ -1144,6 +1176,8 @@ __devm_cxl_add_dport(struct cxl_port *port, struct device *dport_dev, if (dev_is_pci(dport_dev)) dport->link_latency = cxl_pci_get_latency(to_pci_dev(dport_dev)); + cxl_debugfs_create_dport_dir(dport); + return dport; } @@ -2220,6 +2254,11 @@ static __init int cxl_core_init(void) cxl_debugfs = debugfs_create_dir("cxl", NULL); + if (IS_ENABLED(CONFIG_CXL_EINJ)) { + debugfs_create_file("einj_types", 0400, cxl_debugfs, NULL, + &einj_cxl_available_error_type_fops); + } + cxl_mbox_init(); rc = cxl_memdev_init(); diff --git a/include/linux/einj-cxl.h b/include/linux/einj-cxl.h new file mode 100644 index 000000000000..fcc0541ff0f3 --- /dev/null +++ b/include/linux/einj-cxl.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * CXL protocol Error INJection support. + * + * Copyright (c) 2023 Advanced Micro Devices, Inc. + * All Rights Reserved. + * + * Author: Ben Cheatham + */ +#ifndef CXL_EINJ_H +#define CXL_EINJ_H + +#include + +#if IS_ENABLED(CONFIG_ACPI_APEI_EINJ) +int einj_cxl_available_error_type_show(struct seq_file *m, void *v); +int einj_cxl_inject_error(struct pci_dev *dport_dev, u64 type); +int einj_cxl_inject_rch_error(u64 rcrb, u64 type); +#else +static inline int einj_cxl_available_error_type_show(struct seq_file *m, + void *v) +{ + return -ENXIO; +} + +static inline int einj_cxl_type_show(struct seq_file *m, void *data) +{ + return -ENXIO; +} + +static inline int einj_cxl_inject_error(struct pci_dev *dport_dev, u64 type) +{ + return -ENXIO; +} + +static inline int einj_cxl_inject_rch_error(u64 rcrb, u64 type) +{ + return -ENXIO; +} +#endif + +#endif From patchwork Mon Jan 15 17:20:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Cheatham X-Patchwork-Id: 762769 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2050.outbound.protection.outlook.com [40.107.93.50]) (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 47EDB17C91; Mon, 15 Jan 2024 17:22:18 +0000 (UTC) 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="4nJ4fr6m" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hVxX8OMOpQIogsqT3FYdoNxqUjAlwbsogl46QSnla1coAdSpTRpdiukV1Gk1Q3LL8gPkxE7XAipmNVL/2ojqJWzmzVFUSHRXKeHL2551V44xLIxG1btlV7j+LAZM2MW2vcVTBUm2XbBDzoPfigihHeQxA6nY5xPBo5fz/EdLDE3Jw/mlpzX29wBmCZ3TaY20LDYRmIf7uWOZSjPsj7ED8MH5WvSdfUZ3yUcuAKRNABz7HjUF2fEKVmQ9oIey5NoXmlKsLcRQqqf51ftZjqwrxBQJH+a5Qr7pYaWR3+3lSbG9jfxvLh7sLj//KYXTRrFMZ5AFo53Bb2uSeecWAyLTcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=zNi+RMOURb1Rp8Rc6Ghi28eCqTP30Yk4bHvDM81X2FM=; b=H90hxezCnGRhV9pYLC8unG62suw/PSs/KFd+/LHJYsWmd5c/VyhH01HuBBqsVt5Z/AZv57cFHfE+pOKAB64QdogSkfQ4RCpwSOCSoDdwlaXhfnREo57HuMSUJuzlDrepP9DkwYxS4dwmzjPhgOxR2Z17550ou1//beAOQwiClZrXvBBR/8PPXwwWKx/WRiJmG6TT+g4CUpnxJEcOmNLkVjg1SlDsODMCNbXJbbdeMmAGt5iizzBhTmRU1VJAHi6qoqvwGY5nUUYrPty2OjdMemBmnHutLxk87jv9fv+CQ97DZeY8cRHXM9xWm2UN3BPocWqB2s+p5xrJpDTRgQLMgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=intel.com 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=zNi+RMOURb1Rp8Rc6Ghi28eCqTP30Yk4bHvDM81X2FM=; b=4nJ4fr6mhoFMx9d8icumXzq3Xo5SJxMemTO1XSnro0eo6gFlZbimcJP69+RwHpJgD9VaA4lvY5wXT+8mmfoyp7IzTy20LZP11pCk/1r3oNMByKyKWtbhQ0H8NWpINwHEn8ZLHJrQH26xt9FQbty2grBIPqPsnTjH1WARGU4QwQ8= Received: from MN2PR19CA0055.namprd19.prod.outlook.com (2603:10b6:208:19b::32) by DM4PR12MB5294.namprd12.prod.outlook.com (2603:10b6:5:39e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.26; Mon, 15 Jan 2024 17:22:16 +0000 Received: from BL6PEPF0001AB4A.namprd04.prod.outlook.com (2603:10b6:208:19b:cafe::a2) by MN2PR19CA0055.outlook.office365.com (2603:10b6:208:19b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7181.23 via Frontend Transport; Mon, 15 Jan 2024 17:22:15 +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 BL6PEPF0001AB4A.mail.protection.outlook.com (10.167.242.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Mon, 15 Jan 2024 17:22:15 +0000 Received: from bcheatha-HP-EliteBook-845-G8-Notebook-PC.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.34; Mon, 15 Jan 2024 11:22:14 -0600 From: Ben Cheatham To: , , , , , , , CC: , , Subject: [PATCH v9 5/5] EINJ, Documentation: Update EINJ kernel doc Date: Mon, 15 Jan 2024 11:20:07 -0600 Message-ID: <20240115172007.309547-6-Benjamin.Cheatham@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> References: <20240115172007.309547-1-Benjamin.Cheatham@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB4A:EE_|DM4PR12MB5294:EE_ X-MS-Office365-Filtering-Correlation-Id: b65add91-0597-4fab-2a5a-08dc15ee851d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PKz8SroE6wvqjpnQD96ITrUg8co2U/u6VfI1wGyg2FDRGBgERfuhgU1cnao7br8c7IeD1HKBqD7y9lGNlxDHStXHDomjo2LE5MuPPIQlLfpGtORV07qoVyjOsTBrAKNkkFAex6KVXdBqpVtqS8nrUPhZHq14f8g/RMCcaA+WTmFIWvImoMRyYOPbq7t44SAss03Az96H74CiRtQMOjkqVfNbHI9e5SEONSNhppBnjIoFSyPrmYH256R33ZFgtx9EPIjzeh22A7dwDSBlwW+bDXg86S6QP9r8X76MW/dPa4KUIXjW1z0OiDApbDHwMlKDM7ZpO8A7gsc76AhmXa5vmiodiYC2iRq6QsnyMM8Q0Z60vAHw9g1vW6IuvdsQq/mRN8deiet2j60rGde+Bm2Uz+Q9uqpy8WPJcPqiHsRaIoLSGeF5NgqtKb2ntO6mPXPLco+ck9MuEP2khIX9fj4EmuPvFqDRsZAoNPT1vAljXmixusedDhIap/bELU1iqD6bXYBN9u/plKtWYS2OSkvY54AQo+hGk99ZSWNdWn0LKBpdHH8jEAkFeOaOT4dFE854k2B/QbiUL++EKRt/TCy99xfm7oWGZYP6pfVhHcR2hsF3SQrA1cTy8RgyHvhKAbW9YDFLfYwR1RKh0ycZKOYpdLTLF5u99AW6OQL9tpD7nm11j7OB/JEXPw3Yy324hTcELDoN5cQh2eBfzdPH2H0mRsC+PwrdiPXhNAesreF4qtEb4QQkk2b9bj6zxZQYvLI+pxkuiQk+jO0gu5ZgJxrPLHDzK+XysENUrb9q1DkdFqw= 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:(13230031)(4636009)(136003)(39860400002)(346002)(396003)(376002)(230922051799003)(1800799012)(451199024)(64100799003)(82310400011)(186009)(46966006)(40470700004)(36840700001)(16526019)(2616005)(26005)(1076003)(19627235002)(478600001)(336012)(426003)(6666004)(7696005)(47076005)(36860700001)(83380400001)(2906002)(5660300002)(15650500001)(7416002)(4326008)(41300700001)(110136005)(54906003)(70586007)(316002)(8936002)(8676002)(70206006)(81166007)(356005)(82740400003)(86362001)(36756003)(40480700001)(40460700003)(36900700001)(2101003); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jan 2024 17:22:15.8979 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b65add91-0597-4fab-2a5a-08dc15ee851d 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: BL6PEPF0001AB4A.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5294 Update EINJ kernel document to include how to inject CXL protocol error types, build the kernel to include CXL error types, and give an example injection. Signed-off-by: Ben Cheatham --- .../firmware-guide/acpi/apei/einj.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/firmware-guide/acpi/apei/einj.rst b/Documentation/firmware-guide/acpi/apei/einj.rst index d6b61d22f525..a8f26845682a 100644 --- a/Documentation/firmware-guide/acpi/apei/einj.rst +++ b/Documentation/firmware-guide/acpi/apei/einj.rst @@ -181,6 +181,25 @@ You should see something like this in dmesg:: [22715.834759] EDAC sbridge MC3: PROCESSOR 0:306e7 TIME 1422553404 SOCKET 0 APIC 0 [22716.616173] EDAC MC3: 1 CE memory read error on CPU_SrcID#0_Channel#0_DIMM#0 (channel:0 slot:0 page:0x12345 offset:0x0 grain:32 syndrome:0x0 - area:DRAM err_code:0001:0090 socket:0 channel_mask:1 rank:0) +CXL error types are supported from ACPI 6.5 onwards. These error types +are not available in the legacy interface at /sys/kernel/debug/apei/einj, +and are instead at /sys/kernel/debug/cxl/. There is a file under debug/cxl +called "einj_type" that is analagous to available_error_type under debug/cxl. +There is also a "einj_inject" file in each $dport_dev directory under debug/cxl +that will inject a given error into the dport represented by $dport_dev. +For example, to inject a CXL.mem protocol correctable error into +$dport_dev=pci0000:0c:: + + # cd /sys/kernel/debug/cxl/ + # cat einj_type # See which error can be injected + 0x00008000 CXL.mem Protocol Correctable + 0x00010000 CXL.mem Protocol Uncorrectable non-fatal + 0x00020000 CXL.mem Protocol Uncorrectable fatal + # cd 0000:e0:01.1 # Navigate to dport to inject into + # echo 0x8000 > einj_inject # Inject error + +To use CXL error types, ``CONFIG_CXL_EINJ`` will need to be enabled. + Special notes for injection into SGX enclaves: There may be a separate BIOS setup option to enable SGX injection.