From patchwork Tue May 21 21:10:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 798230 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2120.outbound.protection.outlook.com [40.107.92.120]) (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 E5DA6149E1A; Tue, 21 May 2024 21:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325862; cv=fail; b=quHub9Uo2hYYrdRrh6B+cd1HsGiFkm1h8WCh2UOML16taKZ2RxzzFEmbOfNe/WzjszAsco1HWT+br2/yvHKkHE3GSOlvhIEv9Pe1trZmdr0BtCtfwJLSJ6uamMxzBJXyeZCSCO18xtfJ29/XY/VaTsZOb44+XgkvBEbRJBXCRps= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325862; c=relaxed/simple; bh=KdYbHmPQn0r5IN9g+9D4d/3Z4D3B2WoLS6s2/FqktYs=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ZSQIQFT5JJYEc5egSyob+Yk9czUybOn/0Ebyrb8r4NSBsh1khiYwDRnXf9m/zW2fNsENmgQoQTjnh5HVeF260jxQJ6CcyPzlof+DuvLPqPqTUzyTasJjeFaj4Ttb2j7fm6a2A8R1soTZ4Hg86fWECqopi/hvzU3JZ5iBzCJC/sE= 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=gXnj9HQD; arc=fail smtp.client-ip=40.107.92.120 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="gXnj9HQD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZCAyIKefq6VBellcxFZQWTAZhEz1g9VGMHpaRSs3dod6V4vnYwen2NhLyC/jfAqJfGLi4V+5naXTiC/31ca0exNztfpLHD8MpYmof3UnafVhhdK4z894HWxxFvcpCHbe5kLlbkWRMJj6EE5oWQEUso5Xv5hD+DjtJwBmyy9QDhFfFckF3EtQ0TS6yMAr5glc7x7wEmjiiWYc7em+IDhqxzDqHK/5k/WpImjcNyQnDv1IB4H1YhkZjr6J7DZyg/eHmz/ekgRYxjn4X0xnUYp3PfYghAoREaB3R77cL+jvGM6CpcgHBQm482AKXcFZztItZ68aj+ki1kg35suHcs4pBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=paywM29wLpewYuxgXs7op7rkpL3ktbDNrtpblXwJ0nc=; b=fvRpUpyplWaasrhTZ3d3s4DURn9SVX1EynRm5LCbQtNNft523QjgoVT4FIbGLBZcepx8LR0Pruf0rIHgZT0+6SxQhFEFFO9rQJokjoa4QPItJ4ULi4K06DmeUuq+mWrDsLfQgMHq1w+gKm+p5XCSDo12uR0/0WZESD1yTVNdg0RFD+KTrVpQP9ToiLm08uLSe1wWK2YRlfAqQxLTi6zzidhWJRsByeVxPFc7uxmhaxw4eiR4nIcVeSSZuzIVfClxD3A1j2P0RTNWIz+uGwDU47Jr8QiR6zC03P9MWZ9d8kVpvbsGd32A4Z0ReXCxh8Y+ixPvNeY9IlreIHYSXsvUxQ== 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=paywM29wLpewYuxgXs7op7rkpL3ktbDNrtpblXwJ0nc=; b=gXnj9HQDpbvmG5U9L1bBJcOvHiLgFp14psqu87TPir3rB2Mj1Y6n799VxMJium+qKD3uOpdJuCf1USDnUqLULgHyTmeMC5aJs/zU4gEfAx50ohx0jndATjxlzW3wzrqSRIyFdhGsAtW5+sh+n1tAnLwFo5v+l+QxdkypxgJLobU= 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 MW6PR01MB8627.prod.exchangelabs.com (2603:10b6:303:23e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 21:10:55 +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.7587.035; Tue, 21 May 2024 21:10:55 +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, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, dan.j.williams@intel.com, arnd@arndb.de, Avadhut.Naik@amd.com, u.kleine-koenig@pengutronix.de, john.allen@amd.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [RFC PATCH v2 1/8] ACPICA: Update values to hex to follow ACPI specs Date: Tue, 21 May 2024 14:10:29 -0700 Message-Id: <20240521211036.227674-2-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240521211036.227674-1-zaidal@os.amperecomputing.com> References: <20240521211036.227674-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0187.namprd04.prod.outlook.com (2603:10b6:303:86::12) 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_|MW6PR01MB8627:EE_ X-MS-Office365-Filtering-Correlation-Id: c1f185f3-a499-4057-d298-08dc79da8130 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|366007|52116005|376005|38350700005|921011; X-Microsoft-Antispam-Message-Info: ZcZDtA+LI2i4sicReQMHXSuyblrK7tKNLmeHoBCiXjhtQbXO1d8bg/VMW++A8kYDCNl3syHqRlVdesq4DpSnW2pDmrfsK2fC6gEIxekqYrwvDxcdXd7tjn+g64m8tLJpvgaq4AxqPbH8sg7XS0D8LctNt7GwpcsPnnIWV8yaWyF2+Cs72Z8XPPmDa3ZmCgbk+MZ+rJkGBNbLPUXwbfipvZ8D0vLwE38x6sJQyVfa/JL9dJT4rSC2VdxzPclgaRrMeLNe49TfH7m9Kw4MdkgNiPVW70CT7c0zyNKsI3nx37aaAzZy7DPbwurfypCoj+yyqFAQ4fkNTRmZHlddZ9llakW9+KOU2RFlLqf6pDsGKTledyxXpC8Y1c2y6Zj8M7OigqOwgFbBkYJbKRyN22b2iEE5UBQ9KyGMq8Nq0ROQmbMali047r+3ioGUbg/+q+k3jD0bawHSb/Dpd/912SdpMxIWtUgtY6kuCDFKoRV5JTOvlYM/T39MwIpxcygb5zYcn+uTJ3dS/9TVZ0JR70rzWRBBlRiVDlfZQ1giN44epp8zor8GxyKvRE6/n7dUHtCajuGVhfhnAudDO+5Z/K4+r2krpRaRDvnwfzMFoew9H7Mo+Bt0GHjqZYD1mKnmV8lODP0VzCB/1WM2qJDGhSG8z28S8AJ0PhPCDpbpyB9LVx3VDYepZ5EVfrJrY9l7IA4xaU5JTr3rEXkEsPoBXb1dnx2jODsIKFxjoUhCa7X/fMGEHU4JE8OJa/8wrARjoHUvFR7D/Z8MneqCcT3Xk6d9xRI1ex1lFJWPQs1AbY//A9HsDxEW2t0aS477U/ytqhkBkLHOL5iokkXmuJJTyf32ydDAcX8QwRHjUCN+1AWp8ejzjLHyr/GzXb5iPaJu5qQmsBfVWJTrsqnS0xtNMCJOUlc9e7C47rSUsoWllopMVuCX70QFvv2Gvn9FYxLw/PpijOnyHTGsC99N0mW+5e2gXkw9ZfBN+mnu80WRlxKNwOPqUK+Z9hzd/ykq6YVwOl7SG2QJlcFCwvoZ9leR+63sjScpi6qTiOhRPybKxknWdyRo81xoApGvCz8Qd37osbHtsMrabPguayeJ3x1Q2BcWfmAT9zXzufzuPVK57OhCXi8w+N7OZ0gbK+xzu5Ejj5BtdTQbXkykcFHVdGY7vnr2DZdkL43TA2KnP0tdwxf4cc0Yw09ASFXqQBQGy0m9aeE7AFodVJcDjVi0QH/fSiJlNR+zKsrcEetRyWhtABWvcgi/539oQYoAQcdMH9gqA3qmvFpW8M2MwA81hucGZaFcctJCuSjVB4IVw3kRmqdNXWo= 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:(13230031)(7416005)(1800799015)(366007)(52116005)(376005)(38350700005)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSp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jZK1WofLjViRFLd2BvnwKDDhdSBTC+77JimrwNGoJcOcmnrVVmZhAloDEc7wZknyH8OOVK2j0XQWcxJWRTdv4me/JviSQUCXeVCr/ZyX9W1LnPBiyQ1DBI7w2nePaExz/LSFHYcYWjS5fiGirRdMPjz1fvZiYbUbPCGCs0XjADXgpmNLt+pKp+3P54e0Se7xWowiD6G2wyRHUmEhYmhEAqwG35wJa5ErTSZOkUQbgh9IdgiMoIuAGS6dkYf8CB2wB5PyJz/xNOZ9ElXsuGVmZ/MCqMPfBHsiEeB19PO/rL4acBhg2Ia/Hq8kddzNgnuftEAxRV4Ryd3HDt+8H4q+z/KB6Vgdcx7AWKUvL0BsvRIcwObYQxBooJcUlLVivyPBC5xl0kAhztR2cfeEk3Oi222dtsSuLIS51f09N8beWi5V202863mewfVRHJINbCh+8vCgjIGfDl4mLhxSguget2W+UP1fIJC50xlp9GC2tFBSfwOVLKTJeNQFvUnNsXE4vvLLf2owB1LR46Oyo/3lLXrnljotR72X9RMtXR7S4XKOMCPoJx2fxnP+1J2gUVG4MP72qAvos5x4eqg8Gap2rZF2mstGb/wjV8ZEmCo= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c1f185f3-a499-4057-d298-08dc79da8130 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 21:10:55.8137 (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: JBdjdUf1j/balEDDIj6Ze1OdC+3zQAjIUjZ8iT+ynYpW+lqwWFhI9+rGaS+mZKUxKJiqWCnOjjMPFe9hvVdJsvp1NykfS41msP94MNPW+wpg7OeqkAJl56occlDTYhh+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8627 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(2). (1) https://uefi.org/specs/ACPI/6.5/18_Platform_Error_Interfaces.html (2) https://lore.kernel.org/acpica-devel/20240514184150.6285-1-zaidal@os.amperecomputing.com/ 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 841ef9f22795..b321d481b09a 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1017,18 +1017,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 Tue May 21 21:10:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 798002 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2120.outbound.protection.outlook.com [40.107.92.120]) (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 E782B14A617; Tue, 21 May 2024 21:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325864; cv=fail; b=NNNeuyZV279tzutCE1i55M77+VHbv7Hlk2/8TIVKkHLaczMl1Dq3i+j1qw8KsPW2NiKkf0w74jg/7Uz7nn/6OUvuiU5ONXjbcW4iXBwYHB0Q5Fn+l11TiQP5cmRF7jY9MU2E40FCbhGw+Xze9ytKnCKGfEmDN5rijs1wEKSfZzg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325864; c=relaxed/simple; bh=PBtmXRPcHhJ8QTun7ebiAxEzdc6Y44RSGtRrez5j5zU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UuMgePLvm43hpB7b8Wq+5CQxSx1uyhFT3iJ+tLCict5qO5W4IfFGMvFxdeplMkXI5j44NnoTgeBfcSOjSlKRnwaxfbffWYdjjGfvnaI+2Wtb9IKngXwJVDea7aAzZxpmxj+oPLmS4r7fyYNZWaetoJQ2pfziryU8LE9DjlGODhs= 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=ZKYUYZIw; arc=fail smtp.client-ip=40.107.92.120 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="ZKYUYZIw" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DCM31qBQfuSYvLyku1kiBZxKiWpZouvNsA/WL5430d2ogwN+mMWVhCK9B2OWVFJFrMniZKVI8KU87bMAHIxHyfchSkR+yEnqGL5+a70uKjMgahQzVYuRzzL5sWhFrB06Sp6KEkCzuGlpXB/7LQKkmn0K6wsHuKsi6ZGgo7etrPh22vPnCggXLSMmHHk4Gk8yXeu5CX0n5cPmb7ApJJPbkyhmdEsAIBYuRHkawqqqCzMIoMqjRExoZWkM0yuYNmCJYTnOeahrTXrgPAN8rySBCO1Y3ANyGrFCXaD8JPD9OIQ9p6gG8DrBgPbJqS8GC2UYcrnTODSqreJp/Les1yzk7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b4foFUEueSBABzFcfkV68h9/Shi4TGvG61dUWODqFAY=; b=lTrJ4BGsGXoRjuSonmTAZ+MESv1ph7bVGif/ckpYRir66ZKUHK2eWNNrSk2erwd7EZvU4Eo8cBd7FHjqBLY4qhl17CjhvLLjcecea+VF8uadukwg56TePrr7meTi3zQ9Vlgql9DWyX2MG2Vm76QJlNCivwyOajc/euu4ldrazkxjHVTxrKE2cARp0rIThIMV/dfeTJYD5D1OGysCGtoyAzZz+mmA0l8E92owVWb/fBKUe+tvKVmpJIfc5WTuiC0q6aQjLHcTKzBTUvq73wjE20vECPgc0iS2XozTkmAEb2pm29tZ09bcrP//Ooibp9YENhISsjlNi/m9qJqsddpnWw== 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=b4foFUEueSBABzFcfkV68h9/Shi4TGvG61dUWODqFAY=; b=ZKYUYZIwWD5Z+5uc7HQEfnqwmXZDh9dTkudEw5D/YK1fm2oXv7Qi42RNG0F1eap8ANmLO9Xs/1JZR2OBQ30XQ7RSU0MvxBheHB99YGgOxLijlw43GUHbx5WF0QxPW8sK+pYjwOT9MGiBR3tL84bdDTx5e0rEzjF9ECf/uLTG708= 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 MW6PR01MB8627.prod.exchangelabs.com (2603:10b6:303:23e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 21:10:57 +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.7587.035; Tue, 21 May 2024 21:10:57 +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, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, dan.j.williams@intel.com, arnd@arndb.de, Avadhut.Naik@amd.com, u.kleine-koenig@pengutronix.de, john.allen@amd.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [RFC PATCH v2 2/8] ACPICA: Add EINJv2 get error type action Date: Tue, 21 May 2024 14:10:30 -0700 Message-Id: <20240521211036.227674-3-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240521211036.227674-1-zaidal@os.amperecomputing.com> References: <20240521211036.227674-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0187.namprd04.prod.outlook.com (2603:10b6:303:86::12) 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_|MW6PR01MB8627:EE_ X-MS-Office365-Filtering-Correlation-Id: 338fd137-cca5-4803-a178-08dc79da820e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|366007|52116005|376005|38350700005|921011; X-Microsoft-Antispam-Message-Info: rPtgsjfc+GXDtZIm2SwstA/ajYOXGesXjphwI6mcwUWkXeXQMlBW4zn2jZ6yHUGKFCODQqZpPUoTgrHOuPiA9eYtyaw3tJi1xjbu2NWK5ISruD/I0hyJ2WsC+dN0fz6gUq3p3K55urEvNayMxwFZ0W+PlrkBTR97GwSpMxtH430A339/hKnDyaqFW8dV97KEZLcVNswrytVHMtHHSEOoIXjRKbmKKZ8oaNSve/ugWu253SXawWphZxji0bkXjVA0Wci/peJnFOQTDJ3dNV3lxrNEAH4Gyc35121NGDCm4aOC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CL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230031)(7416005)(1800799015)(366007)(52116005)(376005)(38350700005)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Jg1TINbj36l2orD7NZsX21h5zpAxMxsrcDdvhAV4UgwKAINstyAzI0M1TV0RW7oGjAcmezSAlC2NBFypAqIbJ0duR/hnG52ZitxWrfIokjcES4udOUlYSY0Ts0I+bF9i5HyT7FmJZEF1Aa2e1yOWo6iDHmTKMlS3CMtK+RuocNVN+8KvS7tKr6fcgob+96VZ3hN5xqaohyVE//kB72tPhJ++wStdiuVJKaMdJVFcd2ItxwQje6p2Dx+uuVJz0FmEXn1PKNbnsJ4TOrHcyCOP9qzRcAIDf2dsguQXA7OtsE8j9JeNj3ZaHMkDJmmLQYnaiBA04RrU2ZAVlqOg/Z9c0nLYaKVw17x1F37l6TFqASZf8WbG3jEKFAiQJ2L2Kx9Qv1InkVaLt9YLpAPUZCPxjVG0qOEXfxH6S9jPDgdOyadNyrRouNHt1bWCLpq1tamH8tvZ1lvuhfza0ZMXfn/UIrF2j+OeFGMtaKtgSkB2QvjE9pg3AsXljmxDYmEdIYVoyavdqXd/MACJfn2fBlP+prEhZm9sa/p6UgRnGj8RQRUJMYho4iijGTJM9r/4OVqYaq9KC0dZX/lSbMAa4kfvUQD0rPJkT4T/zSlrOg2FRqlgLYE+ZGz7GAxunOAGWLle/nHhTDYx46o9NIu1AVLr8znWtjlScwSlVx85nXl8JCFT/1WT223rS3NfiMQHm4dk5mfl3VBfyh2TTvSS7Scj3ftXdiypWIXO7ksJZVuqiM7z7olHJLpEOmzt8Gimdycwgd3q+kX3UIFR+AEh6M4xhAgfqrfb8aUrE04JArs9TtxJekivhVx3BSQJQXj7Z9uX68i2cDndyyEezqC7TLJ9WQ2ltW8sW3YDj/OznvlWSeOoGlRDtpYknybYA0RLxedJZJXZ69AW+8N6tgw7ZuhercJEEQqYKsodQg1MvoEKyGuKL+fqyt23ryDwR1odOAQSbtwoy47QJ9B+ssIJnmlGHV9vlUC0jOIrbKMf32DeMP6UZRARtWcuM43vnqjAvI+qNTBd+Enet98ncr/IO0Ehzmz0WnebrvyteNbBNltOjyzfi3sL2rK/G6ayMwS0iuxeL6aY33cYQHxTf0Ll5jm+zAW/RLZhHX5V75KMhOqOHSF9Wg67g+6mORSLz2WqbygfWBtDWSMBd2NLALurnPnJazfq3GBVcxaIMtMIH39sjIXjZjOy6pf3zIhMIWYcuUuqKKLJaCzzI2uE5vr2aAQAVWakVpOYDKXsql9Ds8KB/i2e+fkarztH2d1MqIoA2gIT9TfWE4lZ6mAWPf8Z26X8IYfepgJFXC8Oz3sWBBZokCa/fo6LW0J+wcWEbW06bAYrOswGnaH3amKcJ2uOWmBq+Glgx84pQCBQZJxNKdzKb9TSHbNSGzDbR3QpTMfE9M34WwXKJT/pXPbuSSuAmFJV4MN2ggh+hxUNQfjJ509zXneDPQ2UMzqtBXBuKfmdSFe5211qtxlqk/9EZYTOJkqfn7eCgoEER0N4WwV6J+wjnUusbBO4Aef8VbFDQ8hRbbOweFTL39u7gau28cHIXJXQkNyW4MNXl5ZQWOptsOJpRW4AHxZMR93kqMRbw9GrbzcdGCKOwQJxg8MkMTQDcW+KVKro4A9Mw6Hl3TH5FuvAwI8= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 338fd137-cca5-4803-a178-08dc79da820e X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 21:10:57.3398 (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: tDWp05Nz6VXaYlgBRQ1KS1QW0oL9uTVNKJyVeM3weY52W0WPnM9+6ou2BKzLbeLeokdV/gJPWpnO7ezAHD+NEG8+BopWciJQQuW3nqwWAE0l55g16Y0oL9EANfNmQxVd X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8627 This commit adds EINJV2_GET_ERROR_TYPE as defined in the proposed 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=1446 This commit is not a direct merge, it will come from ACPICA project(3). (3) https://lore.kernel.org/acpica-devel/20240514184150.6285-2-zaidal@os.amperecomputing.com/ 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 b321d481b09a..35a90a92276e 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1027,7 +1027,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 Tue May 21 21:10:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 798229 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2120.outbound.protection.outlook.com [40.107.92.120]) (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 DD28B14AD22; Tue, 21 May 2024 21:11:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325866; cv=fail; b=VqKTRRZSJTFZP2q9dqgQuXry1+Nqvuimpl/0QU3SHHW8mhpzcDqXjcn9aIaGSY9K+pWJ+cDHjekNykxqZ32G5L5mJRtp1V7F7udrqzIf+m2F+0Sb6qAlUaGe6jv0z5xpco6m7buZidA5USJy3fSCC0200yhM2vdVYvxi/mQleSo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325866; c=relaxed/simple; bh=uq4IcG5HCUE6QdyCtbz4oaLKnF3G+5PpH4r1x4ry7mE=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=BFeDUp3ijmi9gzk2gfvTSrcIZmaF/JX0XGTSEASPlyUJ+Gu7viLN3cccpPKe0+DE2pScOK/OK5LksX/d5yfZz6JG/mekHWJwPo68JUtKlHmPSu+sbOPfgNZpFZxjRXOSyqY6ASoXZXqZwZyDeyBN6EJ2H+GAWNRpCe2Bk2zS4V4= 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=IC2O5HyL; arc=fail smtp.client-ip=40.107.92.120 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="IC2O5HyL" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SV+2ey1qVQJg2+n74RL2+vxnAKtuvEohSLq8KtLx/gVbO+YyI+Dbu6HJ5xXl7uDOQ28ao1PfozehTzm/FNiEdAuFrJ7Eg6+K96rtq/TGE/+7cAhUBOMPOIcSN8Zy73LbHUj/JrE5ZYKN4nCp/3dbqBZvzHwBrHw229jiwi5ZfiYXeeNf3bvHgtVCEwhZrpzjBwa50rbH76Oq3lbobA4oOsz9ieVMbtvFdxlrDZlWt10GoUmrafdPj2+KprQuF8kZzDCy1wcG1FzYcDHzBTvDOB7FyaaAjrULtYOmF2E3cdi1zMt/JkZ/JnJrEU/UOlJXOsHarg6nYS4FJO7vaW9qWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cwjgzv4Ksp5Toqvjs3j2OOVbu3Qc9B3qpD9jb0eEpIg=; b=WVzGmeWkl+I0YrSEgP0Mye+zIXyD6lo19wkfdTbz8Ygz2kaASkCT02y/emHd2p3fa6ghPW0jGFAapkZOI38opSUmQ57BlJfFxN/QOO360yGkDM99AvaD4zNsssoqVQWT5WwM9SAzWeD83qaVgel8m4oJOiJfZqmbRIa//i/PZJ59CSOLrDB9zXE2pVG/uB1Cbs1zK9qNw4aF+XeMVvJzIKOVquTaD6LwbMjidzQHB0VjKwZl6cMSiXoT8vcnpsbpT9x78xGDnVK8tuY/xXa1pD3O9JOsFqWC3HJ2g/DxNSPNlN8REI3Lrjicda9iIUotItszdSpDyyPnUpBIw+RG2Q== 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=cwjgzv4Ksp5Toqvjs3j2OOVbu3Qc9B3qpD9jb0eEpIg=; b=IC2O5HyL/TUJdLl8W2OhpVSmgqDImni7pFWI40ZP2Zta3M4/WDuxh0BiarpzDXEdTxDFlYmocagEDw2KJw646qxYN9pd2sbEEU8CL8ibBnC4xKqvWqn6Wyr1N2IgA3ScsuaycgzqWyerqHMGsmfk4Fufi0rePp3qK9WGilxbshw= 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 MW6PR01MB8627.prod.exchangelabs.com (2603:10b6:303:23e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 21:10:58 +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.7587.035; Tue, 21 May 2024 21:10:58 +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, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, dan.j.williams@intel.com, arnd@arndb.de, Avadhut.Naik@amd.com, u.kleine-koenig@pengutronix.de, john.allen@amd.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [RFC PATCH v2 3/8] ACPI: APEI: EINJ: Remove redundant calls to einj_get_available_error_type Date: Tue, 21 May 2024 14:10:31 -0700 Message-Id: <20240521211036.227674-4-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240521211036.227674-1-zaidal@os.amperecomputing.com> References: <20240521211036.227674-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0187.namprd04.prod.outlook.com (2603:10b6:303:86::12) 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_|MW6PR01MB8627:EE_ X-MS-Office365-Filtering-Correlation-Id: 4ff43bb5-8961-4345-07f8-08dc79da82f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|366007|52116005|376005|38350700005|921011; X-Microsoft-Antispam-Message-Info: Tb+bNbfhamn2r7c3cCktcPhfvubbPGG83EwUrSAt5STzNV9zGzZAT6dNW8Ynl4o3V2xRVd9nkOiL5M73gzcCeEn2h8kMAxc8j7aBL1TesqhD/DAqn3cq6ixtrJexEdxXo3v+LexYn8ex2QB+WaFIs9gYWqprKbXKywdb3ZtVsjnQKjQWm0WiLC8kjQSQJmA1R4K4nD4zCSc/P/witW9ZuI/I9xi5Ml4AWBaFKViQOMgEELFqwjb+JzGR4FCqcZQa+o/l53z1TqZgOqXRe1J0ry6tigj5n+Knxj49yVpUuwx7rX49af2bombLkZwp1m2jfPxldNlSqmd7OHdkaZhznxdO3LsOY5qcuK6eTvdEme1coXdx60eRFGH4RaqsNt2X24Y4R6680rTnl7zl1HxIeAih3exo/6c6iTEF6R3I36WWAPtJW/OMaLZioM/rSffGmimykafE9ey55d7rR2n6x4Rbdz1HFl4k3MxfWNEq5no/oAe6hSuDnm7H34q2VMBHAmRNapUBv+OKbMm/UjJHU4DyeSQAygb/GEcSB5XMYl+a9TmaQChdvwI+TuhSMxZi4n5aoiDfQksKx2ClA/PkuLxnAfLCLiet+pVK6NYLY6fjGPqyNCKqpNhqtJRfZdlB+vicFW7KXW8CfuxCdJWxgqhMH1WqYCxGVdlySbsips9jMXi1Pbw07PjBUaS7QncN67H5c8e5i5syLbAvFENwgbxaLWEneTFob1J4Kbepw3r85TSC2MrPz11K5syBsfwvISBV/utojaDmKD4NJM9AUopXuFhhZrgscbX7o7CZXyEf+Nw7+mUBWmEovBeAztkirOXVOd1+49GVF106wq7pb3EJdRRH4W4hefkvfTh3hHPpZWrqpdd8F3cxxmoGGg7J6Xx6PWHla/a2yBUKGdEKvCpjXIlTBYrYOvZPNzOmQT4D65Jv5bwK2tkPAZMlY1lHMqiAaWoub531U0ri56DCuCrBkA01ckqRJLCgntENscTjHL/BXZVh3bRJRB7w9XaMYwJb8F62jb2TG1ApcA3Ro6nMSUTrIEWsngg6HT2eaAX1U4WHdhUGaK3K2+aFH3Aus3d1f5smDhTwnXvCYkqpG5gjzQMtkHgmPLNNXiAmzuVgtQI7gh6SUZwMvEK/7yleARcU/fSB1NS3zQ3+as0EjMw7O0eWfGkSgV1DEscYNfMovdgdzNUyOvWxf3e0gOFH6eLIBKrXxk0OhLSMlZP/nS1CvWLTBNDx+Hz3Lx45XcIA7EfYHgVgA2VaTXh0bp/pcnkywTtQRDXpBheby+WWGfuBc7ZeUf6zaoPnftuklmVOG2F6s6lSMpraAh2kotTkIKg9WWlmQe29EhZtnJq1F71oQnXhzCqdCE9GvEmd334= 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:(13230031)(7416005)(1800799015)(366007)(52116005)(376005)(38350700005)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Lg0+DXOT6eZb+ZZaYhkLirVZvAGnOqU0hEidEiGwbLN6RURejCbJO57rQHSEpaYa1g1mj+xh6JwpWBhPDxy2IVqAPpscEflcGu8vDXs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NWLmlqpcoLatpgf8Crbxy3Gx4Ix6/WGPbx4U3Rfb1tj+3SN2msGe7dxir0JN/lXK/eHu9aWXjZAD3Ijze/S558FgyGV05R+ehsUnqFqUM0vRpFBfQ6QqGdc7zlKvRFX7RSngPyUwmZjSXkFH1GFge8XJX7GnaduflC/j5F4BtHt2GBZEvdPF7Jw9wU1i7zYWXkeSCMWHydiU0PLYBsZCWpDufL0Kq6yj2FdFM/QS1rQTRXZO/oOOHFvmMrjYrEuBbkWcQaYuigVGjU6fcBAx19+MOm5n8NUCrx+FO2w+fgV4CfMYavjfSPEIaGI6oLmu9FmwTY+rR5HlXlPQVPXHughKseQt8hXmNoYG7l3CqunXEbPLP7IUxCMEH+2TVlmw7lWC4MtCPTxsNvbWln29IoQhNAdF8Rs6ucnAsAF63dXEqSe4dv3HuJEEHhO/RRW3d2KDJf6zWTqq52Cw= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4ff43bb5-8961-4345-07f8-08dc79da82f5 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 21:10:58.7904 (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: YF33iHZj/8X5TE4rKsI8AtO7vgsxJKaOv38aBd7MiVIXIEq9qeliMNqMF768eauM2WbPlTw5hvKOub4cJkky1zA83bGjumEYkBgHt6n0f36g6wA9WQZs3miLNrqclofC X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8627 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 Acked-by: Tony Luck --- 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 9515bcfe5e97..b1bbbee9c664 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 @@ -648,14 +650,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); @@ -678,8 +675,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)) @@ -695,13 +691,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; } @@ -777,6 +769,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 Tue May 21 21:10:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 798001 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2120.outbound.protection.outlook.com [40.107.92.120]) (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 F3B8E14B094; Tue, 21 May 2024 21:11:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325868; cv=fail; b=Hoa+mepW3koLrss4/Zv7Ay7uECiffZI/+iMin1GVXDWWeFCkvTMrMdcnNIe0rDhfiq5kHl3WyvWI9VMewvbPszi4GOSOazIoMU8TKhUzyMVTamhvD697MHNKSGGeVy5ZyAAUGcK2X3MKFKLbwn39u50/190v96YR0ebaxCtvWXA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325868; c=relaxed/simple; bh=eH4bs5hw72vLV3DW4bCjbm8AOR17nolv6dF4AeNrD8s=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Basx9ALovmz9Ijg+udEVAEn8UsvI+KtCpXFUFdBGGwhKGcja24Kl3t899L7MF1oNGiRQCCBgOapPfNpnHv8KL8CqpSi4GUn+Ox1Z2yhHNLCsgHXlYwuCdGifhIGHSiJMILI/v6BnLW1o6y05hDH+F+kCagDwOP0vIDgMofRbRu8= 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=lsHaM4uP; arc=fail smtp.client-ip=40.107.92.120 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="lsHaM4uP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d4U21rnEnZXm+0HJdytW2BU3BW81ZHPC8NxKi9vaOCB7mWfQKR0myXkbtII8vmYlcyQ4LQuxBKsVvy1zUcxyN/CVeBrHGnxb5f4iEarO4puoEsgDDQW6mGg7LHGVAAzFNNYyCOzYXZhqHHyndeznvdsc/nzB5uLEQLcXT0Wg8NoYQauae08UqZt5SyzuZwN9Mkpu0ZJERCsSaHbWSUy+gdH/HuysW+8TMQk0fOzEbeJ2aUa14cD/UFiv13KWAM/L2U4E6bNnGqjDlVpJ2WJRGC68gvHClZbjN2BTz9lwjIhoQbOH85C0oNfGfyVXeGiFMFUXier4XBxsWz5SDrxNBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CWfHkAE1FxrGrsWlP6B8OPhEEiZWMDnw6UGyw8od9Hw=; b=fePhwJFOg90qtKyl2xLRW1rAvC8yj3xDqiGvnWSO0eyaMMMce+3t35n8Ss1ZoEc9bUNRdqRJAWJh80CvoxoxEEriJMLvgRGheTDO5yjntbnoa9zueu4E5r4kERiUXG5L/1upGPolRgNPIXdRewUIrLnXHHJpnlDrQ91qcMdtF9owmJYpXLj8uXmCAsGvnvsmNabzlXVJ3t9zB4ONkw6NFy+1RJvwQvO6Oe2hyAo1z7foEXmzstNO2Uf0qdaQcBBsHXSdBCQnwolXE0KFPEK0i4tkg0XLAXfOKHql0v4DdKh/8HgRzJgnFsQAt9XTwVJLWYpGg3WizGU8tQJi1DZAwg== 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=CWfHkAE1FxrGrsWlP6B8OPhEEiZWMDnw6UGyw8od9Hw=; b=lsHaM4uPxe0NA2VZsqrXWjrBOtLCbH4/7MjXino/s8qiVVtSlQydKq6q9/ZugQ0sZRUMddg0Qve2ygEMHHyjghbGDqVb9YP3wph0I8UR8ngqIEwC3+70TpVTtTsakkfnCDPSDdpAi/zHdlQPg6PVkZCy4hEaxtq71kqo8gaDkyw= 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 MW6PR01MB8627.prod.exchangelabs.com (2603:10b6:303:23e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 21:11:00 +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.7587.035; Tue, 21 May 2024 21:11:00 +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, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, dan.j.williams@intel.com, arnd@arndb.de, Avadhut.Naik@amd.com, u.kleine-koenig@pengutronix.de, john.allen@amd.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [RFC PATCH v2 4/8] ACPI: APEI: EINJ: Enable the discovery of EINJv2 capabilities Date: Tue, 21 May 2024 14:10:32 -0700 Message-Id: <20240521211036.227674-5-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240521211036.227674-1-zaidal@os.amperecomputing.com> References: <20240521211036.227674-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0187.namprd04.prod.outlook.com (2603:10b6:303:86::12) 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_|MW6PR01MB8627:EE_ X-MS-Office365-Filtering-Correlation-Id: 9e04e0dc-d303-40c1-7172-08dc79da83d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|366007|52116005|376005|38350700005|921011; X-Microsoft-Antispam-Message-Info: EZdhg9Unf5R17QsOiuYgCD4zd06Y7OAe0g+FOIemNRM6j+Fh0CS8e4kfGLujjs/aDdNFN3U3M3si705Vk0RBu3WfI5V0mEJXxE9GziP5isB18yYeGutyMnYN/xRuVxgARk6OKTtnUoX8WJPIFH/AlulVMPF/agDWIq1RbIhWt3jx77wgYVSPIf2KXxygyXFgQoQql765Ii8Wjgk7E9hB1L+9tJH08ETkH3tY8PaSqAXRJhvBczbqfP2fRUjX9/swMqn5dcoJrKKPUr7EAEdOe0cPwpSxaI1li6Bv8vek7nlNwmZCYeyYRx1hx399E5Gib1yREJX11EukGLlZYyF5gW8yeIceKTHkxL0hMU799ZL5ma4wiyE1Fgh86Fzk3ukr85nUsOD5Gn20vZvLOdO0hHRl/RCAbYNwaUUi6tAYQ8oOap5lZhFFe781xGA7lLSX43HaNKlzLYIwmzIm5u2B3R8x9sPXrKHUw3UcV/U9P+v8yfJPDM2QW+Afkw3iyEz8GHYrbleKwuI97cJXwu34elYeVEyRB+4Y3LlYtT7ORFbuhznM21SPyVWepC2o2BjB1SqQ/Qt7qlkLFjEtOB/ed+HcMuH+SKz7rkJvhgbmJUshuAH/4iMLBh3gWO8bi3U3K9L0hM4hzw1TTCDlBmQVbAizRrd/V6wBnukyOeHYbYk6zHs+8lOQGH1PAsQzq3n1fLLLTk/3FePryrz3hG4cEx76eimA6UyskHjKWuj1RyREcidQTwLMMhAjW9bVhsaKYcgu+zPlyfvrEQUUBlgyRW+XXgCzQePReqSX3EAeBgxk8dTOv8k5bjCU1fXM4NKlv5mfvDPdCrWboRKHHkKtaOLcHeGhAGu4WRJjaHMvq3ZqMauUdHIHZU/va4evSdDFy/K7XUyYTpr3V2iisklW+mXP7sFd2exOFl11EqhMDLdnJpK9AvTX9ir5UeqxJjG5JIuGcQCMaYCf66bcZu9YWEwNpsvlTNV/G7yNvbu6wrza13P5jwvi04ILWLi1oSeDlxKOOTkWNQN4zMWbzyOzfNsz79mE9xfU1mVgDkMK1k9XT2oqNoHLbH9f6o645SpRO2g86KIg8QRbEO/2GnMdiwsdAuU7gtjduEqYpFuwW3TW4pq8Wd0k7qO7JoD1xfqqCqz5sdNPg0mazjj3Daikthe58FEI9Hgaut8FP8GdL41icRsTQxA7flmiOiX9/qhNfIXKD/GvPBHEUwWQKts62axt1orphcrOwRtI1p7u2hLyz63E5anD1g3ZUzVN2PDoyRInfnGxijEjNU94p9UxUZFF/srlfWmw0UdfUKXFTR718LISta5tnHRHq65FpMVJeWDoIuW0ki36IBVpxUkSp7fXkgL6dA9bJWzeHed1Vso= 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:(13230031)(7416005)(1800799015)(366007)(52116005)(376005)(38350700005)(921011); DIR:OUT; SFP:1102; X-M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JbPJfMwE6p/wYD/DdVGzYUFvETCxZdskaL49Nqn4b3ym+XR8V1OE8U0y3UAdGFlHBrqOQNGsWnvcguv8S7XEGO6mbNRx9xYUYT1c2vNwFEkyi1F1rRNnsG2HCy83peKyHytEtnw60y7/97U2jIVfRd8gxD4dvh3b1PCGRPJGwcMOz6XDbfgyuJTgCNI9/TfwgoLI58vtPnCy6qN9TC8UJl8chlSAjZ9vlFTq84YoADU2ppEvkszIqrU4CcPjw2WTMzCbmb2mEXUKQ0gYdAq+lwl2OddHtsuiyfff/uDo+KZxWhu2J+APOlmNmEClxgpZEcojY4mPdvHa33RyJIf/d7K2YU1NGfnrawuCNKZAZmVVQ31aZ90dXlPenzrisum8ZhfaWTmFb1VKXfST2l4IGm88GMEScM9il3FkrwMGFfyRMIQnFTFUT0aXR6K6DZVoBcXzd8BADKRumQjbQK0WaIgBqZI0o9ejVyMd8em42IAb8y5W40I4CY9UB7a67yJha345C9ahAlUpRdcpXAgmkpFAt8hGOvQZuavL2oUs0z6yKyeL9yhbaWo0EQKppsNludOYIzkLnZkSVbU85l/jNhICn726StDl+P++ynu950AhPU= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9e04e0dc-d303-40c1-7172-08dc79da83d9 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 21:11:00.2615 (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: 0tnFjKtvhZiDavVCfsu95ScgQUSVWUrKJMj7ojMBKTf8WOM+CCcqM7jzV1eLZCJTKV9ok44HI6HvCMzLa9ptaJbusnNX7k0ATRNWVv7KKNfp2A3W5ABtibYPh7mAsi1G X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8627 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. Signed-off-by: Zaid Alali --- drivers/acpi/apei/apei-internal.h | 2 +- drivers/acpi/apei/einj-core.c | 35 ++++++++++++++++++++++++------- drivers/acpi/apei/einj-cxl.c | 2 +- 3 files changed, 29 insertions(+), 10 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 b1bbbee9c664..cc5ad1f45ea4 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; @@ -647,15 +649,27 @@ 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) { + seq_printf(m, "EINJ error types:\n"); 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) { + seq_printf(m, "EINJv2 error types:\n"); + 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, "0x%08x\t%s\n", einjv2_error_type_string[pos].mask, + einjv2_error_type_string[pos].str); + } return 0; } @@ -692,7 +706,7 @@ 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; @@ -769,9 +783,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()); diff --git a/drivers/acpi/apei/einj-cxl.c b/drivers/acpi/apei/einj-cxl.c index 8b8be0c90709..25adc9b03d18 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 Tue May 21 21:10:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 798228 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2120.outbound.protection.outlook.com [40.107.92.120]) (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 21F5014B943; Tue, 21 May 2024 21:11:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325870; cv=fail; b=q5M3dyQ/IyzUTVYASkodQHl3/kK9q3Rfsm9WESylE+FWSrzdLCHP8PtJLZZqOh0EsztauH+TNVg52brrnMW1MvSHy4thILzmrTbACQOCVmsx4M92oGWfPmu8FpYStvDaxgNIqzZfLnDDB9H09qvUXh5c8CKu1EMZQZeM73uSLAc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325870; c=relaxed/simple; bh=+d5xcI0Ilcd8r/y7RedeJ9DnaU14cJBRP1qcbPJh0+E=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=hCZyHcNtDOZjxlDg6qkmk/8xhvqupGW4eIvwKtY7KDlOJyPo94NPiTyhGvxryXh9t5KZqK2QCqn0CwzKtc2gyHxygWN1Tm/Og/HgLJLnQn0QQ41hkPwr1jgE6/iAuhEo+3SwJJ50+4bxwBN9WNHhW5e30K5cJkGsabAtQtBGsIo= 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=eoO0kvF3; arc=fail smtp.client-ip=40.107.92.120 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="eoO0kvF3" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BbhTIeCaWvoZDgkemAl2kKtyZXyfrpqgcxZSDCxTrLxdhBthUcxdGFA5sDaiJuxm8vPglf+3qoQqejZgiCk0mZywCM0I7NB4uenJF4/hiKlXZ+2+AsrX+lnZCUCTc1sZJaInHGtLPR7RuDRxUxHlVng7ttaThAASJHT7CjIgqq+/X98wnmXuuvWY/PfciJLlPjHlDKvuNJetfXjawGyqgJ7NDXMtSNb/jC+/nfrl1gXbKwbcei3PSH+U4EG9M8JzG/fYxTqkHNqoA8Gf5Kwtp/DsD8tJuPi9Q4i26ZX67GhKo2seJRuZBcFudP3kQEC9HYVhpoWhiz0aRIgidkcVzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=FgCBw+/T2xaPa3/BxR5tMfRjnio5A7CpTBjc/NzfajE=; b=f+PchoNba5lf805oPEx6+COi9+EEgvKS15doFHgSYuvlw1IACL8QHdX2hH2Br56RLGN1TpHwGdXE07Uxo7rPR8YGx8tXiD6n773VcrW5hPsbiX0O0qsR5PP3oO61CscNe/YHHsbTiAkDOPfRaYMjGaAhvBVMn5t9s4kSXeLIsMTuu6lHNEoY8P7zgF/g8TeEwkw/ftXFMr+MXC2KIbs8GX2nzH7VX1eqv5+Vriq8a/js0LvMx81OnMhR1w45Oo7mfY3h0rM1+oT4B2bnjJsHPLKd+9ZLtgeoGOq75g4EU4zMWVnPSRhYqQA+ipgcFC1VMOrV1/zIltn59h4rD8TwpA== 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=FgCBw+/T2xaPa3/BxR5tMfRjnio5A7CpTBjc/NzfajE=; b=eoO0kvF3KJInwtbtKdGQWHBlBTy6Nk0CyiELXbR77GLOUVIA7pOijEaI3hs92dUJxLWNW6SGn+QEzs2lvdKHcRrOITGgEWGNJQ4nf+y21LF5pDmMdDAEAVf68spNmZLo5w5M6M/cQqhzqHjnel60jTazGfHmptRgpaBVdMFUmT8= 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 MW6PR01MB8627.prod.exchangelabs.com (2603:10b6:303:23e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 21:11:01 +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.7587.035; Tue, 21 May 2024 21:11:01 +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, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, dan.j.williams@intel.com, arnd@arndb.de, Avadhut.Naik@amd.com, u.kleine-koenig@pengutronix.de, john.allen@amd.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [RFC PATCH v2 5/8] ACPI: APEI: EINJ: Add einjv2 extension struct Date: Tue, 21 May 2024 14:10:33 -0700 Message-Id: <20240521211036.227674-6-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240521211036.227674-1-zaidal@os.amperecomputing.com> References: <20240521211036.227674-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0187.namprd04.prod.outlook.com (2603:10b6:303:86::12) 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_|MW6PR01MB8627:EE_ X-MS-Office365-Filtering-Correlation-Id: 80987ad7-2364-4a3b-d56c-08dc79da84b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|366007|52116005|376005|38350700005|921011; X-Microsoft-Antispam-Message-Info: Rk4IqrF+5N3sfSXqen/W11x0Ostg3zszO7hIumErOsRnE9tK6fRsi3rQIJwMJjrr+2FB2BL5u999SMncf8+05R/D1p2ZkBWYKeoW8SpskI7r6XaI9NQzmU+W6Uq6tH22Hzie9SbS/qzWOme2Dijd7zlTWXB8PL1oYM2akBjwGfRliR2jh4FuNEfxTsaSHxiBLsFhj+avd2+W8at+wx4ALVv+041dyjCQPocfNWPtS2cGAgNulGR6mUerclgPV2kCP4FtC3wmdcspw5SIIx7K9mXb8dLWWA+SlXevw5Vv0UOwesqMBnDCe6U37u5swHRS1/8S+FEe9MyU61QyC08FxedJP4ZT5pppAyhUqyAH90PNqdx1ko7HLfmW7VsSpF6UlhTy2QQ5sQfGE0ecUDDUdzEKJmUBFjGihP7QjPhRjtAYkOTwwHh4QTsVJhKiWsJaEnlwTJFkI3GRbJZzup0tQYHmyVk4DEuQaKXJEzE/QSJriGrc81RwKYxxzxcn1A0e0UWQhD7sQUQmfXCieTnFIfgucyJYS6nq3Jl3mhObNvAhjq8CUT6zkkwxZNynMMTLE89gdxGAZCXbYOfZvKuLIwSvRsFv5Nd3EDNoqSX1s8Wqdmvff51gfDRv0y2KA4kNWIdJ4Gc8lN4LzUIlnqUHbGtkF6F98h6eminSORVvp9MJJbNf1Bpo3bbSiDuatJVISahWDCFCTE2wMNgGk8W6xOrceInjf4mnKHR7RfXGv5pOQ3nnSaNd0t9khTG6c6qr3jrjjo9pIF3bxqHNRwmyKE3hjBue/6ujMk9wyggfy/Ii/xzEWhVTPANLaZ52DoDWImtakgso+13PIX2/a3lfG5P/sG3iNK4r1uLui3v38qCeQhyFEtaRbiBKuYc/yTXheSE8yjM4FjxUtCM2r+KTKLTPl80A3s9RWYfHvVWsPDoYjucPAiQrRiUo9WtEbPZyF3gS3IJE/icvDX98Ipqg31ayx4z8PL0CDpQ1gx17U4p28HIZ2vXzmXkTzXQhiRYsBVXFdWALJPSTh1akzySy2M+xYVmI/27pl/kF0Iy6l1S43GZMR5ei6cPqU2pdEFBQkkQJtRxXUffZzSUF613arh0AcbGCgUPcO3dUPhMrG25HMeyG/v+FM0SoQhOgfT1JmhQJwnPzyyODMflUPXiadDmdNJzV7g3KKv18ERyuRv8+I3GwcNUNzZ7PCSrNZDCNMuzT/mLXDkYHRQc0z5noVC0UiIaLh5EUiZ5lfOurq6A4Qj9VmakGMOiNrE4x/rF4Rku/I3EVo3SNV8OvtLGnvlrAYXw+IQPBCvrVD94dQRQnhQPaW6SGXLf7FHnnGK3D6Lp4L+b+59J2d+rAtlsPOQ== 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:(13230031)(7416005)(1800799015)(366007)(52116005)(376005)(38350700005)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ao6Bc9doaY8M2HelZoDYNuZgkz0DtQzj7P+iXldLYbM1IRMf4JpRhLLITf29E7fAhXxeLgdiI/YMplewrhAgoSFBhm0d+WBzRx4gYBRykjDbaayK75updFtOnVVQqVflhfK8njmUWhxJoQU3/PL3dp6qTn/q7S9GphcIjOqOO0apFug8qCBOWqznxDL5yfz31mXJCUpTlDGSA6KJF4FA5SuSghjCWqnjMC4vYcJVCmqf/85yv/qB4ijVqCcNmB1SRffg5oDsXjYNBS4Xz+n/vhJM9kA7mHMSpM98Cs202FZE6pSPmkVl7iAWpjbJKwjEHwc59FEC0qADeheN2FAZB6pfEkckrPkgVurB/7au4dl07tR0xbwmj4g6KYB3GdO/JfLaVB4bRFTGqiJYkfhHEeic1aay5bSoeWS+CRVvAR+WR1s+r/TbcriS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xdE9vaUHqxxL/xHkP56UmuzUrQvbTseWjUhXVU/nuiFr3kqeudcD65wBMMAiHixg5v0wM283rrgV6+XjSa0L1ZZu+1GT93dJ/AiEZq/ubQdExo+zrQZ8mFsHLrjhbOY5J8KPqa4LnhEe0= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 80987ad7-2364-4a3b-d56c-08dc79da84b8 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 21:11:01.8037 (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: IBRbTqLiE9GNfFLOLmxeg1gN3vllAYwVvC+b2ID1K6F//GI8lg0wrINKEmrD3Oji+pHLPNWksHi5x+jhL9EyFQk4FqXz9z4aepij72+IQPyiSkJ2sKGPsgQHUhBRf2S+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8627 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 strcut. 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 cc5ad1f45ea4..2021bea02996 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 fru_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 Tue May 21 21:10:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 798000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2120.outbound.protection.outlook.com [40.107.92.120]) (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 06B8114C580; Tue, 21 May 2024 21:11:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325872; cv=fail; b=gY6kfy7wQQadOdoT2LM18TEpEOFutQpcWN4zQoUJfTltBb5jEJvp+s1PtFQkAQAGiQByfh+OSLR2sFV/6lfkQkGNbKL8xo/NZE43IWcA0N2VBDwG7JjIARk6+ruzYWL9vwgWv8RXtrrwYKMZUNH+qokUt10HBaCDY3TuoEhnG3g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325872; c=relaxed/simple; bh=pn/AwO2rweeEgIbHvSwXspfFwsfPelMopfV+CFHtqkc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=F93kprxWHeOKp/Lj5TNOA2n6H7mnPzsRhjsc4SlvWrl7QkQFSO6YoELvfIPiBSr9fF1wZhjnf0ciYOAH2tcsjeTie1McXSuBeNu9WnLOhH9sAmsoRFJTgaB8Q2sH+iwyK7CyPOuutgjrzVe+bvvTLGQH/Pd/7x2/qc1v43ZHrHY= 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=pOiDHUwz; arc=fail smtp.client-ip=40.107.92.120 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="pOiDHUwz" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JhbrQwYrvzvVtxYTzMkD5IEEyKmDeJClRMKamRyklnMQriay7ajGjso5Oxp0QfosTCQFhzvlvpMpK6EfThI3sj23HmN0vfDCpQapXNUG+ZXg2/aQXNxow60PlnS3gkJRP6m0114tm+MQ7vhaQ4Enu0PjROK4B6mDtJuzYSbTFjn9YJyxpl+w8rk456rtaOj1LeHmaIhLXRQhaqVq3bWj3g1gtwamvl2AZuXoQDrMqoEzpmYVaITyiIp3HmkCa4Obix/VMr6WMjD3GV3v5gVOWTbWk53Rai3aTcf2Lq6wCcSoXK8B3pddUBTYxJUK5Ck3VuRAvuFoayq/et2b/wBsqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=pDpk5WkSbUbdCTmSLfJRqaBqSuk1bwkxJM/n0gnz4wE=; b=LUZoR9UqEN69z6YRUvFOlil2G39tlJEuUnn+VWLES87rOGHWMCVxqF1xLE82WK6F+7nxU5LS9ZfZoLrOSW+gK+xV6/g4wpRWifRb4qhKfrToKkR4Ph66GZ09TKq2kxYKohIWnbAO+wOP/dmpgSyuydpMUy5i/1lQUzh2FEvklwk7RrnsdE5U7WfEzhkP692qJzsAKQl16x6MmsY0gsnjhFDoFfysiLe27dctJCb0MmejIOpnLvhH2ph3Q4VQTAxenOk1d2Ljr/VKuC+UUsBF5LttCHQZ/OixsemACAT0hv/K9nIoncc2+O4WYqI2MgtGSyhikJeZNE2bCpjtloJosw== 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=pDpk5WkSbUbdCTmSLfJRqaBqSuk1bwkxJM/n0gnz4wE=; b=pOiDHUwzKFjxcn2oJbFvA2YsI1eLLWtpHb0aqlJYml+kO+8UQ7mZ0eD5VMIf5OkFGQ82Y9gVEjMp2kzE2r0xZItqYwCEHTmSZ9wWgiunB0kMka80vjvIb5XW4YupCWqjWDvyuS10TaXp4gjdH09QIHNclnENDdHkPR5lM6SHHzg= 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 MW6PR01MB8627.prod.exchangelabs.com (2603:10b6:303:23e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 21:11:05 +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.7587.035; Tue, 21 May 2024 21:11:05 +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, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, dan.j.williams@intel.com, arnd@arndb.de, Avadhut.Naik@amd.com, u.kleine-koenig@pengutronix.de, john.allen@amd.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [RFC PATCH v2 6/8] ACPI: APEI: EINJ: Add debugfs files for EINJv2 support Date: Tue, 21 May 2024 14:10:34 -0700 Message-Id: <20240521211036.227674-7-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240521211036.227674-1-zaidal@os.amperecomputing.com> References: <20240521211036.227674-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0187.namprd04.prod.outlook.com (2603:10b6:303:86::12) 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_|MW6PR01MB8627:EE_ X-MS-Office365-Filtering-Correlation-Id: ec2c3762-cdc8-45e0-d6c8-08dc79da85a5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|366007|52116005|376005|38350700005|921011; X-Microsoft-Antispam-Message-Info: dFwYLX3ae1ObLBNOZC3fRqNaALCfhMU8U9NfwLo+U1lz/xxATQ1S4S33i6HoQeUWYge2IRl7lONJwPrxCg8unwFkJQ7+YJmKKd6cZajAqiP1pLaxb8Ong3YqNYFjsWh0C8KlZY7dGeObQdYleM7p71+feVMQrUprJO35UjglfK8GLeWRSz4h8UWZjnqs9WWu6QDg3ljoHF7L9iHXJHdMDmGPW3jMuX+DYsKsnI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XKAK4syFlbPJkRJ3yM1X4TAz4ZFm9NwFxUMjqRsYKbF2WM4Lzh3BJGB/cM5x/uzs= 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:(13230031)(7416005)(1800799015)(366007)(52116005)(376005)(38350700005)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 9sIw4V3phj5KbWMVmxAP2Qq53m0wMg1IMh41MHOeGE5Dk8YB6kMICGCQi5Er93ba8TO9pjjp0rOaJ2T+CNk4fLQij1Tjyfo36dqgJjKfzHJ5O+R5L0/ym7t30lupUFyibtTp6oBnrkjMdOpfMK+KJjZJ4LfzqeQrRt6mZI638F2d27ys5ulB3Fs5WEcJGONbcrokA8bw4nCxijBkjHLkNRGEO8dB8sAqU2PssjoINL/ZEaPDA6uBDEVKJTp0sAAwDbJEM3M09s/1i3sOsN1ULZk1zmqrSvCZRELtAPEHMhIaLNOvXIdd9fmPeqtaOKkMkm98KuxLaLYGBL55wbSZ9+BkR3R7J1WYMjxEU+48jh74mhvtiLnx35MAdXCzP0smbRSTiv6jW7vL6rf4Lsj3c8cLAMieG3Afr1KSrEDrg2uDcUwso5DmP4JH1b7v6LXb1FnHYgHcdsRzNT/tFN4rJRP5xYkyoK37qyS5X076YQaN7a1f8tRLA1+GsNnaYiZua1fkQ9pwgHa35WLhB7S80DOXyL29PqUhKp6ZLy9E17j1vUWbgyqvVZ5+g0hPwsRT9DRkwQo8MJ3cgkL6qNUp++jp53W+lm1SLbuqhhYikI1deH9IMvMj25JsX4da6sabjkEs306PSPM/mufkOPJ1UbbTN/0b5WhqlVk4nzzoKEHftwxQN8q7nzPikJxg858DYM/nGzyYjj5uAe6JyQyWaMYcybuYzA1sobfn84YFEya3P6KY5di47PVzofCm9nlwNZX5YkeQU3LykRP2uowjQINwL3UWt5Phim/MLhthjy/55v3D+lViVN0LqHAsrtN6yxhSCsaXZPTFmRqIHxZOK5Re3SmrUYIgaasTrRLZ8GiqboGRELuSobx6F1IThzqRoIWWJt+JpZuNbZpaPAd5AXkw8DSa3KqPlHOeZF0ZntZz1pd/PxnDajX9bmpCbwWl/6yrA/tuWsP1XBuwn1rfiCfF5lD7s0QZFqhCZf2NwhWZYiDNXyfT/mNaFDULdYeuajy4llmpqcrOGfkP8mLBjo5GylsrRrr1NtjVIz21U+j0vDTY3RKls5tAWXeTVyzomS1d0/gCwYpB+iETnfWFTi/8lf2QtswHEGPs+OoKfdDWfZqhl8+SnehJIfWoMa3CBP7wwcPhGzX0A09DT+efJAe4YsPv/ny6dQtRTkWKMbrLFfdwPPFrVK1WSEwkHRqdBng9M+b+BTZugUoVr8bL+UCTnFMWZufGZWQj47eMjYBvvxbeNiKTdJYZJoRZow2+lm6c/UZyLp/1b1Dhj9qmaglDyRlSrSo9WnUYwlovIHYy1+TiKhGSiy3hfFgmz16gNjzmZoGAtdegcG/f7rpv0UhVJCUVtMBu1fF3JvbuPgTiqM8Ns4PsEk5k90JkQPaJeWPqS7p30ylU8YFtc4czXLqEJO6ZuU3oFKHyYYz2ApaVbsQOEttH6HufwpnOHvQ4VJ0nCcIG+ZwlnlRxch8ZHKjafoSNXaOFV6G7smpt4iOHjlIElD551INYoYimUaogPVifqIXTbEpUBPit1CHUFtOmhNlhnoKVOgrUWSVjhwvIQoC5YfqkIZzKtY+o7mjUxhaNSdXCw1mEs1380fGYp02TVla6MjVjFwuSTKwqmtk= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: ec2c3762-cdc8-45e0-d6c8-08dc79da85a5 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 21:11:03.3382 (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: l0AlrPHx7DHrJf6ne4DWeN2hk/6Ui1bnvvn+Vt/JbSeqE9c/zPJCz2xpR14dpiOJEdG0XlRI3ZeEUFqNxiPJg/3u8xt1MPN7ZKhiZXF8sC0m+ctD9J9hXaUI/vwzIVDB X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8627 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 2021bea02996..2e30ebed079b 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; @@ -859,6 +863,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); + } } if (vendor_dev[0]) { @@ -908,6 +925,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(user_input); } static struct platform_device *einj_dev; From patchwork Tue May 21 21:10:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 798227 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2120.outbound.protection.outlook.com [40.107.92.120]) (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 F2C1C14D707; Tue, 21 May 2024 21:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325874; cv=fail; b=fstbFM27cj2tgHe++60ADoZJK2vpH3aSw+NrEqXg/SEchtreDwxpn5P+PvvkEQOykVHt5RbTCP+HIhYMEECiFJWartmwaLssjFQjxgUl3kMlr0LS6P3aQcLXXTMIPP8zjY9VLYVLqaIHzmHRe3aPrCb5nLCAB2Jh4+7RIwGsSWI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325874; c=relaxed/simple; bh=X90Dls9d/qSnBn6kxi3Pa4EPRPQv7KQu8SBBUU1H8v8=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ScaqxfP96K041tgJaKs9c7pMSUYKaUkhi2J4kPAQlwUtI1GwwTTT+EJR81Im2uLXvSuDStj5/t1juS/VVDdCmBvRLcC1dPkbZ1qrCUanzMXeoVU6WaQWJqBOT36vEUFHlYW85re1EjoFSz0kXOIjCzaJ75mYsUc/e+b0A552xFw= 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=h9Zd1dG2; arc=fail smtp.client-ip=40.107.92.120 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="h9Zd1dG2" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BP+BfhyyNGpshb5z33HMBUIaoEG4I7Tp2G7bJDmODkzGGo62/O3Wq4Wz1ImhXg4B7XgdP1V6hgv0Ysy8418dhvW7pU6S2W2jOinsqviqPmoEJBCHo/iEXAfYD1VParDqNe9SUaM8oUtBOdJji+08fMuWVdCxk/8EJk3BK37IXDkC0TgpFYoC/Z5xIkBYjDxqsG1UnlUHtM1inFQ+q9mZej8LTZxosweyFWU8bJcy/Un4SdK4fg3OcOVEIuez8ZayR76Xp8wAYAfSY9RB40sCn95bVz8TMk7D+5q49KlPtaWy4IOlVnzgf32cAfXXYBluo0wqK0o/kSmKYqy1rvvQdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8SPdbPUe9w64Es2ez5yiZmgOAj6YhjODK0L+oylcb6U=; b=CotOUbfceUJCCeELZnBqY6Ky8jdJL6PXR4Fyeq56JxxXs0VMT0g/J+TAEqpjNmGkm24VV5cL7Di09zmlnu+tbOjFCXjX64yi2c/lFzpArS7z6B/krzQSE2BAOP4B3IAJ3bYwNlZ4RWpK8b0PJvd4WdkhZtqwtn22yGN04OqFJ0ZwwyCl0SJPBktJKQ/0jAIULMEFgJ807u2g0D5HlNtXs0JpPNKtDgc1DFRBLq/BST277hIk8ObP2OrazLkraGj1EJGNIgRrF3ionYsQT5p3RPPVrovv9TBshqv1Tahunyax46k7Jef5QKe8yAcp83Xb3PMe4peSm5cYLK+2j+6Xvw== 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=8SPdbPUe9w64Es2ez5yiZmgOAj6YhjODK0L+oylcb6U=; b=h9Zd1dG2oGESzYvLIKFIswyRBR2eDKT1ami3c0J+FYqk/cbiwbqzb36y4E4AZRKyBM3+kTtxkjG7LwGyexzhTSAIRkkRC6EE35z2A65W48bccyoC8Ojgf6R4smWkJvNtvObyzmBkaCwlOq1ENCYATmYRPLqE1PVLAYTxc250NCQ= 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 MW6PR01MB8627.prod.exchangelabs.com (2603:10b6:303:23e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 21:11:05 +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.7587.035; Tue, 21 May 2024 21:11:05 +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, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, dan.j.williams@intel.com, arnd@arndb.de, Avadhut.Naik@amd.com, u.kleine-koenig@pengutronix.de, john.allen@amd.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [RFC PATCH v2 7/8] ACPI: APEI: EINJ: Enable EINJv2 error injections Date: Tue, 21 May 2024 14:10:35 -0700 Message-Id: <20240521211036.227674-8-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240521211036.227674-1-zaidal@os.amperecomputing.com> References: <20240521211036.227674-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0187.namprd04.prod.outlook.com (2603:10b6:303:86::12) 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_|MW6PR01MB8627:EE_ X-MS-Office365-Filtering-Correlation-Id: f66b2658-166f-48ce-7e86-08dc79da868c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|366007|52116005|376005|38350700005|921011; X-Microsoft-Antispam-Message-Info: jT59qP/57p4KcK88dcs8MuWkRFcMcvkZiX8DBfB+rUkYOjFfc9INcp85Dd5/isA3hKPyd74hjgYr5V/WYoWM4rx0yQF79sWjfaCImxxwQARwRlHTBKwcO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ISz6EdbmCx2zeTQfbFYlgiYKsmF6FcPfcJgpJWO36wca+Xrg4Mm9xXXWQaBZ5/BxQulNIhcQDD35ZvB0tJiSIUx5Pea3qHb8uXH8cMLk/oevPZSb44rn32N2YnROD5WthtTsMag91L7a1CRMjiKL0MtJdoptgOUdC7ZVPawo8Py71O4xoebLbddb+h52b9jie0= 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:(13230031)(7416005)(1800799015)(366007)(52116005)(376005)(38350700005)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fxqUZgS3VcDgUyYvswWqFMJfRJrDusR9+LS7bk7LF03RhjAgeNDGm4KUj/EERTWaXLgoMMsoEjJG35KfQPV8A5DNSoNMpunP/9WzDYIRs8aAsG5TbqACaPZG8Mz7z0yvfrl4g/uiTJ5b4tupzWEKfQPfXNueofqbnmDv1Yx0WiCiuU3PE+ziRUKndh4MJR4sTzbOYDeetxZeZbxBEVwK6bpBm8CeTzORrOLrwGchROzHaVjKxv0/8NkImmegrc+Dzv6+glo1lOLxyNCac+614ebpkK3huwDsugl959g+oV7KU96aAJLQeQYVqfHO/ul8IEErRBjGLfQNCsdoXIxrqhqeGxN2/7aIyXhkaZuVaR9dqZ5Y0n0tnxS1bKKZttzjKUTYkSKGP8F+3SIcN/DIFRUHf44Kf/gTyjLx3eNKy1SzFTINVG2EDsNrqvix0qXlfx0tK0Qo6VszCudcBh7l0ZTfV29av2ptVZ/DSNenZeWSNIlKyKaLDGqr83Afut5cF9UbpPZmmtWFHLQjQBuhrjM/ph4JaILec45gOLkvtlJtMub9LSXLXcF7jpjv4ZLy8rx1dWL4HcYgA9w5zRCT+x6ROofaxQ7IbABzia5JhQsxGOo1jqSvXxNy/nJmR0oZ+5clmLs9qhCO2YBl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Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 21:11:04.8198 (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: htvPcXSRZX+icyLlzfE5o1BE0z4B/f7s6kLrsyjxZZQiyHzi0056yCRGCkXFJlJxpnltpuq4NKps0N++p6FvEEW3Htqn6fDGnnVj6lVA0zThwsyLOYaH0mnGFHJAGgxj X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8627 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 | 81 ++++++++++++++++++++++++++++++++--- 1 file changed, 75 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 2e30ebed079b..2e5c00b34a4b 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; @@ -287,8 +295,18 @@ static void *einj_get_parameter_address(void) v5param = acpi_os_map_iomem(pa_v5, sizeof(*v5param)); if (v5param) { + int offset, len; + 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(v5param, sizeof(*v5param)); + v5param = acpi_os_map_iomem(pa_v5, sizeof(*v5param) + ( + (nr_components) * sizeof(struct syndrome_array))); + } return v5param; } } @@ -494,10 +512,52 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, v5param->flags = vendor_flags; } else if (flags) { v5param->flags = flags; - v5param->memory_address = param1; - v5param->memory_address_range = param2; - v5param->apicid = param3; - v5param->pcie_sbdf = param4; + if (flags & SETWA_FLAGS_MEM) { + v5param->memory_address = param1; + v5param->memory_address_range = param2; + } + if (flags & SETWA_FLAGS_EINJV2) { + 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) { + count++; + pos += bytes_read; + if (count > component_count) + goto err_out; + + switch (type) { + case EINJV2_PROCESSOR_ERROR: + component_arr[count-1].comp_id.acpi_id = comp; + component_arr[count-1].comp_synd.proc_synd = synd; + break; + case EINJV2_MEMORY_ERROR: + component_arr[count-1].comp_id.device_id = comp; + component_arr[count-1].comp_synd.mem_synd = synd; + break; + case EINJV2_PCIE_ERROR: + component_arr[count-1].comp_id.pcie_sbdf = comp; + component_arr[count-1].comp_synd.pcie_synd = synd; + break; + } + } + 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: @@ -570,6 +630,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 */ @@ -581,9 +644,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 (flags & SETWA_FLAGS_EINJV2) { + if (!(type & available_error_type_v2)) + return -EINVAL; + } /* * We need extra sanity checks for memory errors. * Other types leap directly to injection. @@ -915,7 +983,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(einj_param, size); + acpi_os_unmap_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 Tue May 21 21:10:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 797999 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2120.outbound.protection.outlook.com [40.107.92.120]) (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 0A3CB14EC4F; Tue, 21 May 2024 21:11:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.92.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325876; cv=fail; b=s6TzLFK0sx0gO1XVuehVtfkih8x85DmgMq+wwBlz2Eu5WJS2qulFDbK6EmosYxbsIltbmz+yBHTqU4Mz8GMsFeuE5MirI78S8soFK8k+uP53pC49R0P+D+e8FMvjlQLyZ2kf1btYz5AC8JI7wYd2lkTH1GjaGlGuYFob45ElD3s= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716325876; c=relaxed/simple; bh=+Y0C+jXMR3zm/uBeSgrAXMu/Af8xuurmZK3k6rENf40=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=UZqy6QF/kqLjXKqUxtsOaL/w3cZazlA1jhtkbvjstQQGwPNO3Dk8NwppIewNIuBfzUnRaNIB/drY7BU2O/8uvA44GmEYvgUZ8xA6bjQLTOp0eqmNOv9HBKaIh1YUJKJPTgv2S0GdCUO96i5z0CydY9Veaa1PH7EI6v0SDcizqSM= 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=MWhx7ZI8; arc=fail smtp.client-ip=40.107.92.120 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="MWhx7ZI8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eS95xuh4+q27Zm3qEfRzfPRIeYZRNrEmFd1sZWPfB+Xj6U7JN+HVRQk1g7qwx7s+PWHUD+0t01sG7yazWdw9c7wfaxB933YhUWL4XUNgW5r9WL62og+JlkGqJNh8CD6HWPqBCNGtXUM6BXGFn3p72wfQA+0x8Z1WkZvguUkHOA1RhiGMsR1ukMrkH0f7oNbpS4PaU+3Eh+4lpEBDsPy27LvviQOd7XsgNDmVRxPt+ghcNpFfHvxlIy+zWckVIk5B7UTYSbGo5D3w6iFEasV+4XoLK4R8CPcKgIf/j48wmtcDjndrjLm9np1jmiJvtSocVP3kd4Vc74vxhMdSG+C/IQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ba4/majp9gwCEXlY6qSxsX2dXjHxs+2H+BqN/OQDXgE=; b=b/gtwHUKaUI4Zak9eUMlxtJ06Az1rbJPM+GPEyl0o1Pm0cgtlt7aXyHWWiwCrAdPobFaVV2U54FBVg4oEqeUWIYknc3/wljUGMfJ0zS1k4FW99B7iK4xB5CZZHMsg9/xuSH1KDxZx0KeSzfBweYlADqIvI4HMYUbZql24TPrHjQWJXJFTBq0HXvCoDQAg5RdAZCNOSD+We1eWPWLADnchiJG1bcGSg2ZYjjlMm41IiADTgaVOu8oU4IU2YaURXd4vKhPIYPBBdSGjKMwa/HH35SPcMrng8163BMJqK6VqqClBqFk3sXKAcySFulHMwBuagajDi2Tn/7IwQCNu4m9TQ== 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=Ba4/majp9gwCEXlY6qSxsX2dXjHxs+2H+BqN/OQDXgE=; b=MWhx7ZI8k1gevJyV0LBr8jQBlWvTjlaeucS03Ywrpjh4Fr2/DwDt+F/kZU6s+fqRuZLwBFrfmhTLPtkXVUucOX4xRXUeCzmvV03y3ZNFLdpRLN+wdQB9qI4us4Zev2Cs87BbZx5JUWEJRAfaMJpDmFj738TbIx2xhnivPXfX2zM= 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 MW6PR01MB8627.prod.exchangelabs.com (2603:10b6:303:23e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.35; Tue, 21 May 2024 21:11:07 +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.7587.035; Tue, 21 May 2024 21:11:07 +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, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, dan.j.williams@intel.com, arnd@arndb.de, Avadhut.Naik@amd.com, u.kleine-koenig@pengutronix.de, john.allen@amd.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [RFC PATCH v2 8/8] ACPI: APEI: EINJ: Update the documentation for EINJv2 support Date: Tue, 21 May 2024 14:10:36 -0700 Message-Id: <20240521211036.227674-9-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240521211036.227674-1-zaidal@os.amperecomputing.com> References: <20240521211036.227674-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR04CA0187.namprd04.prod.outlook.com (2603:10b6:303:86::12) 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_|MW6PR01MB8627:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f5d6aa9-0922-4d14-3e0f-08dc79da8771 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|7416005|1800799015|366007|52116005|376005|38350700005|921011; X-Microsoft-Antispam-Message-Info: Az1aAadhbHh7Om7+mzRQN3eDbu2rQq9tSwsCR8Rqd401TzRdIhr3re4yEqafvGcsUbfCCkBRDn3XbtCe0TaEeUxTnm4ew9Sej1SKKwLjL3BmvwKtQWNEJBZtkk+0ikP8TG6t47xQ5VYZDcdQp1eBDzz37P3CCYciQgMo18F9rYcFGAmcRYp+Cwt70Azd9pEyCUQBxcveiySzcgvED872x0FFj3SoDfRDUwcZVpq7A6STyF18+YgyVfrRS8vcbszWm3eo1NSaJ0693QfhdS6+S4UwNjNmcVpMbNORufD7Ex0JgjYICVnfkt6YNO7sab0h+XHWqLiI4+IHSb6HD6swpw/MlaJzi6ARi2qM6uMukV9ZVxcVQsenxoRvDUmmRFFQQYOLX6uzz9TvpTjsoJs1CAcpUnqkP/gOZflxVSRERJdUlmDSj2GZy8fZafXvu7fX8UTspyx29BbcHfS1CPUKbEcW/9OCmjBNpMwy5m4Je4Rw71fFXLZYArG1OMliPEDkWIj/4QI8O3i/4b1jaHJfPX+06jlCNEsacbcceEBIrwZbkU7zhfofzTW97uCxhOhFi3viCczVU8HxNbYBW3LhfZZ8rDiMjPXczWKWs1Sg+QnO+i7fjemHkHaHEoQ00ztW6QmRFH4DUInrYHFrZeiW2omzRPTWKgWRCCkEPAuhC0U8t3e4nzqi7NDtr3hMUHC2/8fskrVrbx47nKtJKmXM6rIsKRVGeLMY20lFE7tosfl9Z4TgzArN7QQnlINGKN1TIoewJIsh2joBXFx2hBQbD1qs3LhFAidpHnsXaiffh7RcgKA/oFXXjoPpK44whDFTfYfmQbT9MlOZybaCstRAmisd5rJyPDd5mBkMWsOFcrwxBfPRFQCZ6ODgaj/fAd/P3sjFpg5XewWdHaCS42q7Qyl14YKe6n9e23sdDEDNtR+flIl4V+ixe8VqJtpTtLYu15zGaX9hTyNHrrKw8uU+45YSYyGwwilnlSQtRAfpHEFjs/1Rz+nlErLLqMg08O+sN5wc2JUfCw3zrviNv94UAmKN4UG+pDa8nYdUmVI5ODk5xsjnwHdbNqQTtJ3D770RuB+c9BeWcQjYxrA1JdylcFImm6QSehp+RzV+BLlJ5rwflcj+PHTs8WMFI5CF6S3Ab2LkQUXPv1MCAZgyYAyJYvjKvyMDd+MzRBzrBlOCCiDY47pdPbnjBZwo2ShPOv6U5h1efACjLnxZ7qKZllgZ9zlfAdzYtxl/xfMvb0wuVgq2C/2klddUnTlWBqWTIm915c/0uFd+3mGdRyiIrekNZKx4C3HWSIIfvpqLmqgETrYyUuikXKLCAtME0FSdIUCZ 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:(13230031)(7416005)(1800799015)(366007)(52116005)(376005)(38350700005)(921011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: huFoXxV++igu/XjaV6Svd9B4c43+gu9t/fWZdPgCCMt95RivO52G367iVMAQ2/1O/IYWHxoPXaj5Mj56xn0gPT8d0ClXWcaFCFUImro+pO9ewv8HG5i6h9FZ5sctE5HTTarDWCdHW1WjvVon8bNHQcFqImha7egKPTVRcYLPHZuxoMpyuG1QXYOWw19K71yFMTdG7K0+bEdwq1MoK9qODKh/hncxOoPpyXsrij3GPKNket+N9L09QAlj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Ff7qTZTSIzG/DOEEbLyeBR6gJVZpJeXo7m4YE5C1IU7QEqYmU45fwCrCPNUDyemsi0WkMJOee8OxhC8J8Brzj4j5eb6U4BrmeHB1NazhtuoHPG/KYZR1bh5qJ+qDyIJhrdUhFqR7Cbvo/QMiPj3W0P8EaPgXjKYmIAgU7d2zUTMX/eWViuw9CL/kWvQ+zjzxVW/aUoFCd0jOoI2BRWzkQPpJJlnPZuhTAuAC+d0ln+ab0dmTPaYeF1glAQBy7AMO02y6BtnicJfIqnTzU7SaZmgb6tCgdDv0blNxcyWEBjCKUJbS8S2bwzA= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f5d6aa9-0922-4d14-3e0f-08dc79da8771 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 May 2024 21:11:06.3133 (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: zMVQxIDGqO+/45Q50cQcGgreP93HY8Eo3fKSYQ2meTW/wAMWcGdq23wDRoFz4RB4uDw+57/wprl5f+l5HVS3hZTrEQ9Ya6Pzbz819vrbiGYsC3ioc6T/C8fb+JcO2Ay2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR01MB8627 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 | 51 +++++++++++++++++-- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/Documentation/firmware-guide/acpi/apei/einj.rst b/Documentation/firmware-guide/acpi/apei/einj.rst index c52b9da08fa9..f2751cee9698 100644 --- a/Documentation/firmware-guide/acpi/apei/einj.rst +++ b/Documentation/firmware-guide/acpi/apei/einj.rst @@ -61,8 +61,18 @@ The following files belong to it: 0x00000800 Platform Uncorrectable fatal ================ =================================== + ================ =================================== + Error Type Value Error Description + ================ =================================== + 0x00000001 EINJV2 Processor Error + 0x00000002 EINJV2 Memory Error + 0x00000004 EINJV2 PCI Express Error + ================ =================================== + The format of the file contents are as above, except present are only - the available error types. + the available error types. The available Error types are discovered by + calling GET_ERROR_TYPE command, and if bit 30 is set in the returned + value, then EINJv2 is supported by the system. - error_type @@ -85,9 +95,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 +122,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 +135,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 +164,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 +218,27 @@ 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