From patchwork Thu Dec 5 21:18:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847890 Received: from CH4PR04CU002.outbound.protection.outlook.com (mail-northcentralusazon11023133.outbound.protection.outlook.com [40.107.201.133]) (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 CD3101BD012; Thu, 5 Dec 2024 21:19:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.201.133 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433552; cv=fail; b=tMKd+CkkIia+Nvs37RErqo7M2XjFYTzeBTJ8S2RAHTY2nuV6kuqFEWPuiKo98vQOkRxgY0UCRXHJ16BRPc9W24VXp61wzHtAMGUJmPWgPZCtIEhPxXj8C2Xh8LdWuH1CDNsIyUKMZYgv1uoo8r0spHEB62WueTvrHR9Pp//UcV0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433552; c=relaxed/simple; bh=h/75/6tbGgbTfJAgQleixF7WlE85+LTnt1R8panQoKg=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=JvlOjFeoC/EQNrgv64VLYpDR3s1lA3ay2B3qhLvw1k7xImMd9dA7NcSsgl0yj6qIrn1/gm1QhbFDcG8XpLDw4u4vnqJraKFkd/F6pIlBZc/bwCKgOaFq0wRdRUZtglR7tgJDIS89OvKkmE8Kyde8v8jtuwF2OmfyvkCMq9qa56A= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=vYKB058O; arc=fail smtp.client-ip=40.107.201.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="vYKB058O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VbRGsfMTJJbWdOFIPsTMo+og+9sqlmhCb89V0VdDVPt3QdsdyNJsekYc+n9R+/LaeHgYRX04KyWiaHofpe8M7VzlGeHfRUHuqCWMeb9YbGdJT4o4AR4aRpqghYfPO2hOchD9A2F/yeHjh/hCHmv/vaGyWWfhgBVReFtA1HT/ffWShlAm3kQh5PVfK5jB7AErrMXCVxLQ6aETLgx+OjRXgKd8DUTYYhzZMc0YQxTLofSv9UC5RFcfwAdiRUy9WhPYfJPhJai6kVoPAeVmdRIHp5QuN6cxqbdb3dFmnjPOjrbrtzXCM8xn/kKpblRuCE/30YgeozvweEFN8LDgb8sU8Q== 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=/Iw96XrCZsImEjBbBaMr99I59rm+pRnxQsSWrzp0qIg=; b=L5b/gpU4zwk0Y9SN4uERQanbVw1CgL3A3lGKPY07FMrLCn3jjwTJmR0NUxugXK7c00OZAj1KAbNJV7EvgOg9V9wV3TNHJkj/bTF3egybtCqhV0pDJDDNWEwuMWVoWeE6EaDS7vtcSXe6l1sJ0g6FzMdzGYs0qV1ZNiH2nVZ0lnVfg5xfYceWWDgGYXFN7Ry9EsJVKXFXlJOQlWQOjiLe1g7o/44CiPAp73BOQerifGPvaE4O3XabNW5RIryrqK6sKQ49wKJCc1E/DAGZR98tu0xKRR2DC1nJR8mlI0j8lkxIB8OFPE1JHJcvAycXMVBuam65WKp69TWHyC18SgrKbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/Iw96XrCZsImEjBbBaMr99I59rm+pRnxQsSWrzp0qIg=; b=vYKB058OKkQgTIVSugvRtJpf4TRcFgH8/BOTSpTWJ7geDXtppCV6I5O7SPbtyEDzfDo811Pa5nXypvVnopQvuYtwBLS0k7AgKFLF7xkdE+p0lEUMi0hEmDPVhHQ+T3q2VpcMKoyy0/Biz7Zxkb5pxRfEPXxw8ac01Dy47nZY3u8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by DS0PR01MB8004.prod.exchangelabs.com (2603:10b6:8:145::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.9; Thu, 5 Dec 2024 21:19:06 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:06 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 1/9] ACPICA: Update values to hex to follow ACPI specs Date: Thu, 5 Dec 2024 13:18:46 -0800 Message-Id: <20241205211854.43215-2-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|DS0PR01MB8004:EE_ X-MS-Office365-Filtering-Correlation-Id: 6972daca-cfdf-4800-9e0d-08dd1572737f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|7416014|38350700014|921020; X-Microsoft-Antispam-Message-Info: j4rNlyZO2C6DvL0jsWmqKvZTgRYbPBQeuliQJhBEJmmuCQN2xKwenM1bB8/qZi7rDAjgmzppan6cTYNU/w3vjo17dz3q+0rSC0GjC2W90XZ4JpYeKxXPMnTYRdQjRWFXQLg4NNjji+n18IGaAqP+02CrrlFwSAWR+bWAXDqpHTBp7IcEwMbm0iClMFPRQHFwNWVccA5FemFN/xvRaCVvUczRyxonLlaz8wsDLbNr74T3PuyjIIqKhO+kgBgBg2HVd+ZX21ai3s6ohZRnqV+4o6tYseBTNPof5lzxr+KHtiP3spROiXWdZrnB9LU933T8mEigI1wdF4niDpNs7nQ/LJ6C0mu5zU5++5zQTMReUuxYFcuSsWO2Jm5exQhbtAisjByr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am-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(7416014)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: p3sQLxv6TdEYK7HBslrn2k36Nz+AYRenfaBs/98A+VUQ/HfkEiWtnK+K+6T2uhH4OSotAb/S42IMkMQBiOgMB2cHBTq3oAJ9fQ2s8YJg3Q8SS51sN/TICjweRTQHj38HmuUDYeeS95Qkd2B1GaDIdmIhMtNNzDYPHp9LtY+hNGDlb1urdCNbPnwVhpaNMZk3KRUwgOsDeARGkqXMm7Kcj/NlDBcN0ze5HvyO/gvbH7KCAgCeElUwJwdfuCTwUeNfrFl8YEMs5Ie2Mw4cFMSlcSf+3m9Tp0PYv5fhrCaxtjDRNJBL0eBZsuQG1Iki2d+B+1+E/bjaE1niaj/BhXB0JC+rZXVYLJvXJyD81q1lA+cMDySoX2bvowjnLN7qB0vwQMRQ8JvLjshVhqU3nC2yz0JcBDAkILcBbl8H032Va02Gxs1/RROsun3Ds5eAlXzIYCuujtjyzsQUxuDtLUg5qlFE9i4Or+BiwjV8cLuFMlG4/hLjlL/zFrT2l/zl2hrE4z1FcG/Wm4C75It5LAooraLpdWl0Q3GamXjsnMeVe7jjI/PXj7WZsciKM6KoACP/GTmXPYwLtFqHhnGVqwVXf2MYFK1DceB+SKV8edpFANfdRENstLmTIRH9H2U44c/7GKJBrXXuyqENKeWZXqxAJ60EH4fTog9UvxZiO7si7oKHnKAONe2hfBB7hx1Or/l4cagzE6DDqIUwt7hjnP1C+pT67lXACn7dx22p02FGIBY3KRma9dStHKcnL4iK1v8kOjqZxkQ7wxTxL866dLbMvwsVCOZM7jbokjbe5tezYefOgPWb2R8flgbQlkOHUVOTN1QijJwuNnLQy2CH0pSAZC0c2CzujaRxMmpB4wpgeoQN9S+7/hs4jhUl1MVW4Z+dd2/sr0N5ylGrKPDlx4EXgyOJIJ/vQIqayIxtFO14/p3bCk3VRHlFZyVv8HlR3OU9Wvnh67ABWdGXwgz+GWSB+SX+jcy+dzwHdk5+cbdm7xEyVA5BNSWTzVZzM5MfqJMG1LDHEAeTvGPonfPMGCaPVMKDDIEwYYP+reGPAJlUUqIbI+RgSsC9ThhESPGZ2se+Tppd+TIFPbsM07frP9pYS/wc9uQ0otg35Ps3LiIQ0vsw3DAXLNOpEloz8rSYKpPgD6V1ZpwQHCmmXTGTyLxS5RJ3D+rKUIWdrUYr1AC3NCRKmkggNcfWBTgADAzwJOjLSKEfjghLwrpAPUKfx34YVGwmmGvsfYh7VMuMM7funDQFkfIyd5cVle9B3yYDUhdTy03GRbzz/0TEKXTj2as9zFCpicQnP//BUiIGMG7BEy+57digK3S/b6J80fgQEL7ut0kQJHNIQ0E3F1H/pjP8O5VkKdaTqnh2IC2xZG0j01+vxR06hJ8gbD7OBF5ymjsivAs5onSYlMJNeOW/keyT/jROc4cZ5KxCAPb9C/bAau8EBm0LEpXXyEmiRrNPX8le5ApY82oXnF8HFbK5iLvAzLKlqswTVum7GF5VcRDwCcJ35Hn4UporSmNDDCPPnvUP5Mwypd9jX8WL729I0Tp9dLyBmE5KZlOlnxAZyGCq1nIQxHKz9gNXknfUybKPwjene26vByDad21aS5zljVYOD7XlyIW4X0xukpLaKRFzVtQ= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6972daca-cfdf-4800-9e0d-08dd1572737f X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:06.6245 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: RRhr+LwQS0Iy+to2rQiqy96jtxj2xtS+Qodqcf6gjinylo17LYblhV+Yv6VyblhXHoy75+TL/ErZ3K6Le27sYdDPuC7wEAGhSnXyXl6UUW+9LT93s87YL9KdtIK10uTm X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR01MB8004 ACPI specs(1) define Error Injection Actions in hex values. This commit intends to update values from decimal to hex to be consistent with ACPI specs. This commit and the following one are not to be merged and will come form ACPICA project see pull request(2). (1) https://uefi.org/specs/ACPI/6.5/18_Platform_Error_Interfaces.html (2) https://github.com/acpica/acpica/pull/977 Signed-off-by: Zaid Alali --- include/acpi/actbl1.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 387fc821703a..c701c434976c 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1024,18 +1024,18 @@ struct acpi_einj_entry { /* Values for Action field above */ enum acpi_einj_actions { - ACPI_EINJ_BEGIN_OPERATION = 0, - ACPI_EINJ_GET_TRIGGER_TABLE = 1, - ACPI_EINJ_SET_ERROR_TYPE = 2, - ACPI_EINJ_GET_ERROR_TYPE = 3, - ACPI_EINJ_END_OPERATION = 4, - ACPI_EINJ_EXECUTE_OPERATION = 5, - ACPI_EINJ_CHECK_BUSY_STATUS = 6, - ACPI_EINJ_GET_COMMAND_STATUS = 7, - ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8, - ACPI_EINJ_GET_EXECUTE_TIMINGS = 9, - ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */ - ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ + ACPI_EINJ_BEGIN_OPERATION = 0x0, + ACPI_EINJ_GET_TRIGGER_TABLE = 0x1, + ACPI_EINJ_SET_ERROR_TYPE = 0x2, + ACPI_EINJ_GET_ERROR_TYPE = 0x3, + ACPI_EINJ_END_OPERATION = 0x4, + ACPI_EINJ_EXECUTE_OPERATION = 0x5, + ACPI_EINJ_CHECK_BUSY_STATUS = 0x6, + ACPI_EINJ_GET_COMMAND_STATUS = 0x7, + ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 0x8, + ACPI_EINJ_GET_EXECUTE_TIMINGS = 0x9, + ACPI_EINJ_ACTION_RESERVED = 0xA, /* 0xA and greater are reserved */ + ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ }; /* Values for Instruction field above */ From patchwork Thu Dec 5 21:18:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847600 Received: from CH4PR04CU002.outbound.protection.outlook.com (mail-northcentralusazon11023133.outbound.protection.outlook.com [40.107.201.133]) (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 AAD951CCB26; Thu, 5 Dec 2024 21:19:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.201.133 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433554; cv=fail; b=pRG6Pwm3Igkje7DZwjEH1pZOcQ07jcqAEtnncZ3jbvdbCCvWdCKqp5TrTD9mMivOCuB5a98NR0LQct6lcm9R1zMJn4YGz4Ell+P4Px8rM2rqVhpgsFC6mxyaBDYT8TiioqIcNHFZsJcdMXNeDOHbMiO5h+V15uk7nDKEkfH9l+M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433554; c=relaxed/simple; bh=eYb6BNbGVDjKyKbVR2zuXx7Au93uvU7fZ7K4fioag2U=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=AiI5mvA4DV29Rc8d2PjmuZGnbYzAb75VMLxc+VQZFPvQb4OB5EQNngtwH2GpmLkfXWtfMkpu6tx/QC9oHw90iQT3DInhc08rAalacIJkdk9w1D6SK7VQTQLFvtBWTp7Y1hzzy6nTOG4kPlw9AArvz1Gek5UldaFoBgoRYiqDgQA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=jneyVZ5P; arc=fail smtp.client-ip=40.107.201.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="jneyVZ5P" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XyE28Wa6W0xWNgj+msOnqKvV5JOe6MysbeVhQLolFMqUYgaKbNQjPt9u6AOEnB1JZpMhGYzCHUFkAtihV8wLHhxpjO1/S3qZCBoAABO2vbPI1sIiJ2h/urfArIpz0d/rUY8QATrjg6AQZM8OjIvCR5eKCLbHobN8juPXwxy0wbSDNNQ4iFQ11pdda8+nuUkbu1jqpZZVqkdItcoswCJMWHWjo6Z/1ODWwmz1XXUsDQZo8D5aI7LmKu47HybkZR61+HHQkAWtEnPBleHiJVvinUSivk1+y8DZqd3B/UXKC9L94enzA6sOhKIa0C7d2gEn6DJ7oX3h5aO4xS9fuTAx4w== 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=dhvf2Dg0tPp7GDOQtlUeR4Tu1f4jCnswHeGRkongp4o=; b=VV+nN/CJacv/0s3cvvb83N6daiD3bj9m1Lq6iUYofilaAP43UMOeTlvUnniva82cYmf4+PQd/1L417/riv/xoreGKFkK3c4b8lP79+rYwTDzli7xk+SmSoZ9Ev5TFJZCEUljcibxOzDQj6ql617uWKFAsII2DEZfuFiueu/Y2ABtr6H6ggab9Ws79adJbmudQ+potDdjE/aYhSXoSG69upxDeMupdxI13BFBtJrB039QadTq8s83WrQSHkLuE7VBWiugntmveAM9gYYosmf/djeqWtn99KygKpjVULmGy79dj5+u3FaV0LQo7UKunKLfxcqwnUccZ0IqSfrnfGA8AA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dhvf2Dg0tPp7GDOQtlUeR4Tu1f4jCnswHeGRkongp4o=; b=jneyVZ5P/CLtaKC+GMDT1J7zt8gpbpwybFRpg26xTZg9h/fPXgiH2Vdm1Z4uxGqMtA1ziMllRtLNExIxDCIFjCgl+Ntd4lyoExZa+F0WZPkipYVtiTb/FJD+kqBmIMSBqsylD4AA+Ffwvw1KHa6t8h3UT2ZCvLqdTxXfjFZD730= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by DS0PR01MB8004.prod.exchangelabs.com (2603:10b6:8:145::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.9; Thu, 5 Dec 2024 21:19:08 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:08 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 2/9] ACPICA: Add EINJv2 get error type action Date: Thu, 5 Dec 2024 13:18:47 -0800 Message-Id: <20241205211854.43215-3-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|DS0PR01MB8004:EE_ X-MS-Office365-Filtering-Correlation-Id: 310c8a74-0a47-4ac6-148f-08dd1572746f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|7416014|38350700014|921020; X-Microsoft-Antispam-Message-Info: KxGPT6i1gujMbkwAeLE5ghxt1r/rmscVND0cC2cuKlaYzsl3jReNuwW3v1QmJHblOeh0cCPhTIDf+c7TNqVrwbWvo++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7mBXmwmlahW1iGzc/ERPI1HaKnKTOtgoWwfodnJk9iiUxCbU3TwVyNpGOqY+EzHLPIGlY8b2mHKEBI3vfXv8fbgd1S2tMMN2tttO/xEs+l+87t3J3FmyEkekeFcged2Is+dwOimJ6385wwTou0QmaN3ylt84AH6AgoMWcQtWyJ/UaOGzcr4QAVviUWo4rtomfPA9rCprusyMFvBlx0XOPvAQePuxfVj7KTWyL56km6v85D5uDI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(7416014)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: giKDuIzGWPlQla410tyQ8yzR+5gZrsnpsqlz7AcF9mWkNUtYmDyBg5e7tDP+nOfxQpIITOHNYnWY4Cn0y+IJ6CnNOF1naLwONq0tlxJyyOdC65hd095zjYZSFmAvw1dbDhRMsC8jN6niOx+EPDvPPMpaM6GKJP+79LVvyoQd+8WDCtpvQI4U0noZjUUoB08OX1urZoSQGjsZZT4Q44n5/owF62zem1etGWpw6OZ4D1T1aOqO5rxu0PIEt2xfuctcXpLJzHdGzx/JZCeZzJeyBw3FixHQjMf52dYU8w0LXno08ZX1RJ9FfrjZDqDJHl1QvV7Sf2W1g2G7Qs74zyN7ehFlwjNK3d36CLEfamimZpD36zj4ufjMBcoAUwbXUQvO9a4ecuIfpsfFDyq7fn3NItAJvJ83wDsidDZHFcXDl+OxceQgUYpurOgb9qNOgskp+Ulu0o/7xLT+WSE2qq2lVG48KA7or/DsiMgT2vkbc52T/8tV8AXwh5wvk8hk8qQuo1h4ZJN2AD+ojg+W7RXSSoTGyAT1cwVBbX4TcqAUBlZvIbW8IY7ulsDHvutM3xcgZ7perqW25BsLzz4+udDzj0iqwWy6DOLSq2m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Message-Id: 310c8a74-0a47-4ac6-148f-08dd1572746f X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:08.1608 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: w/+4uxhVNlkBd9ZkUtXPArCU27GtrtmdlK4T3E/m2popRmZX+hfE36TlLLlMFtvJdDAu/0rjvc+u7Ff7ADMAR/TU8DYxrdYk0C6LC7ygB6Aiuv7b21HTcsuT7xBGOife X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR01MB8004 Add EINJV2_GET_ERROR_TYPE as defined in the approved new ACPI specs(1)(2). Proposed ACPI spces for EINJv2: (1) https://bugzilla.tianocore.org/show_bug.cgi?id=4615 (2) https://bugzilla.tianocore.org/attachment.cgi?id=1521 This commit is not a direct merge, it will come from ACPICA project, see pull request(3). (3) https://github.com/acpica/acpica/pull/977 Signed-off-by: Zaid Alali --- include/acpi/actbl1.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index c701c434976c..f52d5cafaf76 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1034,7 +1034,8 @@ enum acpi_einj_actions { ACPI_EINJ_GET_COMMAND_STATUS = 0x7, ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 0x8, ACPI_EINJ_GET_EXECUTE_TIMINGS = 0x9, - ACPI_EINJ_ACTION_RESERVED = 0xA, /* 0xA and greater are reserved */ + ACPI_EINJV2_GET_ERROR_TYPE = 0x11, + ACPI_EINJ_ACTION_RESERVED = 0x12, /* 0x12 and greater are reserved */ ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ }; From patchwork Thu Dec 5 21:18:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847889 Received: from CH4PR04CU002.outbound.protection.outlook.com (mail-northcentralusazon11023133.outbound.protection.outlook.com [40.107.201.133]) (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 7168B1CDA01; Thu, 5 Dec 2024 21:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.201.133 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433556; cv=fail; b=MzJ0ojl5QYw/VQNTolQ+62G5Bwb5QL6QsRfRRoYVJzTYGKzkTlv/htbNJ8ZQ7vLi7CpqCkQsy4j807W4OqiFvD2Ta/gtRtoovpqCrpt+XzIre8lNhVc/Q6Oxc9lTWqY2JLSagvJqV4Id5srcgoVonSndVlKUyI1HXA80SLUp8rc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433556; c=relaxed/simple; bh=UaT58DP0kOvcS/VsNjE0OuNQAbLJRuVNKyGNi/ZslXY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Pup7qu+movtI3amdiO0En840sdF1rKi+LPWFvNexgfBNfDjcpu/RjBU+tcyElct/0uqbF6s6cz9+k6nAiBMEtlcNTmQyH8CdUTT/XW0p5Dw//m6CbTP4168tcKOhXnWJeIUEnybtKlEAF0/iTSLcs0dp2lVcDpGrjc2dxAmUEpQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=kc10d+Ew; arc=fail smtp.client-ip=40.107.201.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="kc10d+Ew" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=xkQLm3vS9sMO7JdKHW90veZBMTzpJDyV+a/id7otcgbYpThnfWCgrgSMrlnIwISmthgJPmRMUTGSPjsi/jNq/0KYMWVqGK8vYFGbrHv3aK6uo98tzzizVp7XLyaMyCXPl+n9Obx5wSMIhpGQA4LTW6Oj0d0Jw0OKtcJVY8kIJrmXK6f18f1efK+xgajmdlSjN1wkuwcxQ1TbiEdOgvd85nkcpjxXWi8QDHg/9KDQkSzZxSGkZtwyLgIYmv6dUpYmCGQtjk3FAmsZTax8pVtQmoluDCuacO1bFtMQ+HJRUBJmPbC+LVtXCRmKH+R8heh2YmFpua+gqZzsJI/8GGyHhw== 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=ZW4N+EIxUmjJYGt9UOP9yQ14wcV9A+UQFx1vcP+1tyU=; b=rH2OhsavgCpejFEAV+UiEFgcCjBFnCF5wom4zllBr82ZQqyeUD8OzZY27UY+N+EYN77ftawgmaH7/aYthQh6V63yOG1lEP8NmmJmyTpEAiqwqvETVCvPfrFEDy9kUhbZL7A2cY+/A/yYRrHxWYz4Fa6dWU6LWx0n7lIt7FaDm04G5H8FJ64FtXbNsU1Rzmok9/NAjGeIBcMMaVgLjQlai3+sRXdKt+O/JXnjNS+he4xJowH4XgLZ8V9iM+CQArDWaLFuKXGxXpCxqHW7R8jzS62DIkfWj4Kx/043SOGmXbawD3ewwm1n2+cjKjSzm399aL52aFXmDNEjiVQuFjrEiw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZW4N+EIxUmjJYGt9UOP9yQ14wcV9A+UQFx1vcP+1tyU=; b=kc10d+Ew6g9J47SaIye1Vr0LKgVR3XEK+EW+1Rv3y7yTSvKysu8pjmnLwCHTEPybZhwWcvckXtjuaNY1l7iwkjMeasoN4+gzSAleX78YrdQ0Q8s6ZBfkmCIWc8lE1a2pZv9ElorJW7IGk6kgAzIWj/ukrtVZYkI3dOEvUrMRVyQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by DS0PR01MB8004.prod.exchangelabs.com (2603:10b6:8:145::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.9; Thu, 5 Dec 2024 21:19:09 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:09 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 3/9] ACPI: APEI: EINJ: Fix kernel test robot sparse warning Date: Thu, 5 Dec 2024 13:18:48 -0800 Message-Id: <20241205211854.43215-4-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|DS0PR01MB8004:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b603027-296f-4820-f0dc-08dd15727553 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|52116014|376014|1800799024|7416014|38350700014|921020; X-Microsoft-Antispam-Message-Info: dNmOJ9mzlAMt10x/gcabY3/JOvDF1xxsxqcd+LI2PsO3QIhGGWpMlhqkqtoQih1V1d8nxV1HVBHinQUg5ssmTDNs3kHB0NPgjR5yL/J42+QP9M/fBTVymiVrE0F+WhqSl/F5MBy/KO16ra9TJV7F+AhrtKp6smSj17LQKtS0k7Xx/N7MToY09ux8abPqnDlnDEuG8BHa+CTI+qp7XD8SlP6+ANMg2/DZGmQ560q8EYx/EvOahwN6pTtzb9nez1PTI1j76zCDPFFPJSa71Zw2rMnuT+HPkYkQdtzAtyAYGGdjI/OZ8i4lrt+VHYsmV/IKLhdC/y0V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7m/rEppLe4fM3ndJYwiymI14lquaDl8fsU= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(52116014)(376014)(1800799024)(7416014)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: W2mHNEoAXXIZ0ifSafKFgoqFQvNfpHwhMYpWh+AAkEmgYwF6+r/byrraF4T5HXlUYQMBzfftZX0u/2PMHRdG/Np8qffNGGbwfs/1tAY9HiOxhkTiTyk0l1elcbp7eumhJjQApafJWB4dZYOm1MeJdZJJd9wTyaaiLe6M4kahfGoyaizo9h7CFMuuElbxoOzZc38mVnUxupyru3tavT5En/Lxnf1KKtTbESjSvXwjhCwBebw5SD5hG9vl+1Bdy+eeC7APYgVEA5LIqaxABHMHY1OjGBhhfr9aXE+P05s8hRb4AUHAwwF/Sw7FO7fwl2cFlkGouoUfKOvApE2Apw65hZLVE4pik1MPwFHvJ5/+WwJ6GL3TGkPmAr1xcDYRW0gMT3bm0afUjVsLu+o/CA01ixELMg/ZYVQ0rw1mT60Xhyn1JIGQiUTYQIIZor4CmKoEWsXr1/05bMqrFO7TimWanoLexhH2eaLQYMGB+thuLq0oICYuppCgeia5erGNr6gYsr8rJ8V7aJlECKntgK5yif/Rdlf4f6DQRAiuqeohqhIqoNY+Bmb4AD4bTMDx/51TghMQXiZuAcMLSUxHVh+0X/IA+MjoR0PhSgvPZKeUFv8GINaytLF7VaflaX3yhZ7M6nsPjZzDkvbqaULjMK7NstWCsWzVDLsbiRwWzj5PpaC10msCkIXqNAH/i3Qe2ChA9ptt0kR9IuzvCrSe1JcpIOu0G0OUnNhkQugevlhwyMHnOX2XeCsaq/6hhN0cMo+iJgfEMi8/lahADBOMLUt3XZ8vKH2sN6P4DPuSR1QHSF+lEosAH4YSWfAY+pNVy/5Zl+Cs/iqcMnIW2nH0Sno5xNeA9DjmpO8duXAaLLPWArmStsFgoiWHPsjHDu7kJm1cLVL5PUFxBXSq/G7VKPtzeleSN1LBscxbygl+jgqLsyRVnCnWcPEbILq0H4ntcvzsIg/atYYXfW73aV6q0pD7OfK5T24WlNCn3DTdtJAIgk0z/BNnG9FekfI4R9eUS7Ryhhh/bICbJWPg38Ejo/+LdqIHhrcnwbcob2ioPHREzLftsUPR824hK7ycvRQaE7gHbDf0uETVRp8C+Rcj+FPKh72zfDgnDLHpzlPC1OV4ghHAeJRUruBwFHGROTQldCBAG440P6umYUZU3TWz5BkvhdAd/plWempBRTIZtBdZMlDQoGdsGBHIshGKV1MW3o5nAgMB6QCktbaYOZdNP7MN6TNNgfXQqU6S+oz63NNyQvmztYP7YZdj4TiMHIVrKW3J5oNfoci0i9fvFMM0XGFnY9SivnIYjC0y8OQvbe77bpQY4ginqgy/843uXy7/hEEw1ZzCwGsFulUiVJHusK3QiPppTKJA6boCz5Wp0z/b0flT4In5StQSCulw95+4/U2Xt8HDf+lfwBFuWSFvff4w249y725Nx9g9mhk7H85XOlmUY2kwD60Fs0s8YizpcKyES81WX3YPoJrV9eYc+SsIzuZ1hMyYGob9y8tvTdNBTFMeFOAu5NzGIUwwm1D0y8XsD9MjI+kLUb5DrW5r2xruvd2yLCtYwnOYaSERtzWAYbanjcWWIkMJqNh5/YldYX/VVTZZgmUbZxHW/tf9Ky/WbWoV3muc+qZtWSICTFuCjy4= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0b603027-296f-4820-f0dc-08dd15727553 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:09.6545 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: HI6exUnfUlV2QGUsF3By7Bqwefyx4Dr915LEPK60DxG3H83KjkLvBTbxKQveDJpVO2cUJvBeFGyaWGcWtggKw+rJThx79rUF9/qqwRu2+Br49JWrPH3IouM2as6Q+vd2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR01MB8004 This patch fixes the kernel test robot warning reported here: https://lore.kernel.org/all/202410241620.oApALow5-lkp@intel.com/ Signed-off-by: Zaid Alali --- drivers/acpi/apei/einj-core.c | 41 +++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 04731a5b01fa..74dfb3daba50 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -215,20 +215,22 @@ static void check_vendor_extension(u64 paddr, { int offset = v5param->vendor_extension; struct vendor_error_type_extension *v; + void __iomem *p; u32 sbdf; if (!offset) return; - v = acpi_os_map_iomem(paddr + offset, sizeof(*v)); - if (!v) + p = acpi_os_map_iomem(paddr + offset, sizeof(*v)); + if (!p) return; + v = __io_virt(p); get_oem_vendor_struct(paddr, offset, v); sbdf = v->pcie_sbdf; sprintf(vendor_dev, "%x:%x:%x.%x vendor_id=%x device_id=%x rev_id=%x\n", sbdf >> 24, (sbdf >> 16) & 0xff, (sbdf >> 11) & 0x1f, (sbdf >> 8) & 0x7, v->vendor_id, v->device_id, v->rev_id); - acpi_os_unmap_iomem(v, sizeof(*v)); + acpi_os_unmap_iomem(p, sizeof(*v)); } static void *einj_get_parameter_address(void) @@ -253,9 +255,11 @@ static void *einj_get_parameter_address(void) } if (pa_v5) { struct set_error_type_with_address *v5param; + void __iomem *p; - v5param = acpi_os_map_iomem(pa_v5, sizeof(*v5param)); - if (v5param) { + p = acpi_os_map_iomem(pa_v5, sizeof(*v5param)); + if (p) { + v5param = __io_virt(p); acpi5 = 1; check_vendor_extension(pa_v5, v5param); return v5param; @@ -263,12 +267,14 @@ static void *einj_get_parameter_address(void) } if (param_extension && pa_v4) { struct einj_parameter *v4param; + void __iomem *p; - v4param = acpi_os_map_iomem(pa_v4, sizeof(*v4param)); - if (!v4param) + p = acpi_os_map_iomem(pa_v4, sizeof(*v4param)); + if (!p) return NULL; + v4param = __io_virt(p); if (v4param->reserved1 || v4param->reserved2) { - acpi_os_unmap_iomem(v4param, sizeof(*v4param)); + acpi_os_unmap_iomem(p, sizeof(*v4param)); return NULL; } return v4param; @@ -325,6 +331,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, u32 table_size; int rc = -EIO; struct acpi_generic_address *trigger_param_region = NULL; + void __iomem *p; r = request_mem_region(trigger_paddr, sizeof(*trigger_tab), "APEI EINJ Trigger Table"); @@ -335,11 +342,12 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, sizeof(*trigger_tab) - 1); goto out; } - trigger_tab = ioremap_cache(trigger_paddr, sizeof(*trigger_tab)); - if (!trigger_tab) { + p = ioremap_cache(trigger_paddr, sizeof(*trigger_tab)); + if (!p) { pr_err("Failed to map trigger table!\n"); goto out_rel_header; } + trigger_tab = __io_virt(p); rc = einj_check_trigger_header(trigger_tab); if (rc) { pr_warn(FW_BUG "Invalid trigger error action table.\n"); @@ -361,12 +369,13 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, (unsigned long long)trigger_paddr + table_size - 1); goto out_rel_header; } - iounmap(trigger_tab); - trigger_tab = ioremap_cache(trigger_paddr, table_size); - if (!trigger_tab) { + iounmap(p); + p = ioremap_cache(trigger_paddr, table_size); + if (!p) { pr_err("Failed to map trigger table!\n"); goto out_rel_entry; } + trigger_tab = __io_virt(p); trigger_entry = (struct acpi_whea_header *) ((char *)trigger_tab + sizeof(struct acpi_einj_trigger)); apei_resources_init(&trigger_resources); @@ -424,8 +433,8 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, out_rel_header: release_mem_region(trigger_paddr, sizeof(*trigger_tab)); out: - if (trigger_tab) - iounmap(trigger_tab); + if (p) + iounmap(p); return rc; } @@ -860,7 +869,7 @@ static void __exit einj_remove(struct platform_device *pdev) sizeof(struct set_error_type_with_address) : sizeof(struct einj_parameter); - acpi_os_unmap_iomem(einj_param, size); + acpi_os_unmap_iomem((void __iomem *)einj_param, size); if (vendor_errors.size) acpi_os_unmap_memory(vendor_errors.data, vendor_errors.size); } From patchwork Thu Dec 5 21:18:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847599 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11020128.outbound.protection.outlook.com [52.101.46.128]) (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 B6FFF1CDA1A; Thu, 5 Dec 2024 21:19:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.46.128 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433556; cv=fail; b=HohyZSs69iCY1ReX0S8bKPQQyT/xeL/RbByNRDiWHxfaUk0khAjEC/SB5w4A8h1fMH7GdqWGyB0j+N2xdEfnlrSn/Q5OZJmDZ70DbfmR+/LOdGLYz/ipEj5/EbvsV32VJAvtHtZZLCW7LAujmsisrGDeV2f8GysaCeYeV0f43s4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433556; c=relaxed/simple; bh=6AkT1rOWe10Psl5WnfvQe5azUxz5gOgOVcVD/Ax6CC0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=eLUSRersCH1R81Yo9xLrYKH465LMOMjrLjtH73BKHUXKqoHiVWNS+SYTO4T9Lm9mA5yFUiod2AhdvILd68dYA0Kqs68URFeq61BGsQ+Fkp/UJShVIwa+iugLeJoAm3wUw283hA3h0eOb/QXdCf3qxTh2LmXvnSfnFJOSJ5b+JgI= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=EQQhEgfF; arc=fail smtp.client-ip=52.101.46.128 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="EQQhEgfF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KutDhQ2Ketfz+oyVO9+62+NZX6yUxv5k3CcuvIn/We84dNRCCltKKUkoedQbBugZSpqGH8ZJBo/14Y6i/zDcWAK2H2SqxdLPdj7RJXiiZlBQt8BtbYeCWhKG4RAn8egfbk3iAuQU1cMBQZ4nNGB4brtj+vIV+NodusNx6T/tFepvI1hTKzX0E8fNxJzaVIBwc+Rj6zbiPehG3Dlbgkbk15AdcL539hW0Q6k+rMzQd3VhdcEejjZ4ahINfV/pPCFEVrpaGf8cE3mDguG5Cttvyz1q7x2wiR8eN6Vp0AQ87cro0XL/FbwKy6bYI9YEPa3Juv6RQQ9cNQQOyfw+wuo+sw== 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=R9bLQ+s2040HXPWHWkaJpuU/D6Ph+qMH9WVt6VC32hg=; b=gZB7dSTGNZURfy0H0LSxGs5Nb+HbwA5aU5s44mcC5dwo9VQMvN4WaRw8R0Y6bDD8y6hsktxIKonzcHgfjMK6YwhwvwVrUKY5z6hCyClPEjnHkjguhHIGIPa2KEYU4oxaOEsaT/rSOWp8POQ9KrE8rDFQ4/6+kKsbDu+qpMdoF6U7/lSqKLj+ItcJmgcUrJCBPwSaKQgQIMyEoUlxB9PamdQHbYB51WYm1uo8KUvWnoPIwPrpM1y/7Bu59l7LO9+Z0DZbqtq7StuIvziAVbbQPWdGDT1rzwjN+Eh/VqMKedaz2mLO/7WFMa7nLBomi1Wi+7I5IQua4yMSMIAgyU55GQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=R9bLQ+s2040HXPWHWkaJpuU/D6Ph+qMH9WVt6VC32hg=; b=EQQhEgfFdwauUonY7Ec/lcEGRBcTpxRMiZSQn0q+Hh8Agjo+JQOeePW4lFNlqOJqRsCF3rFMP7EVFyjUisZh4k+lZDHPySCMOXsGe2/xl1mfAN4VEN22l+k8Qa3PHz0zLgEFWL0IhKervH9QwHGCYcOkaV8Pbxl7cd31MDLTCIU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by BY3PR01MB6625.prod.exchangelabs.com (2603:10b6:a03:36c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.9; Thu, 5 Dec 2024 21:19:11 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:11 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 4/9] ACPI: APEI: EINJ: Remove redundant calls to einj_get_available_error_type Date: Thu, 5 Dec 2024 13:18:49 -0800 Message-Id: <20241205211854.43215-5-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BY3PR01MB6625:EE_ X-MS-Office365-Filtering-Correlation-Id: 57a4cdd2-d3cc-44ba-90b3-08dd15727634 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|52116014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: r0SFILjiTbnPlt9m9TsjFu0vtg27m1z5LrvGMablLl8RSTaDMFRMJvZ+JhwpBWaeADgoz7ui7khseI/lxG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OsPHoYC0TW6bJmdq7mr7JmsfWhxHSbMybt2O3+F8IT69Fj2/Qnv+nfZQeAGPQoho9Lap1f0cd8h8geO/0PQV0fs5+3gQuy5u5TpOvg2e6Z2FeDBTuxwtUXXr95prgtx9u/duob/PulIpf0KCmfsKABp3KTdSEkRY8au1KQcnlXJusjUJb+fEpB61AnvpBGHT2WsqmLPToRzqW1aWLwwoZfjwRk52iX0UnLlJogHsRs1FB1JfotP4MGNrX0DesvBOPVEoDoE45TB/B8w8BjeVds= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(52116014)(376014)(1800799024)(366016)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MqJeRQGYix41IVUP+A5rGXWMyJWEr9rLQsG6LOewnnIXBOLH4E5vJNN4vBS2Cbai9r8hMsIaXAOj+sB+L4opWzYmD5M2609WZvADjmqv+yozF4U7t4y3R4ZZBk5vPLz6TgnreZh/+uPDFTT1CkbCwOivW2bFakqAYAzm0AZLeN2bDcTvYae97sFaGkFamrTpnGheAbpSm9weK9lC3YLdWR13Xby6w8UuqKuiHY8MPZJ1R8ybYIGHpOIcSgpToMiGKACVST5C5j3CijfdUbyvN37R5+J92FlayH7tEp1/7MGdOOpOhiUFGKPIZh1wcB97bL+AEX2QpQgZwJBwXCaEq2U6aFsGzYJ2Q1zEMYIhllpVFcv+Fz/+uuCWFqNK/Tf5UR4OK0muVPCEasJVnu6UO6bOwJcGaMGJmudhg+x/q3tDRjO+Tn/3BEpgkU/sx2a3+nX799fCAiJp41KYzmBxBtOCpLwBuk31kJg64iq9tZjzfZ/mS2PFf+hI8ZtWg97O9eXq0qLI6vN5UHpoi+TYqCJVnPxYJITAg6TySsl9Ut+wD7AJ+nheYKe2JR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riginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 57a4cdd2-d3cc-44ba-90b3-08dd15727634 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:11.1580 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GLTcl7Sj/Ynol+QYyOkSygHArc5w2Mbs8z9vyRrR6mzkG1iVI7iZmvTpQAyzgilIU9H7No64wHkPWi0Yk7qfbYKBTdkE4hPefvUPrxWZoaVvvhHmXrmp3G60ygaSD9ky X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR01MB6625 A single call to einj_get_available_error_type in init function is sufficient to save the return value in a global variable to be used later in various places in the code. This commit does not introduce any functional changes, but only removing unnecessary redundant function calls. Signed-off-by: Zaid Alali Reviewed-by: Jonathan Cameron --- drivers/acpi/apei/einj-core.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 74dfb3daba50..a6b648361d96 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -83,6 +83,8 @@ static struct debugfs_blob_wrapper vendor_blob; static struct debugfs_blob_wrapper vendor_errors; static char vendor_dev[64]; +static u32 available_error_type; + /* * Some BIOSes allow parameters to the SET_ERROR_TYPE entries in the * EINJ table through an unpublished extension. Use with caution as @@ -657,14 +659,9 @@ static struct { u32 mask; const char *str; } const einj_error_type_string[] = { static int available_error_type_show(struct seq_file *m, void *v) { - int rc; - u32 error_type = 0; - rc = einj_get_available_error_type(&error_type); - if (rc) - return rc; for (int pos = 0; pos < ARRAY_SIZE(einj_error_type_string); pos++) - if (error_type & einj_error_type_string[pos].mask) + if (available_error_type & einj_error_type_string[pos].mask) seq_printf(m, "0x%08x\t%s\n", einj_error_type_string[pos].mask, einj_error_type_string[pos].str); @@ -687,8 +684,7 @@ bool einj_is_cxl_error_type(u64 type) int einj_validate_error_type(u64 type) { - u32 tval, vendor, available_error_type = 0; - int rc; + u32 tval, vendor; /* Only low 32 bits for error type are valid */ if (type & GENMASK_ULL(63, 32)) @@ -704,13 +700,9 @@ int einj_validate_error_type(u64 type) /* Only one error type can be specified */ if (tval & (tval - 1)) return -EINVAL; - if (!vendor) { - rc = einj_get_available_error_type(&available_error_type); - if (rc) - return rc; + if (!vendor) if (!(type & available_error_type)) return -EINVAL; - } return 0; } @@ -786,6 +778,10 @@ static int __init einj_probe(struct platform_device *pdev) goto err_put_table; } + rc = einj_get_available_error_type(&available_error_type); + if (rc) + return rc; + rc = -ENOMEM; einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir()); From patchwork Thu Dec 5 21:18:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847888 Received: from CO1PR03CU002.outbound.protection.outlook.com (mail-westus2azon11020128.outbound.protection.outlook.com [52.101.46.128]) (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 F077E1CEE8D; Thu, 5 Dec 2024 21:19:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.46.128 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433558; cv=fail; b=XhBTgWIRY9VHBo5Bj2mxIn/KmO5qAyY6T+N4J7Lal82W07Gu0mXo2UnF2KqBQfpJaDoapPBBf08JJfEAT5pXhKKz2JpPqf/e8JZkgLGHTmGS3j0h3nSGEizsZIomm9wxb+UKX65P0EOxNy4fDgQzW9ptqk6IKGbKsgkauq4g/iY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433558; c=relaxed/simple; bh=Sz7MauQ+i3s88IvH1p7ZasZ/NJqE3OcNkXyiZjMfmB4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=cylmrEgIEKCJdsJWxVa8+X9bdO4TPMh4rqiRjoPeJFEv/fuif8RbJMKXrTVZlfoqJCbVvWyhR9kLD/OltutmfGoNiEt9xLlbER7csp56bpZ76N8Y/qlbW8oFpl2VE2Nz4RovbPCY4egyRX3eYveE8X0PCIl7pzan2WNNZgsbGgw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=Wb9wpsG8; arc=fail smtp.client-ip=52.101.46.128 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="Wb9wpsG8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=XF6I8x+CNcuxW19PNFp8XJv3TSzg+/V9KV4Zad1jkLQy+efVT3dBZvbQk9ydjLcb+NPby9/dQsyow35O0ul+N6Cr99mEKFA5xflgsQikNqykRHPfaXpFukkjEZNQVm3RWNFcbSaC3+eIjk9eXdiP2SR7gKIK4SbuDKj3gXIw+QHdtMxzwl94lQH6bgYZYcxZS1gtIp6P35whTQLsj1paFmbOxHTAb4q1inO+hVVQqfcj3Sp6yfg6BvMg/bRoU4vYVKeH5gj+ysrd1oPEauW8UmdP35bhLBZgYOkoN2b+om9gK1c3+XFLrCkxZNSF+C78ROp/T1WW/lxXrvWd/U3PNw== 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=J12NBPNL1F68tAUE41e1CX+dm/Soh3SsBMp6tTLrPeg=; b=CBxbPAQLpFrdbisOZUEvKIl1L05FUPiCfkc1pWEKqfiCh1aUMQ5gs91jOs9mf/2U31l5GLZgCZezChgMhYKDpW7WN7BJdfdxKhQZibtdYmZFUgIM5kOviSYRDMS13wY7UxqJKdGBfxEvafE/ByykUR+dUUjQkC5dz1qsVHNUuE3Z/j30dcmxtso2VPJ0DLHLTXxX+RhrpZzbgW2tr2Sqe3yA5M2mDzRKwWCQcVFoya8DqfuoULNP0Npi7pVejkMLwO0TjytxXTlfHvrmWMjhkgOO4hk91R6dig/79zKyGiX/tqomo35A3t649csZUJv93XBxZ1ZmLYZm2svUbNqY0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=J12NBPNL1F68tAUE41e1CX+dm/Soh3SsBMp6tTLrPeg=; b=Wb9wpsG88uVeev4U8ZhS6v2gurNjiWDMH7T0e8ok4QKqcPa5QL3/Jzlsqc8Yb1y+JNpYuUFwY1sZQ4MPFpVw/DWDMgqnP3/c7rWfCT0a/DZtzYjeQD4D1yKaNRueOt2mx75izC8McNOMt3EGYQAttMTDsuScEhqkoLmZZ1K8xQE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by BY3PR01MB6625.prod.exchangelabs.com (2603:10b6:a03:36c::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.9; Thu, 5 Dec 2024 21:19:12 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:12 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 5/9] ACPI: APEI: EINJ: Enable the discovery of EINJv2 capabilities Date: Thu, 5 Dec 2024 13:18:50 -0800 Message-Id: <20241205211854.43215-6-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BY3PR01MB6625:EE_ X-MS-Office365-Filtering-Correlation-Id: ccd2ff5b-285c-45c2-2df7-08dd15727721 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|52116014|376014|1800799024|366016|38350700014|921020; X-Microsoft-Antispam-Message-Info: xJRHc5sWGTrq+b8AQJtcwqp2JY7zi8ySZwfoBGGaUbfZxtd9QdeokHm4z/B1Tc7LGqnm10m7pE3Yxnw+eFRdzU2oELzqtdby7iYe32A5bP9/QwbvhPBoT5KhbPrmL7f3IA1HEEIzGhXYR02bAZYfneFUU3cdIdWt39bW/VTsDzcQO0Oc9dTIcZzhLCLQ1A0WnsxUylaz2DMRkgWVrQtq3dZy0cibUzkUzauMUXTwVHGD940peIjb0u0+9hX1eTV4vRca1nZtVpuoQyI8sl96l0TbAR4G5yyyPWG63YN58akXZ4j52fCRij9mGbCKKMJwnG62vZT+YOxEeyWKSoeidmQGCDObyONCO/1zT7KDYrBFdOe5UPyBhFCfuUwD9xy/0BrISoRoNg+xVlCI4dEL8xcTxiHDwZ8gEgLZaqy+TnspjSlNJmemQpAe9LHaAnxixLYzP9w7je4W5oe41kldFM/nuln/NW52i0bhmVtn55WRIAQgnMa8bBUls+6uIClOjwiNCF4g1zWz7x+7y6AH3extmFKur5wb+OHbAjaA8pBG7XZzK9ck1XpU0WrOz8zr7/NouOf6p7Z+s+wagrpc94ud/F3MYLah3HAf7EJ9Xn9Xd2B7XJcQaZC0jxhTCc6qwDRPQcQDKxQoD8a5161UEA4dUYDvC/x5+7L8voYfZdgnnm3+c9sgW9jcsZBNdhpf/VWUrglOZaD6Qa1xD8zzOVysX9MoUhwluPf2p2lXSOPDSfW2L2sASGjrtOiG4FCHkTF99FbVbayQMkm83Ur/vp2slEcfl94TV988oG453uToVQuEkR2U5EoU6yBuBD9xjTg5bahyaQ0GcyeEgOtsMKnf/Bt1t+i9/tj6kZXIBuL/XHfezqXG/YOeCS5xgjEgDNLt3DuWJRkBmDzi7Ng6BWqo+CzGNP/rkZyiwrBB/MpdlkLqihgFKV8AQoEdmy0+KVM9EaupSRSBy/oTew+czcHNqSUZo9xOhvmBCln+/3Mjne6JBuGIxD9rDrwHjYt3OoEE+/Aoafw+htY37ygwQMW+4Yhf7Bgkz9Qf5zkfb5V9l/u4wNHh/ttVNl30ffAY/gEqQ5h4apAbSn2pdNi5RFAhjbAFVymLrZzWskIhxhWjp3EUlCiMNzlqKj1vv/TVyd/MqGO3k8v6KpnUrU4085gJOH2sPOavJ6bfkVnzQC2T6fCe+IA5cqlx6BaHB4ZAYY++QlZg3y/EDGqOJoCSSG2FbvObpAHY2RUoWGIF0RTcym1yzITwLb8ENEvCVF9ttvSDHE8tC7yDwUyKSZrU9G4ZEu4rdgHVENFJ3TV6rsT0gA6Qq5wihoSIDEvLjgfa9higcYTyCz+FQBPM3PV1lX4wmaTHasl0FhNorjQ3ss9d5y0FeNMLosWuwpfutcv8ZelWzJ4s9VF1Uz3MyE6xA1dzXDv1xONcJHrFiHrKJkE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(52116014)(376014)(1800799024)(366016)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: F1+/SSngAF80TYBcXd0NCGFzqANGK47Z8TaEGBCSFRZCc9s0V8e9ODwUQprGHXakhnuAPEOh2UN0M2VspCZkpPl7CjSjrX7qlcK2jwyhIzeHeIF3SZQEJtK4h6XCho314FssaX5I5rEBpSvoTGDIoYJgS0nrVwkpI7sgIVsVzOml8Z3dReCFaRbJ8euMBw952hrFKNV1mVnDd6+y/1oO/H37PXu2rPUrg9VIAXEMTIDZu4zm+yCTF5M9qTXNjwF+ADfSGEHJtE2hdp6QLA7rJuZ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mcgeN6FXiAdL4w1Z0GxhCZGf9qeGLEP5glRoidx24Igz3jRy/ABcBoqX7nJu4V9NaEbGaa1BtjfN6va5CeHY73rfaPcHOXrAR4mEFEjrn8RRMti7dIKsL5iWb7TaZO8KI7F8On420eqYlALoA7AXjUMLJ6VrhNRolU2dbgvn8rAiVyT/bBx61HVq9vbsRSlrgfWqQuVbacf9i9NLJZ+J8K/1KkRYTxl4jvMnV4c0Xy+KN+7jSuJV4iv4xSVZ2uxo4W3kMg3ica3Pcm04tMv8ERc= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: ccd2ff5b-285c-45c2-2df7-08dd15727721 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:12.6517 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UDKlyUjUf+D5g5iJxAmRMCKMC6+51JPSOlMyLM+vaK7DGiNzEO8l+799JxYqnUoh5ILuXtZMHETcGEqQMYD0gGRTNqWchLeOXf/7l6a6gRmi46E9eyzzkDeBJ92+Ezq4 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY3PR01MB6625 Enable the driver to show all supported error injections for EINJ and EINJv2 at the same time. EINJv2 capabilities can be discovered by checking the return value of get_error_type, where bit 30 set indicates EINJv2 support. This update makes the driver parse the error_type as a string to avoid any ambiguity with EINJv1 and EINJv2 error types that has the same value, where EINJv2 error types has the prefix "V2_". Signed-off-by: Zaid Alali --- drivers/acpi/apei/apei-internal.h | 2 +- drivers/acpi/apei/einj-core.c | 70 ++++++++++++++++++++++++------- drivers/acpi/apei/einj-cxl.c | 2 +- 3 files changed, 56 insertions(+), 18 deletions(-) diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h index cd2766c69d78..9a3dbaeed39a 100644 --- a/drivers/acpi/apei/apei-internal.h +++ b/drivers/acpi/apei/apei-internal.h @@ -131,7 +131,7 @@ static inline u32 cper_estatus_len(struct acpi_hest_generic_status *estatus) int apei_osc_setup(void); -int einj_get_available_error_type(u32 *type); +int einj_get_available_error_type(u32 *type, int version); int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, u64 param3, u64 param4); int einj_cxl_rch_error_inject(u32 type, u32 flags, u64 param1, u64 param2, diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index a6b648361d96..2c57e25252ac 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -33,6 +33,7 @@ #define SLEEP_UNIT_MAX 5000 /* 5ms */ /* Firmware should respond within 1 seconds */ #define FIRMWARE_TIMEOUT (1 * USEC_PER_SEC) +#define ACPI65_EINJV2_SUPP BIT(30) #define ACPI5_VENDOR_BIT BIT(31) #define MEM_ERROR_MASK (ACPI_EINJ_MEMORY_CORRECTABLE | \ ACPI_EINJ_MEMORY_UNCORRECTABLE | \ @@ -84,6 +85,7 @@ static struct debugfs_blob_wrapper vendor_errors; static char vendor_dev[64]; static u32 available_error_type; +static u32 available_error_type_v2; /* * Some BIOSes allow parameters to the SET_ERROR_TYPE entries in the @@ -159,13 +161,13 @@ static void einj_exec_ctx_init(struct apei_exec_context *ctx) EINJ_TAB_ENTRY(einj_tab), einj_tab->entries); } -static int __einj_get_available_error_type(u32 *type) +static int __einj_get_available_error_type(u32 *type, int version) { struct apei_exec_context ctx; int rc; einj_exec_ctx_init(&ctx); - rc = apei_exec_run(&ctx, ACPI_EINJ_GET_ERROR_TYPE); + rc = apei_exec_run(&ctx, version); if (rc) return rc; *type = apei_exec_ctx_get_output(&ctx); @@ -174,12 +176,12 @@ static int __einj_get_available_error_type(u32 *type) } /* Get error injection capabilities of the platform */ -int einj_get_available_error_type(u32 *type) +int einj_get_available_error_type(u32 *type, int version) { int rc; mutex_lock(&einj_mutex); - rc = __einj_get_available_error_type(type); + rc = __einj_get_available_error_type(type, version); mutex_unlock(&einj_mutex); return rc; @@ -641,6 +643,7 @@ static u64 error_param2; static u64 error_param3; static u64 error_param4; static struct dentry *einj_debug_dir; +static char *einj_buf; static struct { u32 mask; const char *str; } const einj_error_type_string[] = { { BIT(0), "Processor Correctable" }, { BIT(1), "Processor Uncorrectable non-fatal" }, @@ -656,6 +659,11 @@ static struct { u32 mask; const char *str; } const einj_error_type_string[] = { { BIT(11), "Platform Uncorrectable fatal"}, { BIT(31), "Vendor Defined Error Types" }, }; +static struct { u32 mask; const char *str; } const einjv2_error_type_string[] = { + { BIT(0), "EINJV2 Processor Error" }, + { BIT(1), "EINJV2 Memory Error" }, + { BIT(2), "EINJV2 PCI Express Error" }, +}; static int available_error_type_show(struct seq_file *m, void *v) { @@ -663,18 +671,22 @@ static int available_error_type_show(struct seq_file *m, void *v) for (int pos = 0; pos < ARRAY_SIZE(einj_error_type_string); pos++) if (available_error_type & einj_error_type_string[pos].mask) seq_printf(m, "0x%08x\t%s\n", einj_error_type_string[pos].mask, - einj_error_type_string[pos].str); - + einj_error_type_string[pos].str); + if (available_error_type & ACPI65_EINJV2_SUPP) { + for (int pos = 0; pos < ARRAY_SIZE(einjv2_error_type_string); pos++) + if (available_error_type_v2 & einjv2_error_type_string[pos].mask) + seq_printf(m, "V2_0x%08x\t%s\n", einjv2_error_type_string[pos].mask, + einjv2_error_type_string[pos].str); + } return 0; } DEFINE_SHOW_ATTRIBUTE(available_error_type); -static int error_type_get(void *data, u64 *val) +static ssize_t error_type_get(struct file *file, char __user *buf, + size_t count, loff_t *ppos) { - *val = error_type; - - return 0; + return simple_read_from_buffer(buf, count, ppos, einj_buf, strlen(einj_buf)); } bool einj_is_cxl_error_type(u64 type) @@ -701,15 +713,28 @@ int einj_validate_error_type(u64 type) if (tval & (tval - 1)) return -EINVAL; if (!vendor) - if (!(type & available_error_type)) + if (!(type & (available_error_type | available_error_type_v2))) return -EINVAL; return 0; } -static int error_type_set(void *data, u64 val) +static ssize_t error_type_set(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) { int rc; + u64 val; + + memset(einj_buf, 0, sizeof(einj_buf)); + if (copy_from_user(einj_buf, buf, count)) + return -EFAULT; + + if (strncmp(einj_buf, "V2_", 3) == 0) { + if (!sscanf(einj_buf, "V2_%llx", &val)) + return -EINVAL; + } else + if (!sscanf(einj_buf, "%llx", &val)) + return -EINVAL; rc = einj_validate_error_type(val); if (rc) @@ -717,11 +742,13 @@ static int error_type_set(void *data, u64 val) error_type = val; - return 0; + return count; } -DEFINE_DEBUGFS_ATTRIBUTE(error_type_fops, error_type_get, error_type_set, - "0x%llx\n"); +static const struct file_operations error_type_fops = { + .read = error_type_get, + .write = error_type_set, +}; static int error_inject_set(void *data, u64 val) { @@ -778,9 +805,14 @@ static int __init einj_probe(struct platform_device *pdev) goto err_put_table; } - rc = einj_get_available_error_type(&available_error_type); + rc = einj_get_available_error_type(&available_error_type, ACPI_EINJ_GET_ERROR_TYPE); if (rc) return rc; + if (available_error_type & ACPI65_EINJV2_SUPP) { + rc = einj_get_available_error_type(&available_error_type_v2, ACPI_EINJV2_GET_ERROR_TYPE); + if (rc) + return rc; + } rc = -ENOMEM; einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir()); @@ -828,6 +860,11 @@ static int __init einj_probe(struct platform_device *pdev) einj_debug_dir, ¬rigger); } + einj_buf = kzalloc(32, GFP_KERNEL); + if (!einj_buf) { + goto err_release; + } + if (vendor_dev[0]) { vendor_blob.data = vendor_dev; vendor_blob.size = strlen(vendor_dev); @@ -875,6 +912,7 @@ static void __exit einj_remove(struct platform_device *pdev) apei_resources_fini(&einj_resources); debugfs_remove_recursive(einj_debug_dir); acpi_put_table((struct acpi_table_header *)einj_tab); + kfree(einj_buf); } static struct platform_device *einj_dev; diff --git a/drivers/acpi/apei/einj-cxl.c b/drivers/acpi/apei/einj-cxl.c index 78da9ae543a2..e70a416ec925 100644 --- a/drivers/acpi/apei/einj-cxl.c +++ b/drivers/acpi/apei/einj-cxl.c @@ -30,7 +30,7 @@ int einj_cxl_available_error_type_show(struct seq_file *m, void *v) int cxl_err, rc; u32 available_error_type = 0; - rc = einj_get_available_error_type(&available_error_type); + rc = einj_get_available_error_type(&available_error_type, ACPI_EINJ_GET_ERROR_TYPE); if (rc) return rc; From patchwork Thu Dec 5 21:18:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847887 Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11020089.outbound.protection.outlook.com [52.101.61.89]) (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 32625221462; Thu, 5 Dec 2024 21:19:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.61.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433562; cv=fail; b=u0vqyi2agHVlPznzjc3tyv0MeNE2xa8A+nrZytMZGjpT4lDL9LatQtcUh13m2luJn0iv4N+wi5ZwCLq1VLklHtI2OGr6XiY8WOdCSl3DB41awp6MB/ZRSfhwTzGBiQEjxqgAeDfX3YUTFL929k5OYuYr0+43d5wtpDCoHdayf+A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433562; c=relaxed/simple; bh=SNtIs0XtfD/yrsSlRci53oQzjxXub0v+h1cIjU3VsU0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=n6KNsLE4oe+sOSAd73/mDEgWgXcJNpwZkG7Gp3bbiu4XdqtMl6cbocRRjoHBGG9KI8BiOdRImxdgPMHhhVYqvNMxPEx7I2grBhupGEP4fxWCeqLrnU0qOTDjq3qNjnQILH8Lr9FrKW2mSRun6GkfY/2weJXGsFcv6jTOVQIKclk= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=aohVQAax; arc=fail smtp.client-ip=52.101.61.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="aohVQAax" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=naEtk/wBIAnpXtrtNcasNLMlwItcaJMjeX1tyTLhx+He5FGRUAX/9O3pDd7ttW3/MdDL2ISDjiKSadJCqqEaieaLji2AXYOLYGDHs7pa94BGxPi1u4vj2TLoGWX6gSHtlwPa8kaAiJU3yV79e99jiyrt8m9TSvaEfestzUMXczlZC3fR/k2XDHikhvZD6lesFbbQQFBCVQCw6P67vuWcrhduGCbrL7WIM17ulCPre30dZlE8AqGiYJ9/QVRfpmM2OwmjYauJKOf9c85g8zY03p4iRsJ60M9A5bvRg7QrHt4A6K+x6LEvjrStXaIkkAijJq0sjRB4F3REYuNnkRQMpA== 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=dAKjeHp/9zQNm873+MIF/dMakedIeOxmBryMnSByCow=; b=iP0wxqMRO76E56phgdYqgYFJhq3gWA1HxOqzAHpCMSm2n0IW0YyZf+oql0jV040K2+CwOY5pHBWIMYNNlkmU2LmKPRLRhhoL9b1fiDUBfXZD/5t34ulPaBn0WCjwNFRLTt7lrjNKD3+uhJNyPsCPVt4aQ05PAMC1BKg8hB1ZGimg+Y9gWan0gioWKxlx9LmPmBs6fCgzmHpNhmAmwco2PfcgM+Ev3/Fq5ZPfi2ewfDZj3huMvQ7RJ8vZE2QMvTTqwCK8P9IHW0dV5L2j2L6FMDCeYogfv5cQoi8IuEYnm0C+bT1cX8yePf/zFsGQ9DLMdYrBdQ3wbxdfAnrLob1Tvg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dAKjeHp/9zQNm873+MIF/dMakedIeOxmBryMnSByCow=; b=aohVQAaxGDeuO/i3bBJv7zes4EsyBfQBIa/EyuYD2uLF+vjL9lDoQ1Toc8nRVyrLHtcZzqDRS+k1PXBefoCvU+q3rJUcK20IOXLgA8g2JD0xK+m/AOsVH8tCcAZl+TjJC5nJgPxueTryiLwko4IwTcxZNdFY2m4z0703oS+QZhU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by DS7PR01MB7759.prod.exchangelabs.com (2603:10b6:8:7e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.9; Thu, 5 Dec 2024 21:19:14 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:14 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 6/9] ACPI: APEI: EINJ: Add einjv2 extension struct Date: Thu, 5 Dec 2024 13:18:51 -0800 Message-Id: <20241205211854.43215-7-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|DS7PR01MB7759:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e9ab2c8-8d10-40d4-1f18-08dd15727802 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|7416014|52116014|38350700014|921020; X-Microsoft-Antispam-Message-Info: 105GNUukKHo+N3lvx0Y3IRq3ZBTMXJ286D1SGElfX0W6C8nxX/uRzhSFiaLci7qwtbOCluLfpUGdCbAoC78k7l4+1FqjHaQxYfQc1oaOdyxUXj4ii8odVCmfskqFijGI97IXAf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ANcNttpJ8wsjmTWcV2/LsRJP0PVskmHPGOPm9/Lg5/JHmyIIrzD46YPotZJI2t/QWMTyMTgSsY9Y6niGbsWOmoYujR5TKz4f0PSg+z4JrQSTMCxxdbU9/Ak0Y89tsq3R10bb34naOjkbi6iNiyv1MEY28p5Q1uR0AxrqOr5Wk3Z7M3z4le8FnJXScXxJzOeKkhvTZdvm2UcImNed67i5mQnmhaHSMlzMtgtewsA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(7416014)(52116014)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eL2noqJYlVLIen4rBE83zFKSRRB/Q1NgTam6zYZE9CpgTFE6ZZcPVE++A16C6yIcxdISp+B9gxqK3fICqFOx6yvVXGSZNsL47YO2nZbGwkY+44yVRq2F3aZyVoIj4Cxjxy4OFXn+lKsQYCvWBHlOYFUbqxe32hRn0ov/Na1sC4tJWo53ihnYbo/+2aKwUHCqYNYoa5wzkl6rb9J0YzJ1gUaMQTVB0B57Dqo4CH/SSDVGmh8+4dlbpp7WrK6Q1N9NnQQogy7Qdjc95TV4R6ysTBuMUtqGsQ74F5pyimU65u1GOjf98lzpFO3jRJ6VgQOjEl1WumaLdAey8zsf0fjntWhnYMZJ3nxdpFmL2p4rGN1JuLgLCacVId05tpqOE8IbPK6O4Akithyh1PjaTTdp7oiNLUESY3l9okdN81dBwXJthzv9lAvPudu0qFvHgpNeniJl1IwO9Q2Ao6dwc2f5NLP/96t70ghwtSRsqy2Pz1vKWBxkeVjxSqA0OwaxjwEgUKziPjAu0CDtqobdWXSf0lehtKJysrpBw8ZkDTl5bUMEhZ9zsZBesWwc7FN5ix+2GiV1LYSiJ+GICIYYkgD7MFBczUSj3BBDuAUx+1P0aRyol5Wio67zBkDCeDG6WJWKtx3C7G2tvSWe+yyxWWoghalHQO1eT6nDPiHU5ZddClY3lPnltTfNBN0n2gphgQrw1VxVKPHmmvD8DVlN8lHX1yajLf8+VAmYm+zbZF97K5zkD9Q0MQtXra1F925IrgzXeGNAl+0aM4H6xC/uf0cFPJLje+JVuLK6eOrPZQe2BclwMx0QmI72uA92fVzn7xrUItkF5s/y1UPCvofxLUDhG7oJidepe3uY6rGpDgMNGYYQPP57pcDY67b1dCi5puNEf8KdEb9sYAUsr8KtW+XZ99krp3/I5hKAqHOXOuEiAxFKByZcyr7LSk4paea5w32MuGrBac0/bksHCXORMUHbHKQ3DJsywicjXoU1m9cMWN9exXsDw910lrPmx394rChLboeQ4nC/IuGsl8+YHkaO1vM/i/8BJjV8YMnGEijIeDB00Y9blzW9NKgViM7pPwhITcQHc89FZZ9PbgtQk4GHqlcdlr9eFH7jRCMjJLKpYKlAy18SILl42ny7WmK/MVMD+xGwHn+1f54qlFNgvi+C/xC5ZpLMr4af7Li6kmX+laNPz7IBY27jlzhKqa7Oz8TfwcrFxuSKCGRJ3NQIUuz+OQwDEI4/jfGfUlgTbcD0lMxnwL5pJMYCnqN2GowA0jVR/Pa2wK0KjWA3QIQrpRcxEgqq0lFKXk5pmnlMsm98sWOSVLwuXhwfC1zM2iDFwktigs/GFHhqV9IWzezx5AvrpIqdLEKcfzPmS3HHM+6EuEpkoD0OMUORYy6HxhdZJcvaAMcZYPhZMXalx/mIqmm8spiTxADhsxAtq5zo7bwCSo0U1l6t90tqR3KmsJxyWqvbqmITD38pBI0qtPujFAxzaAW9s+GRb4BwfaLOzudnek9SREczJ7gw6KgMgjUh9u4hdFILpY4Y7Ido2xLsiR7HwLwMKZAUKr7KcY3AnUWl68XmkeEaJiFd/S9REx27rau6/LJRjNDB4Mp5l37r+qIq6jmahCGzkm8XComUqPsf++E= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e9ab2c8-8d10-40d4-1f18-08dd15727802 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:14.2257 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WdvsLfw9FG3c3PcmszuMHju+j8xXvs3ab+DJUYhuSC50/6wYDNhdsb72csFm56KgStOPgSm5lzDZXJa6T0KJAR6IqbRSAgH2aJH+CBENUm+SHE4iwpfFABSXO0Xq4Xae X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR01MB7759 Add einjv2 extension struct and EINJv2 error types to prepare the driver for EINJv2 support. ACPI specifications(1) enables EINJv2 by extending set_error_type_with_address struct. Signed-off-by: Zaid Alali --- drivers/acpi/apei/einj-core.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 2c57e25252ac..039d36472342 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -50,6 +50,28 @@ */ static int acpi5; +struct syndrome_array { + union { + u32 acpi_id; + u32 device_id; + u32 pcie_sbdf; + u8 vendor_id[16]; + } comp_id; + union { + u32 proc_synd; + u32 mem_synd; + u32 pcie_synd; + u8 vendor_synd[16]; + } comp_synd; +}; + +struct einjv2_extension_struct { + u32 length; + u16 revision; + u16 component_arr_count; + struct syndrome_array component_arr[]; +}; + struct set_error_type_with_address { u32 type; u32 vendor_extension; @@ -58,6 +80,7 @@ struct set_error_type_with_address { u64 memory_address; u64 memory_address_range; u32 pcie_sbdf; + struct einjv2_extension_struct einjv2_struct; }; enum { SETWA_FLAGS_APICID = 1, From patchwork Thu Dec 5 21:18:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847598 Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11020089.outbound.protection.outlook.com [52.101.61.89]) (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 82E4C22147B; Thu, 5 Dec 2024 21:19:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.61.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433561; cv=fail; b=nFXs/oslkz5FzFsHPKo4gz9Y/LhYCXzDfnZVFCnGQ066tQGDrm1UGMiCmFhyYfUSD1K90DYNChZxrbllalzfdy3F44PELZXg2RQWIzonOlGms+Sa9EzJwHuE/XVuP2zPEDskxbr9QMekJI3h6XRQ4znCP/tmcXvXD+w97nnpn9M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433561; c=relaxed/simple; bh=zyvo+r3+D48XqAAqAt7stdhcoyPzT8vjQzEVtVo6To0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=CiJMMx1BJm/WWLaP5cFdjILiZIlr+M5KvZyYDc9dNYOLgxRoxby2qdi8iqYzXSa/QmOixJSFdR95iVKMfEXMTU92j6fOvSMhKK244WBaYW1dFuaVFi/nfr1eTaLvQ+h9866CSKoby3sbfxboa2Ib1qg8+PjltdDqK6Ky8+8h+cY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=m+XXiVzE; arc=fail smtp.client-ip=52.101.61.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="m+XXiVzE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=txIHbfkiIjK1uaAG0e1gBZoVL/wEJH0PiDAbUO3S5S103K5R026WoBYw/trs+W2lIUfsByAEh9lZSiQz5ETiKZI2HMFJpYBmelwrV6GkiBBG9bVrUaJzCr8VLMyQHMeAEFl3a6gIbmI1EQ3TfBm1TCyohE4LODHHRMiacswi/S1Cszo7XO7Jzvsw39lQBDGl1UgDNEklmTXtsdH0+g650BVUHkBgbclsAoQ4DGwmRtfp9fDvHQC4JtqYlmgw3wz7ZH9rsIfiaJ/RFCUN/ZicTQhNEMs8QuH7SFwkmuvX20R2vl/Bfj5qF+JxVPBZndHQ8vwzk72B4rW/STg1Jbcc8g== 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=GK1qPxfDNl1NBLDC1lt46wfRrCQnjkZyrVESfkfLdX0=; b=TlUGrskPKoHf3+D54KZZLCMnAeLzdTN6gGKXGAObHBOBeX90G8q2/Tvk1NRuaHn2+04/+didRCd9mt3NJsN7s0u+K2Ef/98UMkwk2WyZY2a6vG1yw0w+boS7YBYAjbrzEmMuKntd4JEPgpsbUQRnteg+PirUrLmERK7yAMwAsbP2mRd5mCOeejjdjThrF125KfnXqd4v5TYnNXpU2/DqY37LtwqIsDhNVO+3y/9yJX7zaROlBJbLKkKXVQ7HiDjtWPBXHtbIvIeuEv9K+VHtjssKxiBY5v43hHFg0bGwmkwa7vIIbFimFbDDxx/1mF3ywyUK4lEhbJHOtRjReXwmUw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GK1qPxfDNl1NBLDC1lt46wfRrCQnjkZyrVESfkfLdX0=; b=m+XXiVzENaJm+1be0ZYFBfYmo4Ktj1nOWdYhiCeZUXZk5S6IEHrUWMEXAPzk+OO1mpeptKM6d8ikDMVo4Fg3s1tofeq03eMSYJJFPcYyJvUK9vYKkHzT0/JvoDNTnN4aZZTntsghaAGvVf28/906TLNe+ZTkcPWFkNjipvEdY5k= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by DS7PR01MB7759.prod.exchangelabs.com (2603:10b6:8:7e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.9; Thu, 5 Dec 2024 21:19:16 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:16 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 7/9] ACPI: APEI: EINJ: Add debugfs files for EINJv2 support Date: Thu, 5 Dec 2024 13:18:52 -0800 Message-Id: <20241205211854.43215-8-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|DS7PR01MB7759:EE_ X-MS-Office365-Filtering-Correlation-Id: c9f78d18-86f1-4f2b-3436-08dd15727916 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|7416014|52116014|38350700014|921020; X-Microsoft-Antispam-Message-Info: 14UTbBBqcLNhzMnhnK9krvh+YVt0ti2Cxmb9RE75vnSYTmFhQp+/BZToryhw6AghsOEHcmP/F0jVriqksLa8yaWQoIw6NjQ7s382QNh4RybVGMz3JHAnnGHv0tVqiUod1dtQs7A8YcCQdVzOS0KZiJ9t9bNSc3uzhIUzHG+Q2S1R6VuLFTpL/JrbQxSMAffT0SQtykih8ZjPlFjb5N2Y0SmZJgQICAl1GBbaSKMiYO1rJkqztIjVgFsZmiSLXNiyntTcnLmSRrAES5sOBqQdEdyvbDS+LRAGSHnM3xIK0vYs9DpZpZcUXT2gKO2LygyqegZLC04+7k4voBW79r+3Nqey2v/TFG2idkmsHv0YXd1/teLUa7qFgi4QqGnECZYO/E71y4ru7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RY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(7416014)(52116014)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: JCv7UElD65F9AJy+z8TNbe31UQBCE0AKZLIsJoAejGedVnm3q9SuxK0vsK3QL97ehGM5n8TbRE9Gz0UYBclVRrMUJw+zObrs30ba4c1JNq6YcKYHELMsn7vG+Ng6HVM8koZwh32qYfV0vOpJ8R7ppJt1EhMhDgVImT+3ciIlxehwqXJn1qXwPqgnoBITmO9W97rFN7bvc2V+Q2I4HE6P6VHwO653tFaQPWoGH/0y3QSAx9VhP8gRlxRBEYF2OSsDkUeRFvFYSU4u3lHq2bXIRXRu94JMEEfZwne1oMVIh4jiqAOgRkOi+kGhMy3BRPLLKRxrPF33KjAK79S6b20ORPuJaO1wxnIIs+Gvn/D2qo4MkEhi3K5dhzg7S1NsfY/KM/EYIz5DTzD6CEUXoFnDjO9hdqZ9zKX8Lpj3EFWlhDTsnXE3LWPUiqzmRBfZS9UHVtLtamfzsTR23vsbm9xKjC5x+A3ZgNi4uwW+Uc8HUBacejMCbJBdR1kWf2NZy4itKMULpK10m1hLKI5KJxzJn1ohitTCHvx4bxqhmy+k585Oy9AyCm95RjyW/50GlcNl8tWcNdJ9W/Uiiycz7uWrgpJYw6hnr85PpcF2E3b4US14C7wPcAmI+YalxfPpbmK48iLJ76t+cVqUnEaL/StnUSNcY8Ai68by4p8+vbd8cttGTh3QlLfOGjjmdBO08SAVwwFX1ognIUH/579Wx8XXpBiEd1F/Di6s6atiNiY/nwnOVzQOtlB87Jf7KRxZN3ZXxn7csWaXo43VeiR7RMTI6K21lWodJQ0eatQgks7rMQStvc94EVCmcdVXgPHUk5DHCgFqPKHnyYvUFCZNhLW8XiBxMKgnLu1PHCmPgu2zZS1hOgdN47KXc7pdqcLUy8xdc2cqP69lOTSwEKo/updIGBkrXdDI3gqt2uMLakRjP35W/KzDcv3Qg2oqy0BW7enDUfh2Byoe9QHtmWkGDTHUqmb2Sgod5BvU0e3HVxX/xM/3ve4+zqsLkp7ocgXCcwwzZRNNhytcIVqmmxc/ldbsZsqV/mumSSn43UA1Ik37hI+0bs7yGuoo56pnssRJtLoO5lFcd+q0BGpoAIp5uVyCLHsyq++l3jA4Zc6buQXTfb9qrM8FG9WCc9VAMP8ZnGtroHNFaALQhjOU4V5Bak79M1iPTwpwPxszXsTRjqNbc/RNaZNqRDUblLckKNmTjI+uN06VT6DPsIYHBMCCODHl+ULIYGkdaOn/8PJfOXQauQjdw8GmASNW7kh4SNp3NrM7SZNR/dBZ8FT1HnJIzwBZj7Pcv0rO+YkQ7Jr5XttQ7pwJvpuNlr5jUqxsvPCiYu2rtC/E0ZAYzXCmetq9dcXv4jnH717eG7C9vf+FGBEWcHscqdia+mffBFPjLZUBRdxCl+5QLfEiDpU5Girp9SgM1nvSyJUGS5k1knr4daaho6i7L70RNUp+SROHlJ33uscquSQ5rjWrZMDUa2y/X2DjdE14kch9rmYA4LFrDvC/eoLGpnkp7mU9br+zlDIQnUG2n2QwN0Hyg1d4rE7gCI42WjF/dLak84NrDkvJWi+IOATOH14gL6cycariLvrOlsKUCgxhWly+OnoIuS2VSG1A50k/t8V8OGTNWOFGyNyqwU0= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9f78d18-86f1-4f2b-3436-08dd15727916 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:15.9257 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jGRHPBBujh8rItR5nw4nhOeXHYXtVudwt9mqebv8OT+b8gmCxJrfEqXa/ov+8kuEQ1VZ62G9r+Q4Of1/mash9mMM7mU8HBiGN9EO1I4YN0KpYTdaqQ5uEhM6Y3+tlpip X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR01MB7759 Create a debugfs blob file to be used for reading the user input for the component array. EINJv2 enables users to inject errors to multiple components/devices at the same time using component array. Signed-off-by: Zaid Alali --- drivers/acpi/apei/einj-core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 039d36472342..1961f140ada8 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -33,6 +33,7 @@ #define SLEEP_UNIT_MAX 5000 /* 5ms */ /* Firmware should respond within 1 seconds */ #define FIRMWARE_TIMEOUT (1 * USEC_PER_SEC) +#define COMP_ARR_SIZE 1024 #define ACPI65_EINJV2_SUPP BIT(30) #define ACPI5_VENDOR_BIT BIT(31) #define MEM_ERROR_MASK (ACPI_EINJ_MEMORY_CORRECTABLE | \ @@ -107,6 +108,9 @@ static struct debugfs_blob_wrapper vendor_blob; static struct debugfs_blob_wrapper vendor_errors; static char vendor_dev[64]; +static struct debugfs_blob_wrapper einjv2_component_arr; +static u64 component_count; +static void *user_input; static u32 available_error_type; static u32 available_error_type_v2; @@ -881,6 +885,19 @@ static int __init einj_probe(struct platform_device *pdev) &error_param4); debugfs_create_x32("notrigger", S_IRUSR | S_IWUSR, einj_debug_dir, ¬rigger); + if (available_error_type & ACPI65_EINJV2_SUPP) { + debugfs_create_x64("einjv2_component_count", S_IRUSR | S_IWUSR, + einj_debug_dir, &component_count); + user_input = kzalloc(COMP_ARR_SIZE, GFP_KERNEL); + if (!user_input) { + rc = -ENOMEM; + goto err_release; + } + einjv2_component_arr.data = user_input; + einjv2_component_arr.size = COMP_ARR_SIZE; + debugfs_create_blob("einjv2_component_array", S_IRUSR | S_IWUSR, + einj_debug_dir, &einjv2_component_arr); + } } einj_buf = kzalloc(32, GFP_KERNEL); @@ -936,6 +953,7 @@ static void __exit einj_remove(struct platform_device *pdev) debugfs_remove_recursive(einj_debug_dir); acpi_put_table((struct acpi_table_header *)einj_tab); kfree(einj_buf); + kfree(user_input); } static struct platform_device *einj_dev; From patchwork Thu Dec 5 21:18:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847597 Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11020089.outbound.protection.outlook.com [52.101.61.89]) (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 D2B8C22E3F4; Thu, 5 Dec 2024 21:19:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.61.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433564; cv=fail; b=NeC+f38QA+4OSOnQ3U8qXaMAyf/CWDMpAWR8s44Q/N9cn1CR2SN35oxKlW8e9Isy4ZDm8hXhwiLeVvU4/dHoYSADJHaw1p5/WgiTyOvOOwhWcco+gKukpDjfOr8kN53neK+g9D5tWxuxCXqhPFFPIrnA9GL7Fwwm/6WgegcQxkc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433564; c=relaxed/simple; bh=75MbbhawtGZacziqN4a8wsYv0goG9fe3a5B8ZWPxnj4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=d3X2vJ2zsItyIq7PE2yjM2hTYA8pWh2CUPJjiZYuH4m8LERy7CzX+3Odj7Iz4qh02Kftfj8m1aw8NwZlLzQvHaQs98K54LFuwbOiOXvAxXpEfy1IRqVG7rAdKeKpEzNE/zoz7yzEqQ7ztMt1UsClX+HeXw7meyuvPwEb9ylnas0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=rk4Vut46; arc=fail smtp.client-ip=52.101.61.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="rk4Vut46" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=G2a/gQp2FhimbDilLCrITzMN2G0c03YCC6hDtThz+xqWJrZpiTP4kttONNgDpfMsX9RcIn2w9cI5eJrvwy7ynJtxr8KKrIn6iS/1WSML1YThqXPt9jCaVsjAS565c/dZIZjboJiu74WwDJzl25N19E+S95CXLe0IJKnL6y/KRcPIYuZ9OhRx5iF95KiDhBiFTZc6ryG7wCxIJqQdewAbKeVe41g47wIWflqfJXysHG17IyGra800eXkvUr/qKX9dpkD0u3AYfZY9r/2ghMuaHrdH/hUTAlpsL3nvVZKwU8Hx0uI0+NiMf/KdLiPXbv4Uwpki4OvgNegLBEJw/LyQKg== 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=IFLNFH3QAqV8EmDLAB4qIre31uG6xw0XfnVsvqqC5i0=; b=u/EeP01DvitGHqufEhArn4XaYFL3wkJkojL8rSlRW5IvrCvCwkXuWp6vEYfMTfV9n8Doyw+y/vp7VVRu78Mx0pE4AvOoJLfbi3xU8aomvBHLmF2IUJjmbmywXaU1pfCWvD0ScbjS1vSIt1yTKv25lEpNRHULgiUS1CVHX+r6yD2yNe2WQbS0bhX/yiY+2wLqgSFe0byZPtaaEW6DgKuwT5jnwFMpEowP0Q1dgY53rfNlHAsnDbeYgMgbSqbciJ4o6w2UKwAhAF4Mb3BPSaqpyiQw8REwT51HP9bxg9GGQlvHGk8bWMlrNqmASSM/fXYknlLinIhpZf7DRNNcjOn1Cw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IFLNFH3QAqV8EmDLAB4qIre31uG6xw0XfnVsvqqC5i0=; b=rk4Vut46ZWEMGNYprabpkzIWvs2HPe59nGajOfS1l69/l3Sb8sytzJIUwcWByyTr0w7Q/+u93x1vFeSTrYFFM3SacA1IsyRn0A6rCLGVnHQ3EAovs1vDLq9ctK98Ih+LFgRF9OVATn/Aq4bTgZluac85YzVBjqSdS4FSfgYjIms= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by DS7PR01MB7759.prod.exchangelabs.com (2603:10b6:8:7e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.9; Thu, 5 Dec 2024 21:19:17 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:17 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 8/9] ACPI: APEI: EINJ: Enable EINJv2 error injections Date: Thu, 5 Dec 2024 13:18:53 -0800 Message-Id: <20241205211854.43215-9-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|DS7PR01MB7759:EE_ X-MS-Office365-Filtering-Correlation-Id: cccf5c1e-6d96-4fd9-bb07-08dd157279fd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|7416014|52116014|38350700014|921020; X-Microsoft-Antispam-Message-Info: 4wRvSiiOpu3MgMuFzrD1JR/cXeNG8U37CpqAP22cVr3j3/x26+ORqvugHQAdGdIjNs3C1H6JSfILQ+2YCbaDWU8DmVh6BnWOzejEC6hd64DzrXLeE0q3SP//BsZm/ORwGdawlwZDDdaQ26wMzmO6NvitrESAizJ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nnfWlzSB7b3niOU7ouV59UDUuyrUoLbJaA4TX16S6Zup+woH9MzHOJgMiTi58TDXmdSw8eI7nln7dRaXH8VIAo+UYTIFNc0/Cx6JLKUmEdIese4xQ1mcT6mxb5ozmi5gnWjXe1Ohz/aSobFSNEIbo+l2zSqcQFlG+klx/aM1A605XtRXKmcao5ZGCH8dJGgtQaH2DA0s/b+0+I= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(7416014)(52116014)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Qa7KsjrAVC+Id38kGzkPbsQlPketbVGcMQXUqQDYLIjdUSsi6XJvspp6xxgZEXL20EAUtWWJSzxIhPEWZ1QqeOlGuYgrpNJUMad7WaA57C3tHuM0lUG1cJRMcon17s6pbmyFBPTYdGU1JrT1p2m1ZoeJqGE0wEWN7AhrYq+ZrmNFQ+hLz8ByTBlsl80fxnoyPULsQMiVQONvBjtw8nrQoqRlWyej5Ujwq1eOdZutE+epOc5l7la6yJ+AawzIK2wyMh9rxd61AlmrWVt9QVuU7YtgGlwD8RtNqaTTbmRs+ZJByE4wfn3x8Z3DhKBmsCboZH7kIJjPkif2VKqNmCMc9m/hjqioUTFAEsv8dQjDiOGLI9XUohap1cjzmAvStf9XMRf0c2RDsufg3peVNbgG9253si2Iu2y6VfsglGC9b9Ga7Vjf8nQalDqMJcQlUjL78PcZUA7AoS+I3kflVJ4ecvsQnACfwSg3b9yn9MtKDtekzWLq/Av0yXIwTdbEZErwYsW1EJaDPA+yqkgwAIM2LrBZ3YVtyehkeyN469ZGmcRkSUE8O0bfQ3dMKFj9CgYCv3i7Cj+NCbchWRgMKecjIzzIa9HBFygKvF2SL8KQd9KnanN+eEavvQBOUvj52r4HYE6nxwyOBgPlwY9K8AWbl0mGI9/ynVNkq8SzD2jU8rX6ldk+OKt1k0Z0f6hGSxw7Vl+xJF7Crkq5uXFtFJouqqKdfHovF76V4CXN+KDLKHTiYWpyV7F0jQN5C37TTg8nx8WAua5PRdYkFMkU89CA2v7VGc5IY01DMakWqlqpl5AiQd+ZlbWNzTpe8d7hQ47th9eMXLXZhvBJgiN7PP1mG8NiGITnuqhCzhH3X9Rl2gQ0z30WuU4MCprIxW820bhTgQ89D0u20jxQ+awjzp9QOCNTadeJZko+PtdEismvndbG3u52dylXyyVJJJxhixvSr25HEQnsaIwbOLycfmxmAbdopoduI2SrHf/ErKMoZeEnY7FwtuVW/TnZI1CjuDlrsczMW5ScXCJddNpnUYMf2Nli6R+HyUF8C7dfnivxoW2QzdE40hNxyhDWMdJkizzCMdUc6/qM2BUOrGLZW3Cxi0rDHw5N3CcPDMoKzxG58WRU3i2n/+2czCBzLKu88TN00MG0dkMe2M/coqjmrpEwxRQbZQbiIq0crXrFqB6DFdnPt2BfOKPq0CtBOHm60RQyaL91bELx8JBdxthugPDXrCCLxakicvXh+10/L6F3+4nx2FFGzMww17pNecsXwRHD1MSKAy6kiQfsT4Sd+p/RgLFxoHYTXLsHvTpNDBsPy1wQTAMtaXikBRAhcNK6vU+vF5OgbiVGvkXEN86d8GHFLqceDNkpEbrZ4AnQsBcO4plS1dL55XrF2VaKQBlr8+WKhEj3j/vg3bPBqqDa0etBI7slorB543scmJLBrtsI9FnmnEjN4Zl34ByELFLDDHbmbV7FGo7zxqIhqrVSRDJhtRVl+vgKzjjTwg01gdmGN//1RzGOCMOktL3GMbX2A/FA4KU6Y6Bp56TIvkwHrtgihCaIEBd9/vyx1xgk4CFFLSvwNZkx/tat5tqLHgl7VC+bIfVizlXF5dWQdvFF/ge1p8sk6gmGNeMwoGT4xL2Xp6U= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: cccf5c1e-6d96-4fd9-bb07-08dd157279fd X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:17.4726 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: rlhDbLc1Xv/WXmfIIVO8OnfpyTR3/1+9LkwYZ+bB4WPAUw5eGEtV3djUh5A0vfAcPILiWgc6TiJPX0e3ojoimi32i3Ass8SDYB0GlNAxxO1nqamSb9XBdILnGjNKPD+0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR01MB7759 Enable the driver to inject EINJv2 type errors. The component array values are parsed from user_input and expected to contain hex values for component id and syndrome separated by space, and multiple components are separated by new line as follows: component_id1 component_syndrome1 component_id2 component_syndrome2 : component_id(n) component_syndrome(n) for example: $comp_arr="0x1 0x2 >0x1 0x4 >0x2 0x4" $cd /sys/kernel/debug/apei/einj/ $echo "$comp_arr" > einjv2_component_array Signed-off-by: Zaid Alali --- drivers/acpi/apei/einj-core.c | 82 +++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 1961f140ada8..d8ce859e6b5c 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -87,6 +87,13 @@ enum { SETWA_FLAGS_APICID = 1, SETWA_FLAGS_MEM = 2, SETWA_FLAGS_PCIE_SBDF = 4, + SETWA_FLAGS_EINJV2 = 8, +}; + +enum { + EINJV2_PROCESSOR_ERROR = 0x1, + EINJV2_MEMORY_ERROR = 0x2, + EINJV2_PCIE_ERROR = 0x4, }; /* @@ -111,6 +118,7 @@ static char vendor_dev[64]; static struct debugfs_blob_wrapper einjv2_component_arr; static u64 component_count; static void *user_input; +static int nr_components; static u32 available_error_type; static u32 available_error_type_v2; @@ -181,6 +189,7 @@ static DEFINE_MUTEX(einj_mutex); bool einj_initialized __ro_after_init; static void *einj_param; +static bool is_V2; static void einj_exec_ctx_init(struct apei_exec_context *ctx) { @@ -290,9 +299,19 @@ static void *einj_get_parameter_address(void) p = acpi_os_map_iomem(pa_v5, sizeof(*v5param)); if (p) { + int offset, len; v5param = __io_virt(p); acpi5 = 1; check_vendor_extension(pa_v5, v5param); + if (available_error_type & ACPI65_EINJV2_SUPP) { + len = v5param->einjv2_struct.length; + offset = offsetof(struct einjv2_extension_struct, component_arr); + nr_components = (len - offset) / 32; + acpi_os_unmap_iomem(p, sizeof(*v5param)); + p = acpi_os_map_iomem(pa_v5, sizeof(*v5param) + + ((nr_components) * sizeof(struct syndrome_array))); + v5param = __io_virt(p); + } return v5param; } } @@ -505,8 +524,49 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, v5param->flags = flags; v5param->memory_address = param1; v5param->memory_address_range = param2; - v5param->apicid = param3; - v5param->pcie_sbdf = param4; + + if (is_V2) { + int count = 0, bytes_read, pos = 0; + unsigned int comp, synd; + struct syndrome_array *component_arr; + + if (component_count > nr_components) + goto err_out; + + v5param->einjv2_struct.component_arr_count = component_count; + component_arr = v5param->einjv2_struct.component_arr; + + while (sscanf(user_input + pos, "%x %x\n%n", &comp, &synd, + &bytes_read) == 2) { + pos += bytes_read; + if (count > component_count) + goto err_out; + + switch (type) { + case EINJV2_PROCESSOR_ERROR: + component_arr[count].comp_id.acpi_id = comp; + component_arr[count].comp_synd.proc_synd = synd; + break; + case EINJV2_MEMORY_ERROR: + component_arr[count].comp_id.device_id = comp; + component_arr[count].comp_synd.mem_synd = synd; + break; + case EINJV2_PCIE_ERROR: + component_arr[count].comp_id.pcie_sbdf = comp; + component_arr[count].comp_synd.pcie_synd = synd; + break; + } + count++; + } + if (count != component_count) + goto err_out; + + /* clear buffer after user input for next injection */ + memset(user_input, 0, COMP_ARR_SIZE); + } else { + v5param->apicid = param3; + v5param->pcie_sbdf = param4; + } } else { switch (type) { case ACPI_EINJ_PROCESSOR_CORRECTABLE: @@ -579,6 +639,9 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, rc = apei_exec_run_optional(&ctx, ACPI_EINJ_END_OPERATION); return rc; +err_out: + memset(user_input, 0, COMP_ARR_SIZE); + return -EINVAL; } /* Inject the specified hardware error */ @@ -590,9 +653,14 @@ int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, u64 param3, /* If user manually set "flags", make sure it is legal */ if (flags && (flags & - ~(SETWA_FLAGS_APICID|SETWA_FLAGS_MEM|SETWA_FLAGS_PCIE_SBDF))) + ~(SETWA_FLAGS_APICID|SETWA_FLAGS_MEM|SETWA_FLAGS_PCIE_SBDF|SETWA_FLAGS_EINJV2))) return -EINVAL; + /*check if type is a valid EINJv2 error type*/ + if (is_V2) { + if (!(type & available_error_type_v2)) + return -EINVAL; + } /* * We need extra sanity checks for memory errors. * Other types leap directly to injection. @@ -753,12 +821,14 @@ static ssize_t error_type_set(struct file *file, const char __user *buf, u64 val; memset(einj_buf, 0, sizeof(einj_buf)); + is_V2 = false; if (copy_from_user(einj_buf, buf, count)) return -EFAULT; if (strncmp(einj_buf, "V2_", 3) == 0) { if (!sscanf(einj_buf, "V2_%llx", &val)) return -EINVAL; + is_V2 = true; } else if (!sscanf(einj_buf, "%llx", &val)) return -EINVAL; @@ -782,6 +852,9 @@ static int error_inject_set(void *data, u64 val) if (!error_type) return -EINVAL; + if (is_V2) + error_flags |= SETWA_FLAGS_EINJV2; + return einj_error_inject(error_type, error_flags, error_param1, error_param2, error_param3, error_param4); } @@ -942,7 +1015,8 @@ static void __exit einj_remove(struct platform_device *pdev) sizeof(struct set_error_type_with_address) : sizeof(struct einj_parameter); - acpi_os_unmap_iomem((void __iomem *)einj_param, size); + acpi_os_unmap_iomem((void __iomem *)einj_param, + size + (nr_components * sizeof(struct syndrome_array))); if (vendor_errors.size) acpi_os_unmap_memory(vendor_errors.data, vendor_errors.size); } From patchwork Thu Dec 5 21:18:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 847886 Received: from DM1PR04CU001.outbound.protection.outlook.com (mail-centralusazon11020089.outbound.protection.outlook.com [52.101.61.89]) (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 BCAF822F396; Thu, 5 Dec 2024 21:19:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.61.89 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433567; cv=fail; b=szDJFRjKDL/RBpvjTUA3U38tXXuI1AxfrL6NfSnBrqdhjhjwOBFDrYQcvbPN9X09+7BvY5pAlFug8GL+Y1Cb1HPt9S11rMrQ+RChNCALHx3W+GdNpduPNaYTwcZBmpWzWgUna9gOO/Ra1Tw6cOkmOwjQYTZTH5Q41ehDtLZXNm0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733433567; c=relaxed/simple; bh=mmzn35yj6XENSuxp//oSo65ebPMNziCMGYIxU9u/GyY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=iKnhp3CM7hO6wUiMyAbSaccM0AcYG77gJ8hKs4ik2UEsiXHCzWo0mc+VtP9YVA6ztu75b7qdwtI5MOldFSbtyRBQP3+MKrfFWU6QWCyJqlWMqCW3Mn6uK79S0O6o9sNwk5/JSkiR9D1sr7TEWTEXtX4rdrqiay4nHbeqe7Zr9K8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=CpeGqdZt; arc=fail smtp.client-ip=52.101.61.89 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="CpeGqdZt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gOdsBj2/c2VMF4x5k33nH68R4+odrvBQDYoqgWLzsuLe2lyoOC4uZ7QwbCJcQvRGBAI1O2fSCIK5djs/ubmJXtBCtWXaVDJwgPRHN7qSMHCi/bxffcFk3kb3sfQN5vgR4ZFToO1cNQS36yxeEhizGjHu9N56mqT7yHiutu77NN9VlJcEW4UhwwkC/TO1yJKu6qrnbC3/pLV1JGw9bFZumWTFYLt1N+PF9XJAgXiRrB2j4C5J1CuV00W6PpgTTyotEpDg17F5T98VxY1n/RSdUg14IVDCuBNSCvtlapXgii8+BxBM25oABBJTbm+kqJTezAUhPGYZvlLxp4mcYxqw+Q== 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=weo1G+zndL4DT+tGQW7rBSvQpZxgQHl1efYc7x6hcY8=; b=T0SiecdvnSBhfd9IyPn+jlllvxOMnafJS9olqT3ZkJC5Af7zTrlXJm+Ay5eoCVvssFY+4xgOs+iYgNNiJG0l44VwVDy9J8i8o/irAPcm3AObZ1BOibYk1SwpCJBhMfsZEtKaAmQd9i0rS3h2BqJAx14JkuVo+0T2+V1JpdRSIbIHeKNS4Yz9s06fwO+qReHZCgHnyrSLlHYlrGL2bQ/KGM72lHKZ6VU0fnV4EnpxxeTLUlD3p4ah7r6x7tu63MdBfrxTEvNptYB+tfIKDPnWU6TYV1myn5OYo0pZf6Mr4jRsGPIW3GFrNa3YC+2rBZSv/gdjGBPy8i5xi9Cdy376YQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=weo1G+zndL4DT+tGQW7rBSvQpZxgQHl1efYc7x6hcY8=; b=CpeGqdZtSzJ8JBD5pqTrhngEOtCyNAGznJYpngiA2AdTkBy7WKL4r4ZGkovdZ9/tHHfMDYjp0EauARaejckjkYyH+4O1ChTt5ppdRMStFm0/B/qTUVT/sIWOrwVC919FdclAeXoZdVaZKOb3+OQN8OX6YKERpasqpfK8ZGfMF3Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) by DS7PR01MB7759.prod.exchangelabs.com (2603:10b6:8:7e::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.9; Thu, 5 Dec 2024 21:19:19 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%3]) with mapi id 15.20.8251.007; Thu, 5 Dec 2024 21:19:19 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v2 9/9] ACPI: APEI: EINJ: Update the documentation for EINJv2 support Date: Thu, 5 Dec 2024 13:18:54 -0800 Message-Id: <20241205211854.43215-10-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241205211854.43215-1-zaidal@os.amperecomputing.com> References: <20241205211854.43215-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0126.namprd04.prod.outlook.com (2603:10b6:303:84::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|DS7PR01MB7759:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c0af457-df1d-4872-aeb0-08dd15727adf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|376014|1800799024|7416014|52116014|38350700014|921020; X-Microsoft-Antispam-Message-Info: BhSbyqmPrRyQ/OyusgW0WvZQbdN0IQlQA8C2dNGSA80kCUh26cdIhdVNIl/Sv/epyfn1ynVG0GN/9QnS1GhJoR1/25YvRPbZxoRsPq91it/L5A0GRxivV9gJDMK0cSmmz+iQ1kT6Lq+FNX26VrqcYXlvrMAbxM0SX2uttN7UGdsadzz0FuvAKmJ0+DxXBnIPa01yyx72i5CNRYeuI6uQd4M/Oq8Ts/Qm1ADn7pVgSYcmHJAczwzYQJNwhxVp+pow+LdvBKXEx1SsDoJkRcwofBaX/ttLaxnHIg49rJ5cWZura1v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Ru/0wpeWYD6I8 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(376014)(1800799024)(7416014)(52116014)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: loi45oqvPHccguczQhr18iIyh8wYANwRZLP+ZthTwKZOEI5ato5PqKuTmlXh8fRyi0A0bC2cT/TWCb3S/oYR6tHvFkKIWcVbIcYtlhm0KMzM5GSga3GX/C0bpQqoejEu3el0uOOyhvqohBH8/er09rIcZuHa4xfqLJJRyGI78OJilF4TBILTtctz5FHLIck3UXfuPsUeyxhprdpXemok5dtkxnZKCR4NhfHupiuKcYSu2Idlt9EhyKroD1xwCIcubSAUH1H/PEzwcoTEBRfmH3y4ha64OO+F5OJHNrcYEdiCcXTyW9MLsbSy6EMe6i8I7KAEigh247vR5ZHp7ehh0F/M6xyzdYL/TZ7NOnKRuAwFKjdgVcoByzcA0uYCMyusHdLRe3iJtnvDzoH2UHlLPZ/pNursPET3Cn/AQHCxvvMC7fJThzGjOw86xCxkk3l5vV+nBGgoFw2MyG9I12P8fWzV7Kksa4zUogSD8+WmJwDIIix8ORlPSeL773kbnxGOCKj42frwy7kCULmi2pC7GCjhYeP2OPY52J6lN8St1sFAoamq44TZCNZbbEgikOFXR8Afe6FsIJQsuXQ0evIySBvajum3sgpdfaB/FbzW+4ozmTzaMGV+ffswr5VpsazqXf7PiIXm1e7y5El6dwwPRMHr8rsnlJ7e8btPEhu9n5ltrA5kIUpXhOJsA8h5OLzZ39+MVGonLU/bUpCrjn68sfgIR/+hyVyE4WGnCYTCpUGh8rKj0V1stAkXDOAoBxUf1CQZ1b2qhT+1PUDboYUqmH9PwSPHkKQD9WZaJ/CbIuyxwQcfu7f/ImTNpN8eHaY41Y3OfIDaWTqihTZDFg+qz+MnR1DBs4c+UoPNi69XbbRwHsV244X3he2OkBKQz8LbcsDIGSEhwDRb82RquUDlwX6D25azis88kaxy1hSpFyyOjqA3f5Bx/7Ye47/z1XHcMGGegGncLfmMjuLSbHo3uzovTYbaODMw/biWyFDkCc0rxeUKNGelYAJ6/wWI/LAS8kIi//8/GO5aNXMkNsRW0QhxzfJxlHlScrMeiJ28Sx6wtg5ZzXahRcA+aqhEW3hHl1rvaIcpVHiNF7FWwK1Ej4+kfrjsmHFHmzWG5vZr8S1XYHg6eSpeteIGLOXSNm9V3cu/1iYPYPnF1kjOJ06Hqsytkq74o3lkmK6HybtqVUgIkV4NO3f7i/a35EfhipQz0px4Lc9IKMyLbnVlMMaf1RsCc6SzhNAi6xNcXrmFoGWSpGpQOwX3QTqSxRT6txFgTvGUShSs5hPvfv7eK2pskKa91OBG2L4gbx+ucW/lkTL0rQpqHK2yVoBdPigmBvEk7SjleBP6ft7puc6/zYbe0gxJ6EgI97czNYfWMyB6FP2GWqjhEuEy+UglGwx+9vdGNYo4vHlRqy4Jv0g1xqVF7+KaJFHpLTY+CkccsuYutOzQzO3LZkBPqrxydK65+oZv5NKNp6I730oINP1QJHpUJi2dCSvnf5kgAM5aI9n7WtXpr3mt9HSz7nD/xNjeo4YZnWMw68dug7B9go7hYR74O3Okw4p0Av4xTQn3XdoBOdPq0uzoE1/xEw5Vhbg8G0f13op9HtD0+BdN2aAniPEZkGnhqMcj9aOPlHNec55fVx4= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c0af457-df1d-4872-aeb0-08dd15727adf X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2024 21:19:18.9554 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7+Q18Ie2ulPMbuyj983yDATDMxX+nt2vz+P+MAYF+Jur8K3GEoT8A6ng6qzIax4p0o6Jva0MWmwHXbcScsemZUwFVmdsi7Q4XDOFZzt7AJRTSILsF5feH/BcPoVsV34Z X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR01MB7759 Add documentation for the updated ACPI specs for EINJv2(1)(2) (1)https://bugzilla.tianocore.org/show_bug.cgi?id=4615 (2)https://bugzilla.tianocore.org/attachment.cgi?id=1446 Signed-off-by: Zaid Alali --- .../firmware-guide/acpi/apei/einj.rst | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/Documentation/firmware-guide/acpi/apei/einj.rst b/Documentation/firmware-guide/acpi/apei/einj.rst index c52b9da08fa9..b1c0464f6002 100644 --- a/Documentation/firmware-guide/acpi/apei/einj.rst +++ b/Documentation/firmware-guide/acpi/apei/einj.rst @@ -59,6 +59,9 @@ The following files belong to it: 0x00000200 Platform Correctable 0x00000400 Platform Uncorrectable non-fatal 0x00000800 Platform Uncorrectable fatal + V2_0x00000001 EINJV2 Processor Error + V2_0x00000002 EINJV2 Memory Error + V2_0x00000004 EINJV2 PCI Express Error ================ =================================== The format of the file contents are as above, except present are only @@ -85,9 +88,11 @@ The following files belong to it: Bit 0 Processor APIC field valid (see param3 below). Bit 1 - Memory address and mask valid (param1 and param2). + Memory address and range valid (param1 and param2). Bit 2 PCIe (seg,bus,dev,fn) valid (see param4 below). + Bit 3 + EINJv2 extension structure is valid If set to zero, legacy behavior is mimicked where the type of injection specifies just one bit set, and param1 is multiplexed. @@ -110,6 +115,7 @@ The following files belong to it: Used when the 0x1 bit is set in "flags" to specify the APIC id - param4 + Used when the 0x4 bit is set in "flags" to specify target PCIe device - notrigger @@ -122,6 +128,18 @@ The following files belong to it: this actually works depends on what operations the BIOS actually includes in the trigger phase. +- einjv2_component_count + + The value from this file is used to set the "Component Array Count" + field of EINJv2 Extension Structure. + +- einjv2_component_array + + The contents of this file are used to set the "Component Array" field + of the EINJv2 Extension Structure. The expected format is hex values + for component id and syndrome separated by space, and multiple + components are separated by new line. + CXL error types are supported from ACPI 6.5 onwards (given a CXL port is present). The EINJ user interface for CXL error types is at /cxl. The following files belong to it: @@ -139,7 +157,6 @@ is present). The EINJ user interface for CXL error types is at under /apei/einj, while CXL 1.1/1.0 port injections must use this file. - BIOS versions based on the ACPI 4.0 specification have limited options in controlling where the errors are injected. Your BIOS may support an extension (enabled with the param_extension=1 module parameter, or boot @@ -194,6 +211,26 @@ An error injection example:: # echo 0x8 > error_type # Choose correctable memory error # echo 1 > error_inject # Inject now +An EINJv2 error injection example:: + + # cd /sys/kernel/debug/apei/einj + # cat available_error_type # See which errors can be injected + 0x00000002 Processor Uncorrectable non-fatal + 0x00000008 Memory Correctable + 0x00000010 Memory Uncorrectable non-fatal + 0x00000001 EINJV2 Processor Error + 0x00000002 EINJV2 Memory Error + + # echo 0x12345000 > param1 # Set memory address for injection + # echo 0xfffffffffffff000 > param2 # Range - anywhere in this page + # comp_arr="0x1 0x2 # Fill in the component array + >0x1 0x4 + >0x2 0x4" + # echo "$comp_arr" > einjv2_component_array + # echo 0x2 > error_type # Choose EINJv2 memory error + # echo 0xa > flags # set flags to indicate EINJv2 + # echo 1 > error_inject # Inject now + You should see something like this in dmesg:: [22715.830801] EDAC sbridge MC3: HANDLING MCE MEMORY ERROR