From patchwork Tue Oct 22 21:34:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 13846201 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11021088.outbound.protection.outlook.com [52.101.62.88]) (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 17ABB1CDA31; Tue, 22 Oct 2024 21:34:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632886; cv=fail; b=hEc9cbrM9VU84qu6Cniux9KjyTAumVotYgJ0u0/VwAHtSRkr0XZl9lFt41S9uu9EdNipSIHL6bTdG9IaOkVWvVRAd90pi74PI1uOIXLxWQaO1++pwANVkyGWTI3M3iokgT+thQT03nxefO0+BVAtp98x86lxzfeM/6bQQ4nQ5bI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632886; c=relaxed/simple; bh=P9k6UcwKmIuZQ/7IYvLoIObmIB9VggFGJOCYU2oGyfc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=ACT3Egzyc4kkTzG1XhUH+3zsDx/1WctyhxdiUIbvmwqZxY3VxsQcKugI7XUVQIdtMJ0Te3/x6ex/pZ8UX8erS7FvXnd3L8JUT88T9jkuExFmhrk1HQHgSMcPjemDNoaNz//EPu/5khDkzpgBeYp5JcLR2d7ebQcGfSok1tZnFb0= 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=s1rLe8kh; arc=fail smtp.client-ip=52.101.62.88 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="s1rLe8kh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=UZzRfrkHmwzejqYuzqTBdxpQOExN3HjLBv9zx9OO0xEy5SwV4k7o/7ayOHgi4CgAkzWQl5AOcQ7TenC9+ugrTnR5smI20mDw99VMo0X5+U/m6lfbpWXffl0vZqrkoAJG7xnsknauVVjdgTt/A8zWztpoDUe5oP3wgIECTATgWOwk/PwycsPIULG1Dy5DFUYtTTmYpSuGqZ9TRsYYpR7fM1sLfa5a3bibw0nZgqF/U4QbaaOkL8zmjkpNCHaTCs7uS8Nl/symlZwyPT5B/J1JDI9WAIp9foZsHUpfGM0bV/lwhJp9wdQdRlVkPaD/v3v93avhFDJuxCWx5p8YtvYFqw== 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=jS/rd6dnR1LqFsJ4MqHnLYRlcAqn5m7bXnQtwRvU4/8=; b=BEtyPgbAsijtqEkzQt1mLoTqUcj3lnwGIfbGQAtEaFs4h6dedYYgNaY9L03wLKt/w/xy0znLGX3BW4FUq/PyjfjyDp5ZUpejocyAzqK3WfFD3eXWz9PwsReUV9F0CWrP6TGbhINRrA6iqAP09Ic4jczLCh/RgyErfSVPl3uC93SDBDa6b0CALNmXkACItbNtMzhUBkojagkO3Um5aa5HV89KM8aHKDrLl56GK8PS+p3Gzv6ekayObWH2wSuH7mEEkBOPBY0Dpz8MoZCG5A/K7yP0ffsHxkfRHRE3lIS1gIBXEgXgF0slMBoHc4At3phFz7Q4ksIyTVK5MX+tba5RTQ== 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=jS/rd6dnR1LqFsJ4MqHnLYRlcAqn5m7bXnQtwRvU4/8=; b=s1rLe8khrZuKNBkVunJLPfoZmIUA62pfqqoprn+CflzM6dYcOL2ASlFB4DAQfIDtxzLuWe2cZ4gHHFIIqEJR1HQJ5Ui2RWqZ7cgT2siPKSvuW9LaR4bWBNIzbAW7Hh9AIux4sI5VOtDnYngn9GF89JiXa3/DCOMjYs/17yo36UY= 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 DS1PR01MB8991.prod.exchangelabs.com (2603:10b6:8:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 21:34:41 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%5]) with mapi id 15.20.8093.014; Tue, 22 Oct 2024 21:34:41 +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 1/8] ACPICA: Update values to hex to follow ACPI specs Date: Tue, 22 Oct 2024 14:34:22 -0700 Message-Id: <20241022213429.1561784-2-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> References: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4P221CA0027.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::32) 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_|DS1PR01MB8991:EE_ X-MS-Office365-Filtering-Correlation-Id: 68b53671-6fe8-4a54-1cf1-08dcf2e156a7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: rkv24dLh4DuNRziL2SJaLIrvZp0vuENhrBWv7zMgrFULqUXlKRBOgYeDjVgKe/Jn6TSJsaykX17cAz+PafWn/UTO5k3s14PlX3krPbE1nGimRlS2JxneWzT6a9YUAFkX/We9OqW2ovh9dUFMlbwRQt3hyOQGk/kk+cXwjrkNSg+k3anle0PgKraiA7gfvQbJj4aiuchXxV8nef28S/67gQYSxOGUUL/D37yUvXsMnWRfcQD3UKUZXUBQUjIwmbbVNCb5pp0lBpYopdO9P6NkVHwVTKWjRZZMm8KkX0CfVswSdcBgnu5f4OWoBKuwy7XcuhnJOkimw/HmM157hzr0aPeR7grpg5zAD6xMj02LhQNO0W0T57lC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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)(52116014)(366016)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YPQqiBmOGViR6vZIoDJJQOER0DWjhl+1B06JYVoqdJqLM6unBWOVYlfddYrDQnJI5RQBQ/+UIpZARDS5kokuBt7UybUZM4aisxdRNoz37MjNYueTOls0jOwdY+l9vfZIfAAItyTRl/71up0DV7tO2iw7Azbth88yRGVl9wk+MZxYWnmJsYmXx9/7pZUwrc65o88UXuVnnGlT9ejDNVKyVqP36XdY+XvyFznz12lKvZwR/F+Lw+tzN6ppYWlYk2keFArWH59kNR4cLBwAQd1hYn628dL+Y12EvkqcfFJpm+zsJ0bRzAic5CvJ0JRVGdtqJNf8Eq5ky9cFBLGL9y/XN5rE8Q1Q2W4LGb6tTH11WJc9xJWxBNv06kxcTD+Z6FhKfeXDSZuIerXwojh1yJsaZPAVNOXqMmM/DOVA+mZOF0JZRxzfX8jkVOudQjvig0IBYeDepRGgvIk7o4Ll9pya3r8jcJtIUreJl7FrvflqgN5m1UuBcXxd7ELFU/EP4oZK4fmOhEFPr6EoBWCyT2z04w7MrE6uwgQgffCqm6Lt2IX95xWQ7D5IvLGoU8WMBMjqC5jl9uufy2jFEgi+Uh3mgqhzTW5v0wMh8cvK3e85+E/cx7EpJworvNS4RTsWFea2IsJxsRBa/DAWK+z33y0Wbi4SqUs3IuTklQOZxNYqC07ogF6FqJj5rgUpsbmZENwEoO4BD3aU/ozgNttSRcg+4SwjDr2L4HNZ3bPpUOIu2KZmLZ4QjH1dYGY/FwvJZXO7gB8A2IYds5/Do404E2cfRLNqZ1QvLSqkxuf7NJDe1l5IkqYAyLo2an8L5PT/2tuD8M0lkipQUIi9Pp5atmhlDthKn7nF63TCeX5vBqS1orTGF2bFl1VE5qZhqByEr0qbJZkazylstbISfcMljoXwMDBYzVd7CpxahDHxHmeUjmbMDryynHUfXbkGEVmJrzWLlAft7pm1/mZa8RjyaFuUJNmWbKJatlYpc8bLS3nmO5WsSCLE16FrMoUvH2cF9zExDKNSNTL0kzqDGyA71sd4qYkg44jMhuvlvx7i6frQfJXH55VWq1E4P8ik2Fu3WO5DjonL1vOROJZkE31XKzv9H5Q7t/dgcHEkF9DVyONDVg8MpzwG7R8nU/PuIIGy5bbz2DU/HkUyPmem7RLtXbRdFR4QwOIRVzRrMcPEfKKr1oMfm11Eiy+yEvjB6PbIHbBuJZcnRBKxTzWSzS9nP+PDcq1sNEKe4vYQbDdfS8AoGzHRT/ptvPDWKem2OQFIdiExkTBSrPYYFLiU7UxJKTwb6HuNKdrVG8g52OdnoIOWFGYvmX0MFXNHKdEpehsuyvmNs2ej6/8RIGHLkzGmAgScuyERgPGn4y1iSnLnx6h3ELZVEiwyJo8WX61a/RMTgSmpeB901s6Ly+F8cpmJC/YvBsLb47pBp6vG5b4GF8y5e46Bx4XZkcgr4ISsRFtSWZ/bbeL/7OKsZIeQf2ZBmKfcbECu36tkTpxDn4vrltnce/JS50TRYaAdqASx8aG8Tz+VAtIWA2t1Mj9LOMjM366pnr3I6N4ZeaW3t1mdE9oOsTOVRQcufkI2hepAcJ4dzRCsXwtSOSqUmiQaXJwca2bRGbteRz2v3R8SczOgrZLekKQ= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68b53671-6fe8-4a54-1cf1-08dcf2e156a7 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 21:34:41.6451 (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: Imjsqe3bph0eGWocqrF+ODKqvJMTnsiodcQHdfJm27QBrmIxCmwLYzapQNYmcid0ncg7RdzORax+CP/QiuT43JykNv/eKS7EmW8xM08c6dZOMv7JajoDmNQ2DepJKUWY X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR01MB8991 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 199afc2cd122..ba177b79a2b8 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1022,18 +1022,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 Oct 22 21:34:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 13846202 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11021088.outbound.protection.outlook.com [52.101.62.88]) (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 E21F71CDFC6; Tue, 22 Oct 2024 21:34:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632888; cv=fail; b=D335iLPVHLETVRLtlXmHBKel/l1zq/hSyd7I19s8FIOXpMx1UXHU2DTrN89W1uPTCE73gxD1FoGF0F3eUYNEgJOPEE9wTJ206KNKr6xEAN9wDQiEb+oRZ5d0xtO0DNxjVNfcnFbWO0ra8YbKV3NS7yjfkA2GHI7WJ10dOxOxNI4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632888; c=relaxed/simple; bh=nscLSxZrHlX6/Ql5pEchg3Uhvc4a3LRGrb8W0x3KwTI=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=p3aTgqCQSJMyYlKa4ADh/cOhCUkEc9OSvhztXJWWz8ijw1O0ZpvI3XgpdVnKIgtHvCrfDXqNEQMLFn3YR9bIbVz6lEEYQN49MruNErqo56sTFX4z7wjjC4vtYNYz4pCnoXQmITyDGL9gGaq+uFidUQ/DxiAdQ4dNMk/sDqMXN1A= 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=HV+DKD2h; arc=fail smtp.client-ip=52.101.62.88 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="HV+DKD2h" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nE1f4tISi8W6dZ8FyCt5Pe00ljtv3cu7uTkfwx86c9yTnHvbRQDXFdWctYvSSPBy9YT2Dxddl4Z7JRLw2SviZqjJHPpC4Et+Wrqi4HSpnCaHixiHAyPcqPrfo0097+V5/nUnW2bqEckLIJTVNGTz3DF+VXmZZbjcPk87L6rFL0e9XEDr9iKRUNMIFMD3DUPi0Fo4kZl/hY1831JB9IS8QcDV1IaGuFjEI0Ixj4Mc7JzT0VNG/Fhlxp70xPoKgjiaOWb4ugh1sGv5S1AioHvESZtcAWmaC1nZ5qW4Ci/dwr8pOsKUnu9NFcDhEzh+N97R5a5ancGuD61ULbb8BNrAcw== 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=ZUKHikz4xNHj1OCwUUwCaPbdlF9FmPccUjEAqlP2Hsg=; b=GH4oqjQhDR/eF63DSP63+0nInuYq5NAk8wlaLMkhtvTOuGIspiUYxN0woFkMbgHQgpU8i4ByPHFoLvjOoDOIdv5CbVcilOfVSldW14hEQ2StiQr3lWqgeQp1eKaze7KWVp3o/eZPbAfkb48ee4wj2MBieabbtEbi6B0yQDJ1SMssTzR8qduAhxtpkNgPCA1vwBTnx6hnF0sggM5IyBStWNu5uAIbIc2dLNAoKoc5otBxDbNX03xvkNGWuT/JW5vf9t6XvVZFSa/dj7snnYXm2AfJDoZLEXcaQPqd6lWMDLlBhT1OSCSmcuReB7kT5QCzY58Ck1IbM1q1Ci4NkAzXlQ== 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=ZUKHikz4xNHj1OCwUUwCaPbdlF9FmPccUjEAqlP2Hsg=; b=HV+DKD2hjFZITtirpE7SO7PVdHBBMn7C725h4q3RKzls1hm6DnwIGEwBYYXvkuWrHnArwk58i8DHkEsYfyH1zgiUpuC+foYLU2pE0TteJDEXGLpKYah3oowmOpgYDCLdJKHBghv0dMkqWbiqE3gSNYUqENk7LFIxqFv9PoCdY48= 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 DS1PR01MB8991.prod.exchangelabs.com (2603:10b6:8:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 21:34:43 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%5]) with mapi id 15.20.8093.014; Tue, 22 Oct 2024 21:34:43 +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 2/8] ACPICA: Add EINJv2 get error type action Date: Tue, 22 Oct 2024 14:34:23 -0700 Message-Id: <20241022213429.1561784-3-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> References: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4P221CA0027.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::32) 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_|DS1PR01MB8991:EE_ X-MS-Office365-Filtering-Correlation-Id: 25a7b9fb-c52a-4d8d-66fe-08dcf2e1578f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: kgmyYlrzo0F7eEcxYgqsjpMo6iaTwWAGR44U4r1z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vOilJAhtpuJa3NzJLdxXd1VFbxKwqNAIqksvRxMAl5I+VNjBdB88DTylR2sk5eMN0oy+cYBduusfLe31ti5lbRVqTwcNpMNKdd+eixWh4srHQu4YHYa+mzVJ0HE5QFKP6Ih99VyI88uxGz0DDpzZgifFFSNakFYHTGaJT1OYjftKv3ewnvpaFXzf3hX+fJbo9xVZHWNcEkoQCO6Ywk3MFcmjVf/HvKkun13/AN3op1wEpXPHIn+voUQNLN+cA== 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)(52116014)(366016)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AaZGVuY2yPHOhqVEi/q60b7WMmDT06uzrg9sefjHidwGScwA77n9dREU8nJUk6lSlVhacGk0NBHELfWkzXHDTBNZ1MhdyP8sa879l7HWCdju1r4Bb5Ct0DBpr8Ntmp53PBTot0F2mBZH3OBZRveQzMYU1+TmUN1oCaNF39ftlLpyXrcfKOzXL6nfsMBdEZNMSF3NNCu/JEIqMbTap79pfzNC17n/kQo7LYTb8o33uP5flcFzNHxET2ub+pp1zowyCWLYsC36DPrSFUHLOOYi8DDufyVRh5C+jL3gv6BwqLPJU0KKjqPTSbEa1j7FqvQT4kDLdjnD4yXRZ/dqzriuugeOhrayXcDuHSp/RcE30anWvZuNLseMqSaxqHwv3HiwMl/hnDAzrC2DENdMIZTcmuSK/AGDJbnDNsODyaKguw3wxrzWcV1ogNNbLbP2oig8BbnJJsAJx3UB5H7TI6stWwSdEWqtxmr413YAD7TO5WNqSsVedT+shvMXemkykMhrmtHlMubQFXz3y5eWwwz5zkhaDYoTCjfthU8nlBLr+zKl1I4PrkKKrS2F5mhkLx5Y7dE38QEOSNh0+R6oj2Se3AAySbi8D+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id: 25a7b9fb-c52a-4d8d-66fe-08dcf2e1578f X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 21:34:43.1760 (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: CxzockKxtoC1lymli5IgstzBYSiBpLYIpKcfKYcxgfvvxOSnXz4WVWd61RXs815CUjTCTjVMEvidb1MkvuH3dogdA7hsQmODoV/bnBuhD2Mb4YlFh1nUGEwGzVho8Ncj X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR01MB8991 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 ba177b79a2b8..66a71b6619ff 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1032,7 +1032,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 Oct 22 21:34:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 13846203 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11021088.outbound.protection.outlook.com [52.101.62.88]) (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 B694D1CF282; Tue, 22 Oct 2024 21:34:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632890; cv=fail; b=DqhxjN+QJHleZij3dkhTfJUShhy0R7Ssvh3kDFvwgFBJUJZ0oia4pRPdZLgjOQCoCdWl2+4uceH88Rc1iW77+bPeIHPdo0YHnbQ9rGMbTiJJxdcaGsT+vZf9ZeODU5V4r0JlEBCPNiEPPZr3904DJdYsJrIxSP6xEutydHspaMk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632890; c=relaxed/simple; bh=7Pui8Uh/AaA5ZbR3YtLSxow+P/kaJZT1Ife3NB17z5k=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Ol6lf9aGRSnGo7iVZqvpaaQnks73cBv18PGfctGQcvdlR2FBXIqHOQwNzZnEhaJxKn1XsqKNjqQ1gfoo6KPbl8KIoTAla18BiXyAJSdd/Zt0bGeLjgUw/QPQtx8wEDdvFr9jLNVsSA8xbZ4DWT86u1r6S9Hv8PAg5wgfKY91dXA= 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=eJ1y3b/s; arc=fail smtp.client-ip=52.101.62.88 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="eJ1y3b/s" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rRuVbuYk8G2xJUwTjGhyb7d3+21ItAoV62HvRWHwWlYIw50UErlnE+Dj8gHCJ+M/pFFpIz1adiNhF5HhMmB2xS/0Nqo5HPEr67omB5VWIKnXIMcEuqvKW/tQkBFqnc3kldiugTRAVpAqoT16bFgjiPKTT1ZFhDsTNC8JvNa0Z2iX+OmdBLBBxID6Ah6y5qBmB5mmQ0MImzxEtxRTCrrVdj2+l3sZOYOYRfHFQchYGUDhTaa4VlizMjAnxjesAAsSH6AQNqIwd5v6vJe+DeLHAvRsOL+BO8M9iebUUuAWB1PDQkN1aEHcXTlVqPvfObficlXIjIHwMKa/9JVWBEcVuw== 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=I9aQVUejRa9bLVYZogPYcwPdi4eK8mzZi3jIiHStYGM=; b=OzGBmo+r5UYkfZK7VE56Btq5BnKuGkdVNBqvlecm2GupVmdC4javC9pN+lBViFA+XH+6bIcEZ5N09dtk+DEjJNiVnihA62t3GKmi5i491dEIO3IBDvx9cQioAqrSLGfmu47Vq5CJDZbUK/FmEiK/Uo1rvpP9o69ggfa7YYsVUHpSbB7zlp0C3JGnJAQQpOphIUqfuiUbnQVzDtxygSKGEMym5wIw9QHgrygfXOfthcorfS3j8dbb2WAjXaNt1H7y85gUREMo6ybn3RqjcP96IYQo0LvHiL0lYpdGjpQ6crQX7f7l/dgYNziRv3g5ccUO6vAK5Ni/HuNjd5LrB6yFhA== 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=I9aQVUejRa9bLVYZogPYcwPdi4eK8mzZi3jIiHStYGM=; b=eJ1y3b/sWZQTSQ342DFMA1Mldk87gXm1r/dmB+WE2zOJiWfogxwcbalIbfeSz3+YBW453z3szOAyHLuBgED1ER6FqyOWSrCLn0KOaAp8PTe57JsK1Tg4guoH+jC4ajvd4IB88E20o5u+Kmbq+hXoBhRmXksDZI5SrngbabKV8H4= 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 DS1PR01MB8991.prod.exchangelabs.com (2603:10b6:8:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 21:34:44 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%5]) with mapi id 15.20.8093.014; Tue, 22 Oct 2024 21:34:44 +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 3/8] ACPI: APEI: EINJ: Remove redundant calls to einj_get_available_error_type Date: Tue, 22 Oct 2024 14:34:24 -0700 Message-Id: <20241022213429.1561784-4-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> References: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4P221CA0027.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::32) 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_|DS1PR01MB8991:EE_ X-MS-Office365-Filtering-Correlation-Id: e88190ee-61df-4bce-9ed1-08dcf2e15875 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: 5eBAQFSXuJtUpWDSUty6iq9ysrdRaJSYuP7GG0Uqap9n1phWCyP9gUQ71vTV67ljo8keXf+uMJz0giqsG05XEoqQb7QnLp/5iCdLK1MYt6gXEYWi6tvO0QgaYZgp9V2PlFVfB6p3jL8gBgafk69p5RZ9DJYL3QY+hle7kWYP97NO8qbMOVboUSlyTS+wc7I4193nbIq0HQFUoC3V69VyDWujPZ033Jt8KRXYgL3aPJQVNccUQieAa//kOyqCiVZ8WZ6HF0a248BXKwEtyqejRtdiQ3mW2S8GXmO3ghWW/Tl734BfuTFFreiKZjh7PJ+Cg23uTjJZSv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hl/HqJ 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)(52116014)(366016)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0sRnUS1W83z3JCekZzB+Tmmhu9FinO/0gk2MhAABPeDOpKS+hpV83nJ1NsvR9EbWfEvFYbEpfvY945WDmXxoD0YPgSiXA8ErcQ9HGNQdfiBG7f6IjTXqoS3j2HPlrNcWy8JU8ZO/6fO9a49r77GbvRBIjQlIaQqusvJxaTVwYpMVzCwcx3IAzPlfTTjQiodr8cUHV52TVWopy0cxrKo8GVaiUwJbsHYHmY+sHJlKICKMrQJwPhJmG6juwvk8P29ytckBOjM1cxO0g66VfclBkylRInElJ78nZ0gM7OvHq3v+6LDFFLzrjPthIJmm9SJqHVejZi7DqN2mkBVVljEMt/U5vIpuni2X0X1Jg5A1HUVxOW4IkFu+gjRv9vVrVyBrqwzwDVFjdHhmy0/YQP44XRmlT7GqRhjYa0IlB+IZrR/YOdEaBH0Yuhrr5wITq1ju7+mPA0hS9WMoN77W1DBwRRVwQqmLtZCL53gP4OibxqyBwz0g+aG32K/SqehwjLHlhMULSA3xpArLpWsSJhpAHEbooF5XzDBWbr6H5zISgFeTF/2NETxCkqSpEY4NEM9yH1gBdA9+U2tihe9qZPsb/7b1CcknX1PZbrqTPkc6zM1S0HAF6AGmh8iF/lnrN7rASC/UYFtrIoJ3BYwsFq/+jYaNlfd67BaRINLbmYuNfLKqn19tV9+wLauSYqqq8x31NX/VBl72w5VFEycLOLAP+Dqh5L5W7+M5h4B6k9knLC79pnel6k/3T8RxemdgCGqxBQzeWRunti2oIGdzx224XeCGzGt+fdWH53fCVdEIlZ/hW1Z9rtX3PwAkBDSSy+/2ZzNyv868Oct4vy3osv8jKeO7nNvDTxDyMk0o7MezzLnQ1fUkSea58kOojLo5fFKvIOTXnhSkjZwiGF1DSP+n81pZyq7ldgChrc8RB5NpN/Daj7rEM7X/AK9bQl49/W3djUMqXTQboxqaJeypBMs/mns23uP/lAzS64/GlU431Wh+Vav7K7F0guKpyQ8WJU4CxYn154Sq6Z6g7k8LiAIw8dz+XJvcCfyG/xtg2jO2tAzbXOIUdJdtoIrDLAM+YBphvReBKT08yZo/k1y5vwwgf5ewW0+bbK1lijywlk9pytmVAiQRI/WPBH1QlUKdGXI5BkpBNiqv+qSy0u29CJluCn3xQLj1Ce2yEAMtfEd+AXlc+FdgvX6hUargZ3xij40CE8+BmOOZ5kENsL0NPRHJxoiiRPLhTwPhocO1RPWhEQ6IXpb6KxRyxGBNxGuPcdV4cdvK/jxKbf4pS3WSDk2EI6QGFi3Drwo0+Pei3vVnqi8XhVO6Tu+WN8zOUpGUK1RkR4mbvnP5BfTOHULqjGO3tV0c3XUiCi8VHbG62s5Q+BKK2VtFteGJh1kAzeluoixQfkPwA6OJoMA+4cigbQp31QCz6j8eQeXPqHJ1pa+0RL+wM+aNxIWnTm7ljkvNdV9eQgpfrcXAGbI/irEIHZWTOMiZxRq2WTcLY14rug64wypJ0agcCX1ldTY00P8Bn3Rcz6EOekKbScqKs3RfIsoyT74JCAWAfDpALwAfroeVKskvscs3BzhJs5qGeHiOt5h26BCPhmWw+LMqniVxH/PJILT+5cQtZxsYr0eYlroXdt8= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: e88190ee-61df-4bce-9ed1-08dcf2e15875 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 21:34:44.6775 (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: LO40VHSarVUF57RWnZLUYnAGTgVxqz3YC242A/dLNXHVwmOqK/xuW9wARV3hWrDWPk+tLh/y16VDcTnxNdYkhCVdrkG9+O/sR0BGMgaLFMmKdy9xMGeTAwYwXqKziiU5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR01MB8991 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 --- 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 5c22720f43cc..78c5a20115eb 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 Oct 22 21:34:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 13846204 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11021088.outbound.protection.outlook.com [52.101.62.88]) (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 68DB61CF5E6; Tue, 22 Oct 2024 21:34:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632892; cv=fail; b=n3Wm6/kf/68MobeBHpSSmnmW7woRma9/IludKgd/cC6qjfFVgRztkoEi3EhhwF7/iUskmfAwS6XtsjRmnvOeGUCRugQlHmTisfVck794yYHbfrAmTTbao1zewM9gR1VElr9xhY0SfBbqq2L3njb+jcwKCkBkqGHUNYdy6pSW1Ow= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632892; c=relaxed/simple; bh=6K9Vu4L6/O1/OTZfk2//JqeRBYIJN79++zQgmwajSa0=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=J07MW4T0yz2pdnSCFm//oZyJ4hLDQ88wzoZjsdviPRciSCnckgOaMiPONYPUyUzonBOEhF0wE6nJuWROckgt7Wvx/9NCs8J9VeAYZNcjpi35e8ckXUleTOubiyMNnzKfIL6ipv4fBkBSHYjrgmoRj6OdZGyblXhwWhIjYQSRGGM= 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=kAQ4UYWM; arc=fail smtp.client-ip=52.101.62.88 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="kAQ4UYWM" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yVT89+MGguB1O94gSoydQvopfjq5kkOWt0dhSC7cJSkaAu5LLAH3/J1hkwHYTfmfDqLmT11Ay5I9sq8WOaDeGgAgm1VMdlkxrrsyoL8UmsDmisdAjSgl4xPBDqU3fkcxBw29WadOMcaEcIatR+xI4EiJ0tAatfpPHEUdl/3BX1UDedbwEs8EOA4qbjFzlxHtZdT6ozGkWfboZeChm7p4GC4FvoT+2FBmZ33Q/IPlSqD1rC6Dlq9u6r/hzduaX1xj94bpTPH+SZJibCASymQZ0SaHLk0CRj+Y1G5+oVpUNleWpp3Ci4O4VZ4nCGME/AigR7O4MZzHb2svD+TEXPfw/w== 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=h4uw7zLZyAVtMaitfutAbQhVjfCOnOi6ttCLIFIsHGU=; b=jpOHZnKG5uNanVWwLgA24YC9WOZMywKoF0RiyrF1PW9N+4bqn3oKcFVHr0yR3x+yr8lV86CDerOMhmLc8Eb606TzS7hFfShroXjcPjgD6YF7YBJWk/kCj134rDIFm4zUvQPFSfFDSKW7BTAyY42O3lYdxu1WWqCP5yHfn3QDa98IvOvcMn8EKLjHUZYx9+eAoL2BVY758EaO4yQyZHJ9fyds4qYPK42bf7S2y93dNEfbPIio1BU0E5F/RqswmRJhLoF7zAl7GWgkPK8vB7O0si3sVGR7fmVMNpeQpg7VtkoDrSb+3ku4A91RU1S5JIK9liuDZfL81SnCCtRGbRrfYQ== 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=h4uw7zLZyAVtMaitfutAbQhVjfCOnOi6ttCLIFIsHGU=; b=kAQ4UYWMjEmLpRLXPm+mbLRItk4mJUeHw8zeVpOxU9jNqEwbWJ7EE31ZQ8f6XlulXokswBxTVrx2Qt895oSaxWFOqHXBMfCmCguJLwyeU/rPZgSbIgllywwAr8JKnObNbuF6x+2UR488wfBCimWRxz/Sftoc2ghh1EUjBAwa8k4= 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 DS1PR01MB8991.prod.exchangelabs.com (2603:10b6:8:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 21:34:46 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%5]) with mapi id 15.20.8093.014; Tue, 22 Oct 2024 21:34:46 +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 4/8] ACPI: APEI: EINJ: Enable the discovery of EINJv2 capabilities Date: Tue, 22 Oct 2024 14:34:25 -0700 Message-Id: <20241022213429.1561784-5-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> References: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4P221CA0027.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::32) 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_|DS1PR01MB8991:EE_ X-MS-Office365-Filtering-Correlation-Id: 40388e7c-3b81-4b77-4cf0-08dcf2e15958 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: k0iso+viZqxJenZCqq5kumsYfTMHM6mZqDqb7t4dvjrdPs0ZJ3C/pci3vSg/tuwb3hlqtkXEbycs9Mj2+QHC3AfSXuxXKoaOlmGmlu00x2eG9BGF+UbZEOG6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EDDtvxELjdkYIvWXlu6c0uPUsi7JK/q1759MemyChjfLdMXfdrGaoL4VH3h/gj1ZPx+vW3Q/+KVGOxrzuQfR+K0On67zh/ivoRTvIb243bqOfEzsdM+kgFWeAnTTZTyNpT2X9kbg88B5xIZcUMJR+hLn+YWKV4WpW7q9cXDdVNLX4BIkWxr3TuQKowHQbVMkliEwSGZmQC0vqX6YoI84Sm 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)(52116014)(366016)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: P7taSpamMOrNKrn3zi8zJ5LvvzELo5XSFHJlDunQEoMxlItBMIi29hlNB+4c7Pd5l7dkcWn9G+0SEt1Fz8iFbGYAdFWmhPMB/tLQJRTKNwDfSxcPhgYHeA+whefwKhh7R9YtvoLtl6pThffuROzqxXh3dfhoKLyEfHtHYE1IEh6uW+XuNnNfJCwDI6OFXzfXdhC6vtTtKZKGeQGwCIn0MKU+mdDsEvGD3CdV9iZNeWZvKNzKreEhwg0xcskMtHG3NWZTWQ5RHsKJfRVECk1M2wcoQQaTqg3lWYQL/m6cf478dr87HJdc+QHz+YhKvFlWgwDM2C/3NdTwVn9sT43fSaI/KMBCwR43yqTDPLF3zQgzwZbiJFJ8Kk1S795BPZmk70kZtgb+d1qdp4mjQ0WzaCwtFCXWtePTmg+WKfU77ofAdoMpRvHTItNgP2OvvMQGbV2A4mpXax3MQU/taVXAHcjqf+AbOSd8yKmQpeEG7eECJ97Goe7B3BO5iZTQmZLIgU4Jcd53XFSzGW6mfYGqWqq7FxIUdq3INNkTPoEUttCseqacTXS4DPzuv5a2vWtwa2qQ5imHVg7NZmK9iyvi4wFVE67A9ul1ZNge18W/tCD34WqMAfmcVb7zuRG8EjjwnGNOWoqitnM9qhjqiPzZH9FS3O6KkMr679SCou48nI24+TvHer4sjw4IHcC/2m5SixxB5E65s94nDjGgq33BzYNuKdrPAT480kKzE0pFHZUhw1EUbFhbOImTz4yr7BYPD2faY9jrchReJg/Y7qDibF8e8B099r0YV5KXDIXF9X0Mnpm9nwIwgZ2bYUGePT8rSGf8rVTS7Jwoako3NyW1rGsy4KhcxBoqwT2QEtI0C6a0MatjcZvblRi/kf/lTo+xPj4uSeh1VhrxBT8fu/xMGzhNrhgUZ80XGuniKFWTfoYfE50YsoPcmX/5sP4yw5q+mXQC85ohZSjPzdFKVkMFHJN8gbq4LEI8gVotzBblYXkFOXe+eNdgGSNCPDotWq3wQSitfoV8sFmVs77NaGEfmwULio5vVBsGMm2kVC/Yc7cGz5Pz6swj7A5LfAVcu8LKCoQME+C1e6YGuBewUocqHXq7FjrK2mNakWQDeKkfOObZzHcO0WSWMtt6F/KbKd3G99YSfAVf7Bs/ISpPk84tIeWZWZfxzAn/RZDO8+lr9N213UC+G/CQZn99gNefEyNTCUQWcMn+ebmYyc7rGVzolWlv93Jl0jgoa0rzETkX2picZeoR2hjdDMA3TCbevs3HRjYnM8fVII7Ly9stlx3HBUP9onKsCWyohdiU0sok9bsqGhNlMqFeF+N4vCXGfl7ggwkFDr5kVJjLzZBEblkvPByoRrX2hG5wbbsota6/G7C7SF2UXG3SI9Y/LECzkxUiBlOPCjii4MMFXcnoD/c8+eD2Fr1GsnEAW2cmTxeMj2xxymFyVJQx3qWrcIQYa2CzAU33duuap2BM6BFnd8+IAP4q44Sfp2oRTcKITh1uTcabpkaYtRbqaQguV87whYi0U9x293xM67w6ShnaOH28Ipi3/v9zdswhBu9KdevLNBTEU0FseUUtvxswR3eRO43xKxktjrVOM8QeiC/EYw3LVA7u3IyRxEOc9VaWhde+AjI= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40388e7c-3b81-4b77-4cf0-08dcf2e15958 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 21:34:46.1462 (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: Ranh8ELR11OK6WQLTIe8OrFC84yQGLcnh2lztlYG6aJJICjxAOoJKMeFe6ZJfXgBlbLOJ19m7GnnIWRK2u727FgrhB7IRPladt3S7nbh1J1qilwozpx76x5z+V5lzXEp X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR01MB8991 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 | 33 +++++++++++++++++++++++-------- drivers/acpi/apei/einj-cxl.c | 2 +- 3 files changed, 27 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 78c5a20115eb..3621f071a735 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,6 +649,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) { @@ -654,8 +661,13 @@ 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, "0x%08x\t%s\n", einjv2_error_type_string[pos].mask, + einjv2_error_type_string[pos].str); + } return 0; } @@ -692,7 +704,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))) return -EINVAL; return 0; @@ -769,9 +781,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 a4e709937236..5ffc4a162c70 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 Oct 22 21:34:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 13846206 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11021088.outbound.protection.outlook.com [52.101.62.88]) (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 C181A1F9EBF; Tue, 22 Oct 2024 21:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632894; cv=fail; b=VoDRmBCb7io/dMcihIA9LwaJ6dZ2PzeYcrQuEqJozmTIA2DLMk6IqSNpVgwiPC/Opyq+stBoV+ha/u5pBgdJftSKxgEsvInaykKH6R3zw70Dd2WmLAHve4Fl+HJa7uNcqgvDQFD43nLoOvdziPsbHsdTshd/GgWzt9nPL0DqqJE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632894; c=relaxed/simple; bh=inU4LKjxZ3bA+W+3VsFgqsEeAOCacrEw0PSnRO9AEbA=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=L7T7JWNHPUZjJNVIYmdG6AbGxEREs5y1q2++U5CYz8Qu4xcHkCqinniqiN2rIOQLzwOglflE23XF70gAvTnIuI2LsQEByQPpeCFIKveCzzbnJ+o/ZN71EOuZs6cbLSXp1RrbAk9Lz9wKImPM+7IZU33Xgi+PKvR6cu7t4xBknjE= 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=uni8z0HC; arc=fail smtp.client-ip=52.101.62.88 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="uni8z0HC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ee8fzLoidaX8/S6znVjYMI9dt7L3gixkXhcfO9YBaZq0em9JHGPoPN6HPtsbLJNhuwD+wI+inuW2/ToBmw1qda4rEB9p9DaZwZNx/huVGF5IPc3ijE7QDpDS1moFi9lOqC9f9QWi+gU9IKPnZV8fEujy5oFFukNLd1t1UQ6Ui8QAhbC/HQRhIxCbWOKhvuUvt090g7Y7TdgMe63Lm53HXFASH+Cnvs0NLWP3ltipTSgtV0yQyKE0zEEexWb2TuSh+2mJZBOoD6C4u/EA02yuyrNu9sTE40O3AdI1WRw+cBvnWZNMIc4eCl4fsKA/WsGLiVAmq+nz2cr5rt3wO5qzuQ== 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=hUrSB5OXVGInHjspH9AWJRqFUGr5GDfBfBHtLNol6nA=; b=KUz4rVsjJJsHj90LhCtJpqCMAi9kgbNsI+vmyS81wAr9Pw0IDf9O7yMQZcTttMdpdxR1mlYM29GFGLlAgLaSTa43uXakN/E7/kVQFjXo8bbUt3cp35TuIZakCCRMZK+SJWS9neKpCp/Qib8V3x4mWm3+zXuqbAOGYuxQ5h2QieQT+w3yhLwbEVHcfzhkbo5xzX7DWVrGrF/A6ebRg0o89lvoU1QXwCUjDstfumvnIM00sJblnSWGznNEcS9P4kHT+rMhTco0CEyDMhOQIs4QDeyUeMWJuYYnydoZzIBRqbL7tSc/kQBUCkPo3fudU2AOZE/Qtevcag1GqtI/J5M+aw== 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=hUrSB5OXVGInHjspH9AWJRqFUGr5GDfBfBHtLNol6nA=; b=uni8z0HC4fhjvzlMChFSIyr6Nq5iMLMTzDzCJEnAjhNNoOAYBeOEjGS8myD3OCsbFIyXNNj9uEFqYnv+QS5WC9PMqzouJXzKIcgurto6PJ9qCJmiu2x7r6yMsGJhMVZdSo5xU7uERAWNM3vbOko43zulBLz2HNW2CHIW3UA2pZs= 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 DS1PR01MB8991.prod.exchangelabs.com (2603:10b6:8:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 21:34:47 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%5]) with mapi id 15.20.8093.014; Tue, 22 Oct 2024 21:34:47 +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 5/8] ACPI: APEI: EINJ: Add einjv2 extension struct Date: Tue, 22 Oct 2024 14:34:26 -0700 Message-Id: <20241022213429.1561784-6-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> References: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4P221CA0027.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::32) 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_|DS1PR01MB8991:EE_ X-MS-Office365-Filtering-Correlation-Id: d75ed08b-3682-4ea0-ccec-08dcf2e15a38 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: t3i6FxFFhrufUdSNPZcn8UlHOg52kymK213HVIskbolAaDY++/3kXDXwFmEROMKtJhcHCOuhgHO7ybUl9n14KjNzu3tCbJU0tvsLTxpqvE7GbTI+po6R1B7gz/w41Am8PAFlyyElVPlrsMvPS9Snoz0o7u0aLpPG1d92OcxGGKAaB9m6qndkUtrztLELSLlUh7neLltgtycG9Q5vLW+/h696UIiMeTSqP5goF1WXCRc8XKdEW6B9h2DKl4aK2N91JRPdMG6XKLILwfUzgCvibxmqAfYWbGe70tntk8XT88f/xgTFkR6svj6wNWefxOmyg+SRfn4z9evJet9R6P/k4ozk6tODV8hhqGAGfqmOks/2h14K0VbQuC4PAkZwlL+1cLJFt7Uo1yktjz1lR/DQijQFVanEHLSlfu86iTM7PSEvzM//iptxVHTUJEtzWDTG3WVCJ38zPuXW3NT8uoTIZzxSIidtLab/NDRfWElDB/BSIYNGpxiF1y4/s9aHVr8HDrgNwgr+OrPCm0jfryk8DT889HwnZlpOxjSGKyUmPmnf6hpYgt7rKlB7n/bQl2NFRLLib0vxnQWaseCsMBgY4hLrCbgLz0xUYTgV7AnjEnTyO1vZ8ErQZnWpMbofCb60RHm1Z/Jar8QxmbviRvtWCuj2xapT5zQ+BBv8kGTxUgq1YVu9y1vlXj9gN2ToyLbCKBzBlDBEbyiFTrMKF8q8THrtyq8+2R7Pq6ie9zfyMEZUS60sWLbF3WFG4wCAN8GUZuEd482ewhmJL+urMvlY1glX6C/UWlGdkdelNVjCz6egWfJvaBdVdMbqJsz2Bg9dnLn8kj2zcp9ow5HFvFJULZkq4AIamWuk6SAKieBrsGqhybs1X2nfa+CWxu6PjfJdwgSYt0k4Msz5R/YBuuyckou3dLUdekuxIFfBt87r7I2YwYB5D0XHKzv3H5lAiHatmYoH9sU08AIQXsXSVpjOctuDX723BdsHiBWc0OX7VlLUyBI36555NlK7M9j0BdfAJPRV6WmQqWgkA1QPcPLn6AS+P1My1ybMOIkbAoenew+LIK5+1wqJDHxbo+DmM6CYj6/r9sAK5a/cSfplMmmGiKhN4OwT7iNonK7N+mJ3TIb+NZL57Xvm0lX7owcn1Cj/v+WboqjWRMLgXh5EL9o/zAr7no2xUZMqHDHfpryKIyyepdEP+fRaP1MNTxZE6VLZsEYJmO3oTY4QG8lPETJjXsaLrDNjjWpJq61/U7Sca66EA0sNLtQoI4KL2yZbdJ9AO+dJtCMIJkoNekv2YbltnfwkUpaI60opR+A9FZSS3Q60yxAdDfNbpIl6DpWl+bo1gXhe2rMDTt2x7MBfAA5S6Y1xwH8D3FpssEgbpJ2NZykNQPvuqvOeXccGXkfEhT4M 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)(52116014)(366016)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-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DWCMV5KoEPtbC6bYKDcrlvKj3reNYY/4Prpw5fUmnizUfpYVXoGGCLx+6h7cU2qFGj/I42qMn5tzRVvQ2R18IcWc8b/1ZH2We3r4rTpMY4cV62sxZUFzPTUoqvCDOby3L8lfUt9XfIG3be9JZfalYgYit5+5Njl7EaKNmgxpKTFzrqE4AdtV2kxIhCcngvQyGnBEH4Ks1ZmHxXun1KM/U9iiCf1jczM+srJ06veA4Ov+MFQ58umfY+8GSDEZKfmSI8M/34c26f0yJM3yAjj9xWOZe+QHy+hmb1ZLjh3bIp21vCoUjaLPM9n+5Hd8t/Yf2pd80cAQQIoVqm6p+zTDsnS8bEbCcXWs5MsUCit7mi1ccYXVOevNk6pz6T3gu4MA9H460BMYf99WbIZcoKDDJVZY0y5aVDuPtEazTsaqOWAYUW2XPxWEfP97Lr/3xEvJy3bTmmi0Jv5GMctiyZJsSKKb5TC/4bYgUEErV27ySL4IJm9Bt4Q13P/Ffl8ElqV2mQsevx5J+gfQnmdWmObbTLH4iwPs8/e9GrVGM0CfWJur4wwTDYhU0CsBCUE9TCbE= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: d75ed08b-3682-4ea0-ccec-08dcf2e15a38 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 21:34:47.6776 (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: nFuCPyy9Q4g14bOjJuUCJhigPbcrsMgo3R4XTZmAvg1vAVANS6yPNB4yq7YAVlRwzk9KhkDpUVE4xtmLq6S/uD0t8aRjR9uvbWzMU322gMbJJhE7cIXx4J/UcqLKnIx2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR01MB8991 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 3621f071a735..31a13ad6c4e5 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 Tue Oct 22 21:34:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 13846207 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11021088.outbound.protection.outlook.com [52.101.62.88]) (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 8A1091FB3F8; Tue, 22 Oct 2024 21:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632896; cv=fail; b=Pw7OiyIF1vntuS0aQdCxDUZu2EqptWyw0xv+hHpmxnpN5bk/FT8ceySf/pdoYFJzAdS58Om0Cn3w+r//KG2eDB+gSFRJHdmggAJrbhskMhWMmkLbEXZGZMnZ/NEe1sNAFSolPxmVeyUmItQfp9niOeUgP+EZOwOwMGME5rRYZ7k= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632896; c=relaxed/simple; bh=xLb/rAoVAFvQeZJ2UUh3DkSCfUUw1oR4Vh4V6xDf0jY=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fUGyI2C5d/pK7rIla/zuVsShtHT7rNMC6dPojA4I77ANqjt7Rh/GiUiO/U77Evwxm4809zrHjkkrNhvMNZwh68qkDFqVnxlssIVOk5fsyLRsPJIXQddalpdVXHZZZYEoxzXQY5PVZHRlEI0xnmqDCiBA9gCo/eqNaaFfi0ZFYIo= 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=Q2FahM8w; arc=fail smtp.client-ip=52.101.62.88 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="Q2FahM8w" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Iwxz3oIL2O/w/+hS3jACSF9BmiiOPu//2yq2J/xgEI7vYmihYpKXK8MBXOfFO9gl6U3+WXpgrqfABJMgS3/Msi6E/DBdYcYhQ+s3DZTwUuqjRxPqreG8TpWAKiKyqTZS++oIZcCz6uOY4AuekJTCT7APaJSc7aiAdlbMCOVN2tIGfEevuFkpJ3m48ATf7EX5f813YiyEBxaLTBKzYoZSZM306ltbiOeAuOGNXnHI660Al6gPnjBvzAzfMTFKqrRIrXaLblSpW29dkbHZufWJHneael50zsN6eYsH84guOuV9/VJO5v19oyVWOpJvRzDTGOCDn9Fo/yqeTxKfflweGg== 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=1h1gd5ujYkh21FhkeF6/fcIKV0vmkyIgGaZWBOxJPFQ=; b=OXSP/vSHWGat2zEEMXTAfFJ4JRawHd3Ztk/3joMANTcBd6KA2fVY9C0hLzsTS4PAJc+92t2QkpwejMfjRMwvWOvm0xpPmSZCKQJTfwtr0gJS+ke9RmZYf9XXA1ejZbsX2+7ON158AeXeTW247aWS1UcjT3thoZCVOthal5qtSUMxilpQR7N7jN4rONJDpI+P/4C8yoZk0MTbeF12T51pnjfoWnWFoAc3vL4ud2bL9H9lTi3R2b3qjHN5oTcRpOUwd7B3WfMgXs2VSDOH1+C0KXix5uJzY1wp2K5Qc58BvBinmm+Sma3chgkfKFpZc0h2mIBby7b6p0K1viFhKtjAtg== 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=1h1gd5ujYkh21FhkeF6/fcIKV0vmkyIgGaZWBOxJPFQ=; b=Q2FahM8wnPbKnEtHJ55d7eh9dEdbenhvHiXoh9eLA+tHZzApxSz5nShY9ZKVVE8wsFeFOypUpt3iNHFExXVk/OA+HIoMsxSsR9xO4J3RE/bTTCy4/Mj8Nxm12tOJvzc2kwqLfbZmZXAFB7jB8n4P18Y2QqvUNHi5ywY0AqzHuAs= 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 DS1PR01MB8991.prod.exchangelabs.com (2603:10b6:8:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 21:34:49 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%5]) with mapi id 15.20.8093.014; Tue, 22 Oct 2024 21:34:49 +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 6/8] ACPI: APEI: EINJ: Add debugfs files for EINJv2 support Date: Tue, 22 Oct 2024 14:34:27 -0700 Message-Id: <20241022213429.1561784-7-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> References: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4P221CA0027.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::32) 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_|DS1PR01MB8991:EE_ X-MS-Office365-Filtering-Correlation-Id: e19714ee-d77a-45d6-8be8-08dcf2e15b22 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: que8s7NswWdER17tAUj2tqvEzv7BQl93uVN/zvWdlL5FsBiGiwZ7j7R2WC7Lme19BnXnMUhYnJ7rs1CIcYbf1ic4rvekOY9VE+RH/qxEiN9Jku1duUC70n+zwN6kBS9UZR6RdDzKtwXAxMpfW72lMpF9juG1ZKYXXXdWM6Npt/7NTMPbUDeD2DGOMvzxoMAhroi/hE3j03An3WmPWzOuv2tsUWOUuYrza209xQng7bqDKFm6FxBJkZHfh0lV4REuiJEzcQkR4XmGGecrObjVyFkgurtNnQvMbxIZ2WYOjZfbW0ZAGWL4UwWYpgCUpxQCjMedbh1shFO/YTtP6zEI9qIxWXzRwZl6HaSmkmjp4P2j5lBW5dKp0X/hSLucQ6cqd1k0Mam42LrudlvIvS/UPLdx7GIJCdycE+A+ZH0wrXqNGA/uC4RXMYGtot50RzrDmLe8C0Ct2hAj7YP/3NrdgMH3poQTZ+Re/H3cRk8TUGh3S8r96KPDJdx1EZpFEv1LsOyyi0rOwoWZtnYEj6+kA4m2XdOBhfXgsLzlcce1cLTcPM/sDAvxDx1XWIBnaToEUFjEBWQT7NYQtrbHhBmobhdmN+SiHh9NN/xAkVT2xEn6e2by7eIbPAdU0Wisq5G/pJx1+Gn8yo6zyjMGXFYdVtSd+ZScexL+2sZWX5d22W48eODkYVfWh3oPBHDuAOegfysssN1/wJ9oBxrVsW79blOMzn7Nq0Ci7tL9QZlC/xgSUI9Vo1Yu5mpDPIyIJeG8VQiDV6pEBnglyKZhU/svKfSujxeU++I2R8KfSxDARcfIH8V2oLIhf01zIK8taUdCFC80N47VwBLRMD4Tyk3tgVs+bb4OrlATsjoOapFsbEWen6JK70RWG7BtKbfHgJfasfeBVa17hRjorRkyVFTi1E7lEdUE0AzvLapK/SVB80cPJ6m3eoX71vk9X5YT+NEdoB+Pbo8OQQ76TU+yQv275gBZHLgjMZ4oMTq+bIqlYej7V/7BHv57mUWY0pmHc8SfRBBiERTCQuPsZ3hq5D1radiqgZVneYBLm9+RtrMdUlnEoRpbluKJJBSn7pUJkrtVWRIMNguCXg9epdmQXTZ2rn64IPjFETEcI9zy+rHp+xB6i2W9DrYqxV+lkijudHjywvlk0MU9zA07cgCUZTWtTZUZ7ef1qh/bd+IfOA4GY2GI9gR5g8Wqq1cO6PJmHVqp+y0qagmoIYZEurzuHtPuBmHNsEih/x3an6COsqWFhrfu92jl0tvoOFR+9HT4N8epAJcj6dUHugtt/LV0QmwrJSUqSg4IT83n1VQBzfJeZwudScb0OWxQbBLzFXun/dBgz7GBh2zM0soVYz0nNHHSdfptVJXGgrFw/j6agp2uT3Yw1NrXKXf62FcvKm+Z9UgY 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)(52116014)(366016)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: a936a7gGu2RJnBy/SkGlQ8ZqbZHDa7WBqHjm9iNcCKXeVBzmNeHWjmzl3WQCniRryrmLmDobXOLvNbp8x0ggMHr+SFmih6bChlPktjIYZnyy0G66Q+j46m984e5P/xktMm7sI6ZCEqIcVItGXiHGTmK0kaEb4ETEjajvLsSynMIaAYR1bFDRrmko8fCJW3tETSW/RSIXuuyKy7X5Ur92dJdhAx00gt57wSduS8D2ky5cz3qBU03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OvX6fHGnt9eKKf489W7G7XlbUb6SoqOP26ThMqrlHK9aeZwf4NGGYhtJeVqg0Ud0kfdrw8lNZWFoAp8+ZAFSToIv5kGZiQht85JwSbpC9TCWW5+IGLq31+bj0My3w5H4N0tY+titmR7l5LeYVMjxe9TvvDHgkM1usHX9ACYbInzdvgOexXR3lcPFT7Vz3H1WqKTDMK/lVEVIGleuokKvbv2tB+4ECnO6kc/Dvzq1QnO59L6Z/H4WrHjCMtdC/lByNbop2Msed7OiLCOpcGgpAfXzRbQtxxkf8Enx0hpa1gVwT3COVAhTAky9zgznsAi9Enqxh7ymaEoVk= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: e19714ee-d77a-45d6-8be8-08dcf2e15b22 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 21:34:49.1652 (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: RdPoOvxBP363pie88LQX7rqjVFusOfzELCTmduN3msrR4jBdtpOlFykvCqWrkvO/yYugsa8olrhbxvt2s2dPS2/VnhXYvnoPfv3lR+j6dmVCSvK6Dvo2a8TBQSwsdWBL X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR01MB8991 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 31a13ad6c4e5..bd46a611eef7 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; @@ -857,6 +861,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]) { @@ -906,6 +923,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 Oct 22 21:34:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 13846209 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11021088.outbound.protection.outlook.com [52.101.62.88]) (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 440DD1FDFBD; Tue, 22 Oct 2024 21:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632898; cv=fail; b=VVM4qGMDnqUa64dVu6lPOTXw8X8n4wcsLXRm/rb6SuiRRc/UgcAteQu3sTRUgmiBUsC3tq5vYSFNcV+ZxgDyowtb6n43g1YTXNMSvMbXxmT7TS+ArOTSYiyzG3/0tEfBarDjABJGJzTWER5ziWHLj2Rx8d12esr5Y10ksl/Qvgo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632898; c=relaxed/simple; bh=RgTuf7Tl5pCEkoTFVkO5PS7PfcpZervL8uKzE2ztS5s=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Y3pJJwaIYXJPwOLn0O/ILBi17ZQFzWlBDFFti+Okvrn8ljhMQOWAnujK28fLVA26/uyEeMLo/wskyUxuNK4X/tbY812NwyUH2VM8NwZcrt4w/7WzirkScQZ3/0Mcs0JI6Vbzf0wvEgYmgZrllhqkjn9jS+z8kbu5WpZR0bCwNVs= 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=hmciz4bj; arc=fail smtp.client-ip=52.101.62.88 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="hmciz4bj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WkxUkCoH7FjYZEuCSfLdlaiw9zAa8/juZlUHoVwyc5dTua11ba+LpK2v9G/glPF5egMQHf0R8/IxoMYFhbHDj2K4q1i1g2HZEs/zUfDNgUMYmcPKXcGJhYlTgbgdBRzGGBa8R7Xj8dQQLVhba+KxAzeUA3t+mOR5nUeHHhDDRUWFrYM3waJrd+xgSNG0N/neQ172ub29nJ1suCitBwpjPWsLucxvQpAOMxoMPBcVanqnZ8SX0KUVK9mgxmnUpgkKhJpWcnW9YbK+3YBZObeKjrYpQHqankkusQKbjwswIPmgmqGTGbO4Eet1jrqKat9oshj0pADuC7AZujztUE7s1A== 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=i8SU1tGZDZpK2DWW3QVJUYW6fVUfhNKfppdBc0Q/KrY=; b=l1KITH5RiZSUTtjsTX8h04TmwmUMHxtf75IydSOwQxxOb2/iNiGaQ33brNkt7asKLWScJ6RUTIjLG6+/VroKaj/2Yc4oBkIGmV3DjPYBmIero9hlZWefVNZ8WHo8LYig1ucZG80HFsLvs5Qu/TF/LggzJh628PbBVBDjrCGS//35yiEJEO70Cqng+fA23BtxWs10ozfk3MP7nzEPDTzbTYNXUmK/pYcR6/dyU9Flyl/w07JVM8mJaf0B75zjpWI6eHCWnQkJzev+nC1U2q/q8NARgrrxaMfe0HSHtISz7tsUGYZc2ln8IWiXamYOwgc0/gIueW+mGws4LWLePkhrvw== 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=i8SU1tGZDZpK2DWW3QVJUYW6fVUfhNKfppdBc0Q/KrY=; b=hmciz4bjQSRlD8SnaWNk4O0DQzOWAD8Yg3Qlrinhn0gnlMTpqGjWqa9sv9QLKg/QuxN2CZmDcVdSWnMO5ECjAPFPa/YX+sYA/YOplox99NWqlyhDkGVhezevmV5exVXRFfMuCHYiEnm++iHvc+CEbPMZubAJ0FHhny9BSrgLRLw= 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 DS1PR01MB8991.prod.exchangelabs.com (2603:10b6:8:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 21:34:50 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%5]) with mapi id 15.20.8093.014; Tue, 22 Oct 2024 21:34:50 +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 7/8] ACPI: APEI: EINJ: Enable EINJv2 error injections Date: Tue, 22 Oct 2024 14:34:28 -0700 Message-Id: <20241022213429.1561784-8-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> References: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4P221CA0027.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::32) 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_|DS1PR01MB8991:EE_ X-MS-Office365-Filtering-Correlation-Id: b3e51744-ad9a-45f0-17db-08dcf2e15c11 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: TxBaRggXdPNX78ihY1rEMgahAL8Hhv83gR36/kRZ/TeGo+3bRrt46ET4C/wkBvn41e9XnWJQpS4hBK8EBzlhAQ6BXwExZCelp9k7IVpJ4hQyZubPSDDP7okepb22XI1GTNsccHBho9m00xzVE2A7eNAAgq8zc/s7DhuNoWj3RDFfK+OmbkpeghpanwE40AalFN3MlnL4z/2zHtn/YdZspF6kEVAa3kmvNlp/IH1DdDyxgjyzSoDMn+nYtWYJ91YeiJLOOmd/RoGtwen+3iTAosrw3ptAdmaCxqRLiKbusIrdxAWF5gpjFf2OTXeLzvT3A+dHzwNAXEh/UqBXXVBykTUnQhq+EZ5Bp8ocGu1ZlPY9adHlvFHCCUxJ+KVNPzrwiY/3bP6C/C/JnHbPkqI6pznw5S9SBXuNIu7gAvX27STVQ9QIVf+ygaGi/ZdycpdQEoTqRWWhtl3EbLW2PB0KfZBmR4q3OL7+FD0G3+dQC/lvtDa7Iz4HZjic6NzQJOOizHgN01fDKwGTyEcFpkg+9Qe0t8fteNhTEm2GvzdEOFf7JoGnRSu9IXe4BsOiH+gFM9XyVCXwpgWUwBTyqya3NjgKrAEF15bbzVBnRZZXOi9LFnez4skFRX5sjyY1TV26qaOO/pf9wtK4RGXbRAZ+BtYlh32+bEb8uWu6XiLfrtmcwROqZ97vLZe2wTtueHqVma2M3ELB7AjYwKGlFC8D6Rm836eJQXtBW0ZM6ZCAVhpXeXgUJ6vlgwlRrwXutylhZkJvJcAFXZcxq3CLjR9H68fgaJmah65AzmARstWsVrsa++3GxqKircYa9Grnr5Jx8HxcQMNTY4iotvg6ugkeqwTxalxHlNK2oBs+m5Y0aFH8wjvvPGOmvw8WUyxkGep+uqDcTXFJOa7jC/UCS9yXOj9pWCTpvOcWxuQmCUC0Ld+busmYvS33keAfAkMblzEVOXbq9ZucD23XJF8goUGFSWavjMjb1yHvq8mvOBLVyia3XTNKr0qIc1jOHaGEZXtqsAeTONSM5Did990ZyXS5iGdqzVApbRi1ZuXpIf6HGblAlczDla24el9iTd6c0piod4DceMt9Y0l1A+R/PT6jd9FZvgeS4AcGD4/yc+htvm7RCCZvIfIRLCSKh565uF6vn86Cpz0bXcJ39zFne8e7J6cRh9qrZD8gww3/fnG2a/VKufJmmOnFbIbtXVIzB1MYAlDTAHI6oFZlitf2CHUUzhC27z11QLLu3rx9Ucn9NDw0tGPwGdCxBxcxVoNeg57Jf/v0dnIPfL/3n1Mx5gtbgYJkVj2REXjaz57QeZWpkQlPYsmfYE082yWaZWTTCWM3MVRhMvZPeWYLUZ3+YMGa4ntOrY+a+psVDEhpqvBk8jz7M0IUSnKqF3U5VtHos7kz 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)(52116014)(366016)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4Dn4CXDcs4dRc0k/29u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09l0KUqFTX9qP2Q9vGDdfDWMfKmp3vTNKmg91CrQp6tby/2H43eCow+tpEawJwvstICuwWlD4UZV+1ftpOIp7mxH9zUES37cO+0TILbJPuRXCKK+/L5edC75afdmcHT/sou6HkBtUtDthe7mvrrgbVx6/5KUjQjf7QBtjZsSHek4s5rzxmcobZ+sKTooQ8mkY88E2/01m04XuNmH8hrWhswO4ZpJKdJs9GbcHCQ8RAYWL0z7PFuxbaEm7yYsP/nnn2TnD/CweRX+/LRUKrAfeZ082ECXJmaOaS7DpnVyFdjetZ1dnMWSqOX7kxoun0GuLXOBEeg3yeHnsOVpA6/2BtH8VPq1wYzN8jKD4dLbVmEs4vHICml/ppdgDbeZ3ImnxwxxzNNiFIJhccj5r5P+yr4noNFUkE/BtNs47lbLGyETCXDyyb+BYxolHkiLPtrJTDPmQNq3GZzQyAzU+LtAxyfwodA8tqW571Qs8JLOe19hnfwbmyUiX/TopiIxv7ivfz3voagdJUj9Wry6Wg65x/2WbDo= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: b3e51744-ad9a-45f0-17db-08dcf2e15c11 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 21:34:50.7503 (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: hJBm0NqCA7t6jHQvsOeg90/K7CEwe5M+SojY9tfShvLpjJ83991lVaRXKNrXtqo/KGseQ0YTgVJilTmeVufNqwt59Q8LPmiHnG69+z0vyrZio7VQZBOfwDQ3o9iiOW1m X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR01MB8991 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 | 76 +++++++++++++++++++++++++++++++++-- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index bd46a611eef7..bc833f42dfc7 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; } } @@ -496,8 +514,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 (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) { + 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 - 1) + 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 +629,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 +643,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. @@ -913,7 +980,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 Oct 22 21:34: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: 13846211 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11021088.outbound.protection.outlook.com [52.101.62.88]) (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 344BF1CF5E6; Tue, 22 Oct 2024 21:34:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632899; cv=fail; b=mqviea2Jfmf/OpkZV6Co90vOrBbYejiYeSnX116WVRE5TrJikpXlOeyIJQ+9I/6ZQw+9nzlSuiwlIFeySrN3maicWIp532VkEu8Ruu9fUxvsb+T0dGazDJrHKuA0VQJegF66tSca7MdDd3T04Sbz2ZFxWZ5r/+xeDeDAYrYcuME= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729632899; c=relaxed/simple; bh=iHnv+npEb3r+z1QzrBsfyz29acI9VLmO7cSjsXE/b6I=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=sgqGwG2EUEN/m7pTWIiTBy8yjQAzSl0ZnHVHx/tTQGPyaD153SPtRuuQqs6PAfbgxsaZCzPbQH0Vur1aSjJzdNeEgSbk20KX40SYkUyiyMAVZrgLolM3DPPcp8fg/dEuIR+tMCJrZkUL/irquzalNhHo1HW7cBdtFKVpWVLPWF8= 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=JWZTQiKq; arc=fail smtp.client-ip=52.101.62.88 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="JWZTQiKq" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MkzROVvCUuioLi+KKF1Eu6d4oRnXjXN2jbAJy4E8QbBTfwUBDEEd82QAloekLiXv/LcqwYwVmxVdL9D4CWetx1PBIAPUleLQHN5JC5/UIJoJnc+8Sqb1BSkfi8+vGIpcFms/OYXAHACuipmbf8I8kRbBJnKGPhvixtLMVWmMpIkm3WzticuXW9pksQbgjUaZX3eZE7uhkPXChf6YFgDY9eL5DH0OLb1o2lVEQg1APfPGiuHVFnJs5g/ggkDcbRzAusMpOMAnZIIMqNxzqrvTeygHp/ASr/WZSMav1kFctyHuJGYGePdEKGoVoxUzqVYzStNDPraZDpIcyTxvA/Wxwg== 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=6deruYvRe8MdBxifjr6eImpHSrNQnDP9yNtvWcgGjfQ=; b=d7UjphpFxSvRSwwzcDSnTcIPKXgDqpMMnwohTGggRjww65N3KHysHlM+8ZWTODcOOaf8gIustCyU6B4nn88vU6UscZP7QfHywYZHkSQvYD86FXqhHuOG7zCwFqjN/uw/3YLN34IhfRukpkBAzROtYU+muwHeizPBHy62F7W10vD/AVfxNUi9hvI2jDkJqJC9B+zNIB4Lsb3jwQNauJUBT8baBUsh4L1mlLnfPpafbDvZGIVjzlwvIDMfTuzHLBAABpvsMd57SIDSMc9fWCtt1a+KeoBedxl7NYUQTwuwmuohUuZ0OiqitZUz6Zems//cGLb5EUDEb0SpPuiOaYNggA== 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=6deruYvRe8MdBxifjr6eImpHSrNQnDP9yNtvWcgGjfQ=; b=JWZTQiKqJrGwmcu0+p7/zxL6v2vnUvgxBhCdSxmpIia4mQWDLi2jEWWNtkL4rcJEm3izgo83IJT+/gl3zAH2nFi+lyHVgZzbEg3QXoXZoRp4+SAzcxFiaYHSEVgoJfM3jlx/6xL0GPRSL7H+svP0gBZv3pFn1BEexXXMgPlRdX4= 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 DS1PR01MB8991.prod.exchangelabs.com (2603:10b6:8:21b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.16; Tue, 22 Oct 2024 21:34:52 +0000 Received: from SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f]) by SN7PR01MB7903.prod.exchangelabs.com ([fe80::cf45:9855:a64e:382f%5]) with mapi id 15.20.8093.014; Tue, 22 Oct 2024 21:34:52 +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 8/8] ACPI: APEI: EINJ: Update the documentation for EINJv2 support Date: Tue, 22 Oct 2024 14:34:29 -0700 Message-Id: <20241022213429.1561784-9-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> References: <20241022213429.1561784-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4P221CA0027.NAMP221.PROD.OUTLOOK.COM (2603:10b6:303:8b::32) 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_|DS1PR01MB8991:EE_ X-MS-Office365-Filtering-Correlation-Id: 58d0e2b0-d617-4689-1fdb-08dcf2e15d01 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: lK4R6qGanLMimTkA6dC1N01HoVjcaftACYQHGallws/4uW8oDeelAO5Amv3lk3tnjf8IOwGaOUQRyrcKR5woeeZ3Wadas3dq3BKIs3zyeMDz66b9wcWzkHj+0srKkc/OuVB7gBs1GNuANVkipLpeMl2Oa0rOdm4Es5nnB2UX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uEkIMTBEp5MF1rUfgrgc0jOYpzugMP9EO6qOxcVeJSDCeMAz9YVy4jt9t2O55ZU9mdAJPpZK31GMPH8qoHU2PzWUZG7fCURitWkZxNlS8oVbCfUusQxfrg== 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)(52116014)(366016)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: o7KMzdsZItmbjz60o8GT2pnsilOsD7OZ5k4vxH8xVPfSnM92gQmINqybYeSlROaoD9/RzoMUETOwDOrR66+ujv3Ztbz4Ht9UJ506NiQ5Fn/idOdjQv1eOWZrw2PXzopo/s5QycpnFZDPR2SLMXJwHpKBasswQef9WC5QS8vZyRY5Ao6Sa2ym3eXqY7uk13kdk+oZGjhqqHR3Wch+zbfGaDIYO/XUHaye+uMTDMTW6EJz79mCcwFDhunUhjlYQ1UTYycaDUxeSpbncu+XQVjfwRJcqYkD0Vj83I3ni6pn056XNL2Mr6BLY/T7SaRIHn38QJVHcxqmWUXOsSTH8k2TUERcmiPFxx2BDc3/8JaV8Nfvn7mMdsXG4RqHjB1O80CdtSgQfAuG74wUGLaRiimnJ7qyfiTdT2zMxBZd3YeHSFyl713pZnN+FaPEUGRn+z67BBOn+NjXKeMus0N+LkqkAYeAmztbmQfGJPyVZmV1GThLJjIJDdy4y2Jw+dgz/jkejLPNEX4eqe1PtNRhmjPOasvrFL9HOJ2M39I5Q51n8k03NDHaNzMEqPaw3axFtf18rAxbChPswAv8JLmJZgxy2mYuzhCPir2tItsuFv8GCORCKA52jIX08fjEMz5T4p4oWUAU2Zb4qdcs5YY4h4URIfW5zq2M6HDhMyW9wy9MYd620iRehVna2641FZKuGYFFjKgfRK0+NuDgDgXCaWu/NAi1EhMt++1C3kpufUUS1IzqE17QzpR2rYRcUqH0EXPgOrHn1BZzpvEMC/x6FmIvPaVro2Nk29uDD8oYOaV6VvDW5/kVAvAbtppbVAIip/MmGBRSxW9zVsJ0zkHi28OGEtant4JL55nVbnj+a54fvqRGhlz4sD+d4Eql25QRowQs72lPxQQ23rMUs7IPo9BUA/KNg+xC5D0kU/lOaEGlKbH9X9a3TKdSpWSZg5ZTp9YZFaZ/gxjC6bZIQpX6DfhD3ieqzL1kvsN686VlZJ+/NcrVD83d3uGdVSWIss3lnYcMOBijkewSK1gSjdhs1wXUY6J3TqjG0EI9wQGQ1Fq9CChmVlYK8WX0KRIAhA7lDSmK+TQvgiqzxzblZlVdGpRZwJHP2EY9iQWirSbroLV/nJzu+oZ7gY7/si/bPpTgdj1M9FRR/7ROIJg3xWCwbtpSIMVXcMVNUgswb2qNQsCS5wwfxC/uXYFrRvJ87pJobOCv56C8N10omwVwMEnGrZOWBEqOHQaDvvh4J2GS6yH64Swlt9rqs3mdF7/agL6jREmjnZeqcjgQxKKrn2yTa4byjyXqHrrPHsIIqLT7pEp/znGypvhKjRtPdirmJoZwlNyvrZmKipjFRkZva+DfflYve55Qrkqgl/vwo79mxeVjDz6SvOnRy+p8bTXEfLFgBrjJyhi015RTxMLJIpzuj6Cvms0zisuSaDj/0s5nMX+zwjAsBBp3XxIkpxzAMLoqEjhautZNBWOd4mdmjZmI/hvVe8RuSbvKt4C9fGOQjT6ag5pzzK1qoKPJNFIIQyxblydAFLWGPzgNSblmWfwSxnQANgPuJjhLYmPGG/PlxpwzWhkc7NhKPbVTCHjeWdVHdwaqFvmpqwYUY15SVGogSvP4MMU9Q+xBbQ3S2KCzdGNkhzk= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 58d0e2b0-d617-4689-1fdb-08dcf2e15d01 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2024 21:34:52.3130 (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: qyTECuYg5rsLvhPyLRBCZrq9UrVKvkFvoZ/uI4KUCXIRWO1TOk5aJIm56FgRzL/W0/t9nOpMKmBLq97+8NXiv2P738021pJ7CHlKIgQgnSIb98va4op27yMLqOQkILSX X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS1PR01MB8991 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 | 46 ++++++++++++++++++- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/Documentation/firmware-guide/acpi/apei/einj.rst b/Documentation/firmware-guide/acpi/apei/einj.rst index c52b9da08fa9..3ad092111035 100644 --- a/Documentation/firmware-guide/acpi/apei/einj.rst +++ b/Documentation/firmware-guide/acpi/apei/einj.rst @@ -61,6 +61,14 @@ 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. @@ -85,9 +93,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 +120,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 +133,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 +162,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 +216,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