From patchwork Thu Apr 3 23:13:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 878000 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11022135.outbound.protection.outlook.com [40.107.200.135]) (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 1E3521C84DD; Thu, 3 Apr 2025 23:13:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.135 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722037; cv=fail; b=k1QhgplczMxS9OE8OYOXDOe71U43Dagq6u9RVnyQbs34lqCKGL7BCykgLo7Rao/EENorCV9C+Q9wUVp73KwpJ/8/YeknFAFTCxYJ4N++HDprJ5dMrlvQtyoxaC7RyvD/xGkx8WvWVfPfhgOk+1K1wqfcSUjzZ+UMpt0m6LBUX14= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722037; c=relaxed/simple; bh=rh3LiFDqONhqT7lgtvmvw+uS8ZAgywTqecr1wuFjXOs=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=pCiYtAI34Dh19EvZ6ftO2oOV4UNu9OwX97t5q4hkqd8oEp9IxT8cUgHhR4NlnxjCfrTJLigVE+8CQfMMll8mKsSpP8b+x5ugdKKTw1NHJ4rtMun7ut907iLJbj8J9WsX2dzybm+t2h9XOYoxbLz9XmkYRtgw6zrwqazRaBnrEOQ= 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=UVwjIGps; arc=fail smtp.client-ip=40.107.200.135 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="UVwjIGps" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VMNlPMCu6c68DDsNnjdNUDsvSBm7l+iMNfHb9V1sE3yL2+agp58V0wfVLkku1S/KzWd4/f3lF7sBEcmZP7OkgNaNSfqFVPYzSTpl8FDQf1j4ElYqi+jzRCzhMrctdDJJskcgCPtP1EwVjRM68gfgt18x8X7F129WhVDSPpWANEGcnF8JRQCZFeMWIgM7sSu87dLk0S1h4XHqHZCKNl4HeJCdhz8uKcuvbsAUFvSUnw0bvXE+coIMvflqCNtSIuIGCbhXsiUfsZTW4Ll3E93xQ2+VGgP7zapfeFhHR2STGjOKQVY6G4e0bB64LluQE8/nUpwDesvU+nzMCOWauDyktA== 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=idYXSRMnu88WvOUoU1ZQinvDxg7UkQZgSz5uVYFZ2OY=; b=MFz2U+pQuvQo2hVyChzogkuthiclvWsFfBe+hUZ1dzafJ+wrlM01inC6e2mff5vcIRuKZl6DWjp1L8gD+PATZGKRIU8fM5YymTuJ6bGCErxTFHynTxNENWxs71jFuWQtv44Z1Ei3fivinivauKvBVM7uG29L2YwSwfAKQNy7iY4x51F53HlpttTz1UbgvqFjGYqRqe3aM82v+z9U6Jnc3OGSmjJiCyz8HWdV1ROghnpwMIxvnoQlo89fvKgBy71EyMZFqHPPpm2YfNXwB+Teue1zFNf31nDCEwotAl15REeyQHTjmOI+wgLzKBoSpiRZoWLcrlNtiL7pVo4etZHylg== 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=idYXSRMnu88WvOUoU1ZQinvDxg7UkQZgSz5uVYFZ2OY=; b=UVwjIGps16/QE4PkTkDbJpHcYaX6y9OwOB8qMfiBle9aMS3n+L7jh0GI4F94ucxOTIUnBPcUHEopTY7jf5Rc4y9Q2S6FIk/hgMzS/a2l8fAQBzk326fRLKdokjoaIWpc9wCP2W7ZxBYCQ0A8v4ORuEDvY/pqSWXO/zTME2E9+HM= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:13: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.8583.041; Thu, 3 Apr 2025 23:13: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 v5 1/9] ACPICA: Update values to hex to follow ACPI specs Date: Thu, 3 Apr 2025 16:13:31 -0700 Message-ID: <20250403231339.23708-2-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: 73608f04-2340-4285-3933-08dd730532eb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 7soxUSA3VfpTQXpzdPbddEJAQ1TaWsUacfIlmegcgyrC9MP9OYCdMHltJFD4ka1IkmsVzAC8f9WXYVaHy0gRHz5Jox4kNkn3TQcbg+GGUnbMKTqpjtfuT6d3YTM4ByRaxTuc2oW094YAvqPXAea5lVvgnvh8g0ruQ1+qimGI15lxt10blqr90gbo1nFe/AvuSShKVRwOX7hIAH1yc5mtqRlsuUDYN7S+Tjct8KSN6MNs5z3Lo1o0FB0Ijzufv3n+pl/C8juvAjZi+vHsSPauW5yj0PgrZt4mRFRDKZT3QbbpbJZhXx/a7uGrkOYM8CYyoNJWlhk+GWhLziHz4VOxVHRTQHw3ZTBVJZ+iY6A8r3c6FUlaBBg0FscM3xG/UIG3pp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RVXB5ji8ZYqQeldn9xoRhV1yXbGcyJy3POYyxA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Of7W6nMWnKKzMC9dkkQiJaXA+m7kwucKRCcOF62nBH1mF34XsM+ckHjgKKBqS7urnmBBJxmQmH33SZfr6eHUfrzLooOlMoNuyZazlZeF1Yb4Wn6oHZgqdQrLRvWoJuIkhrFmB57zHJAiGz6N3xIqe13OGtNJgoUGvFkIaPybeCW33PDpsArjJF1kCMMiAzLgt0eK+Dq5HIIJq4FNOs1nqE616d56f2pJfSUS76AVpiJ/Bpwg0cd5iL7VUBtHWIJ4L16rnRdIWHfiPvhOFbSlRoT6cauNYxgRiVyQw6GzhQ7j1tiOlfWcgpmJ9s7aAz6XklmD3LcewMvnw3EkHKwcrZue7/GK3o68wJorIjOj6MbawRiErSV03Ypw/dEUeSYHr4zHTJHf/VYZ7OJ4LoBsde/k+EBWKQiAj7onEneCrXgE+PKB2WDvJ8YqJWrmrjHV2Goh0w9RVrijRRb/MgVG/iWn7kz5XBcBQk1Ozrhkn9Fj0ao9rigbANQa1b38Tnwdaxd40ZW4HDJTdTsvKVbQQS9TrfGd/E/JOd0hjkFGXY+yuDOai/c9DdapL/xGr4qmTVqVqRP7Fn4OG90lVrekzckScYwbYWGfAo1jaDU2C2YjjCmoWg/Q/onYAoIzc+PkobX1Aecv58Wf0NH3N8LMTgTSjhPrnNK6yf+ZP+jG0bDqjORfP7u8q7HsT0T4IRRL9qggxdXtGbHWA+eBJCYS7CssxtrDq2EIfMtM/rIwovgKsOWM86ZU/bJmoCkQiEqD3w/uyfJ9PAZToaiITEZkRY/BXukKJ2dp5GCyZteYgS2GjESedi7nEUeW4O6jpabHs/oKLXZgwcvrpe4rBV5RGdPKSCttM24z38Xx6DViG4N5f9DSJ+o1I7G3CRTf3d24jPZ75relwmO2ea9bVeRJ7I98nEyeuM5geBV+kJYJVeEDLShmZCX8fCHpdObXs6JVEZz4NQ3Lqn1RRHA0D7XSVkIOkxkIzl+3jYJUirRLB5jjMWeRExzlKYquYJ2vzcx2BBgsPA0b1xDTHRwDM+2pvQU8KQCfAOfAiQ+Fy89HzrWyDoBPXMRy3NZWZ1nsF6h5g7xns4rdzSpMkbrbgcRrp1MU1kkhSHPlfTYrwyXIlqdaTQyjkAGDAYFiz3YvoJ/hDdO/Q/a1WStDltsPRFdk70AIdoTUkFaoPg5Jj3MudqQNP7B+PnVbkkYSgZshagpakZ+hnW89Lg3i4ibK/dWbTqUlEM4Fe+dkoinhtt9RVvkqC7bFjqWIzIohDCY9cxhWrKLDaS4GwiEEmbZ4z84mi1UKq9cd3EMqCZ2UxjAE41tP1JoKSvHxL+I3Iu6OaOAA1LxDZX7c8pVUBd+sS+vwtWvNUzrOAUx9LOpQB8KrvCb1mbbG9AzAEkBTq3Dl90rbYvS+8c9pA8dKkgLgvr0p8dgiLWlCKJ3nRarjtHCvoDy+0njeGeRNQKn2bL1yVHOYP+0bMWWfk87vixfYagm3AdqKqL83rrDngwZV9GLI5jNMsQXU+OPb4lrDWc1/v1c8+rrQKwH3HKEpgWTukSNTFX3ezqLtsmAG3TOy5lZzQlyA2YkxrEfmW5PEYDjAPJNYBsIMyli79LPRy0FBf3h3ZH3vMsrfv1nhEwMTxYsgpUE= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73608f04-2340-4285-3933-08dd730532eb X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:13:52.4791 (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: uEJhdPyWtKIggscHYG1kXOdQJ8KJ1km34atBpKLnKZyjpD/pP4WFhMd37MDhjxuvZkRJPGu8afx1y6zrDYckFwj97ZhiExY9FXw+HVwRJCMLT+YBgEzjTD5wTFWYY4vX X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 ACPI specs(1) define Error Injection Actions in hex values. This commit intends to update values from decimal to hex to be consistent with ACPI specs. This commit and the following one are not to be merged and will come form ACPICA project see pull request(2). (1) https://uefi.org/specs/ACPI/6.5/18_Platform_Error_Interfaces.html (2) https://github.com/acpica/acpica/pull/977 Signed-off-by: Zaid Alali --- include/acpi/actbl1.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 387fc821703a..c701c434976c 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1024,18 +1024,18 @@ struct acpi_einj_entry { /* Values for Action field above */ enum acpi_einj_actions { - ACPI_EINJ_BEGIN_OPERATION = 0, - ACPI_EINJ_GET_TRIGGER_TABLE = 1, - ACPI_EINJ_SET_ERROR_TYPE = 2, - ACPI_EINJ_GET_ERROR_TYPE = 3, - ACPI_EINJ_END_OPERATION = 4, - ACPI_EINJ_EXECUTE_OPERATION = 5, - ACPI_EINJ_CHECK_BUSY_STATUS = 6, - ACPI_EINJ_GET_COMMAND_STATUS = 7, - ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8, - ACPI_EINJ_GET_EXECUTE_TIMINGS = 9, - ACPI_EINJ_ACTION_RESERVED = 10, /* 10 and greater are reserved */ - ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ + ACPI_EINJ_BEGIN_OPERATION = 0x0, + ACPI_EINJ_GET_TRIGGER_TABLE = 0x1, + ACPI_EINJ_SET_ERROR_TYPE = 0x2, + ACPI_EINJ_GET_ERROR_TYPE = 0x3, + ACPI_EINJ_END_OPERATION = 0x4, + ACPI_EINJ_EXECUTE_OPERATION = 0x5, + ACPI_EINJ_CHECK_BUSY_STATUS = 0x6, + ACPI_EINJ_GET_COMMAND_STATUS = 0x7, + ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 0x8, + ACPI_EINJ_GET_EXECUTE_TIMINGS = 0x9, + ACPI_EINJ_ACTION_RESERVED = 0xA, /* 0xA and greater are reserved */ + ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ }; /* Values for Instruction field above */ From patchwork Thu Apr 3 23:13:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 878224 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11022135.outbound.protection.outlook.com [40.107.200.135]) (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 C82491DC185; Thu, 3 Apr 2025 23:13:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.135 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722039; cv=fail; b=FRpeCuxCyRmLdGyeJId8kVKTYU88bjQx8+il4/7wNLW1kN1C0dJqUh7KX5QlPKNOlx+Ws9eji5DfiygXICKscp3Z6ceFoZfxZhsrmMczgJQCvN2kanZx9xj+nXS92McyLdHrpgsXx/lfsIaqul/r+OJCo5mKRhVvT/7qmKD6Bac= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722039; c=relaxed/simple; bh=lj5had70qO6Ow0GYZz+ibBwyDVYDGwrlNM7RApgHdpQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=X8Pg9W89ZNLMjWmEuGMhVmEW+Mfx750ONK4ixLo/UHqFhHT96uAwA2DVDWpHzDJf2mRiPhg8Yk39maEU2GXGcF4D59D09Pf5LzmXsRQw7b3QyBNKH5G7v+qC3782yrMXhrUEGEmaF2gtEB1VCBGyQikZBsNHLGgt5NI8F34jg6o= 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=WwCz1Ihb; arc=fail smtp.client-ip=40.107.200.135 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="WwCz1Ihb" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AdJGTTpRt8uh6T+5L25r13jXxwlbUYU5E4xj55FCQg1Kfs5rgqdPqQuUhwHfmnAepC3N3zq8ZKKOWTzw9XxpWfuSRBehN3AS4sIUDJzL4lkxGBIln+0jGhcaoxdqQjgvSvi0SwueLD3RYQ8y7NXLSVnwXwy7NkkBWiUJDQE3Ab+fhxj8FE5AWLwwf+9q0PM9gIoxj64ONuhzA4LI3ZJeFDmPN1puEQtmGHgCYgpnRBzm3VtK0efDk+XcCn1WfWUYYab2/nM+bMmQcz1NAtyN9bRS5qwDvzrR59M3O/zDyYkUBCnglVDzR9BwTQ1ubM9QKFHv6WpVu1xe6gz1HfVqWQ== 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=TC2Bv+57hkDsxTdhS+EBRhw0I5redOX0svtmAypV+Tg=; b=rmMX7061wHYbP4sAgHACLM5eUzz6vLimLpM28B4x+FDoDTMX7I8v33ap2hQH/UMRNC84JASDhycl11oAAiXC/fng+hv8zwykHSFDAnhJzxbEFUs/Xbg37wh0AnNjhScOx2TGtngZ+0akHdktgxVpODMoDwlB1k272pbS/x8NyEhuWezNPQcymT/oR7iLKqhMUK7fGpyW8dCGm/kzeqNxFZGTLCDz7Dyubjf6aqBHE6ZZDSLgHwpLh1gTyQAvdczIDGl6PAXaq0np/NXJz7uWfpJmoch86SjlV65K2bEo7FFbeuwLle0WQZH2taP69LOVdYbaNZ2GAmC1Z+FNxZoRgw== 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=TC2Bv+57hkDsxTdhS+EBRhw0I5redOX0svtmAypV+Tg=; b=WwCz1IhbT70A0OqtI7TAkI+mKLB1FHNUOj5xxi7/lXgj+LfWYy3kjE/QTH8+/ZOm22GcxRRs1SzTWz1PMoNWEOqmyyOgrjbPZ1d0W8LEXIqJq8nFndgnSv0U1RGsbPOh1/Of8JIFzaGbyrFFPdPMDRCjabgGDoDZ2ALVAejC5ms= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:13:54 +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.8583.041; Thu, 3 Apr 2025 23:13:54 +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 v5 2/9] ACPICA: Add EINJv2 get error type action Date: Thu, 3 Apr 2025 16:13:32 -0700 Message-ID: <20250403231339.23708-3-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: 4df1278f-40da-4ba4-3be9-08dd730533f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-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jCQglc/gFZ8BjFz7tC7JVdATQeG+qXQHEQtDCWmyFFEFMWSLCY+2oUu1utyBAPp2MLj9T0NzbjSRkgtDdnBubweklY1ZeuUcoeiaUkKsqSsi5GA5+m9e3sRmGLUWlZEYbr9zkAvn5gWvqihX2EBY0Ue1zRx8zQEakDEjSKq1+4C5LEiWCjOnwSqBVaOIOqIiTvhb3WLYtnGsenDnCpWrkfIRHPlIPMdT7Nuao4nxqAwDqC1PnMhgdwRtf3SNmSkGVy1f56XZbHQq7NcoqoP9ubifd5C+4n4hAYh9nSqhtt4iX7GSN7cxqDVEVhT6lQnNc07Aj0FGkI+4S5C2xK6m4dMA8WloeIPRm98d5X8dJwzvWqJ/JRV24F+FHpcLstp4II3uloSpIxPucca9i+pl0s7c9RvPsFDBmTAmOeLQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: osE9XjauIf3IvvOmuESlsy+frUY+Lo4qufuKdJz3+R6Cpp16t2iV4xskm/GUxM2iQ2fBcqwO1qGTU0709aZUeWcqLbpWQNtxLcOQsMYMxVrzMgJm1PGlqjTVa/IQ4OUo1Hd8D3LftbXllP4d5wJ5+wl6VxhggDxd9H31UVOzPdAUXtJr+WaxJe2Qs6rb87Jpx1OEJ+h+caiWlDDgxenAFP9uwB8aBgIGxgOU/pjVy7Cclafsq4qFC92AUYhV0ZFB7HUptwGAEegFu4s0HsxGRzPdnPvXOEpn+ED8g7KFOafwQAzoHNW4SDXxszYcYXqWz/wPcUuMpdVGNZQUuGbnNmIPuCo9v4CGL7ZgYPcLgmR6p+MEBrgKwGez7VwlWfkTBKH7fQGJkYpBwSc+Yl4kt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espMxxNlD306lE5B1vjJnuSgK18MM0rWTm5YB9pjtpaZcEl3LUErpKAmytMsd6mQPo27nBT0oZlKFFMgckLQzZXoXHaXfvMheOxFS5diLWoLFdNg1IK4VoJy2wo+gdHSfIl8UVfiQOce/uXir80UukvbrEaarJGh12VP/sTXsy3kkjew58= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4df1278f-40da-4ba4-3be9-08dd730533f5 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:13:54.2190 (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: f0ifVIXSAbIGv+PBUjxB0RvOvzA7zVgdqCdzR03iQ5Rp7bKw+NNmFLcLziPF1HgEf6nUWO+5k0dSURFukiynOufJlRVvAj6VF1FMPJlZEBdnPwORF8LNGPqfqzPUbFmz X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 Add EINJV2_GET_ERROR_TYPE as defined in the approved new ACPI specs(1)(2). Proposed ACPI spces for EINJv2: (1) https://github.com/tianocore/edk2/issues/9449 (2) https://github.com/tianocore/edk2/issues/9017 This commit is not a direct merge, it will come from ACPICA project, see pull request(3). (3) https://github.com/acpica/acpica/pull/977 Signed-off-by: Zaid Alali --- include/acpi/actbl1.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index c701c434976c..f52d5cafaf76 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -1034,7 +1034,8 @@ enum acpi_einj_actions { ACPI_EINJ_GET_COMMAND_STATUS = 0x7, ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 0x8, ACPI_EINJ_GET_EXECUTE_TIMINGS = 0x9, - ACPI_EINJ_ACTION_RESERVED = 0xA, /* 0xA and greater are reserved */ + ACPI_EINJV2_GET_ERROR_TYPE = 0x11, + ACPI_EINJ_ACTION_RESERVED = 0x12, /* 0x12 and greater are reserved */ ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */ }; From patchwork Thu Apr 3 23:13:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 877999 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11022135.outbound.protection.outlook.com [40.107.200.135]) (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 7D8171DEFE8; Thu, 3 Apr 2025 23:13:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.135 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722041; cv=fail; b=DKwSOPTcWO/VwKRmUTH/p4BrKCrZCgzPwqg/IuKVw34Wk/CQ7tFlYJ29qnzp4dZwDYy5C/R8ZKqAqM8ECWmGZOyI7prukojhGk/VrzpYqux9KVwXXDELUxmuRJc7Wt1FmwE7E7W+tdN88QjZqXh23OHWIEtXyp33aMYr04FbC5Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722041; c=relaxed/simple; bh=VVAdpMoKtq5r10b4NlijRtWYcVfAC2m80muTu6gRq0A=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=fGoDRnPHeoxl69Pdu4JWW28/vV5gkji2siFS+uPP8jgXDnzk+ZPKbRTbDvSyLNM2NIQsjOdd3/mCs3X7z/xVKJqg+d94Pjzg6mQm4YUUtYqSMmeBMKGKGpc3uoFlx8ko91tofDqV4ns9hZWCWKGDF9LtW7t66eTOIj7EOu3nEC4= 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=qpWHjDDP; arc=fail smtp.client-ip=40.107.200.135 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="qpWHjDDP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ZdjRfgse04K1uQB8kvcpGpZWXilkHO9QqHpcHtEZFnbWbGgXGG0VOFaEX6rE34oQvGGaRzIB/ssz9gfOEIxJMK+LwCw7yMoMVO/UxdTHxyJFyWzRu2guToSOb5E4dy8gctnszbR/qNU6/GlC+gUAIGJE6uK4ltKwrchdQjw7UEG2JdA8AC/EqwPptSsawD2sMLrR8MC5+FZ6ra4Mu5xp4nKvz56eWSvP6e+o9JJXP6w/tPZuIf3iFl7hzsS4lOP8L92efZ9/4cnuOfoRvabJZhtxDghVmPcVFVM8FFd4cUKcUjfFuI+CjZ7AoS+8g8eaZ6DOAwjAA8fIWQfmOrQagA== 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=+1rt2CLKIoLvqMTWoPf5gSooH/yfnRwwg7rs65ofnSw=; b=i8n6hImL9nGwshxWsQq6HccE1SsXDEEBFkvbHfWYLTkvhseMpAAMAuzRE1SI9EbRkBuL3bHhYVsYCzr7sS2lHD3yGNOFe9mc4sC+wbYFKPI4JwKIJzaCfJ4n9kbtS0797y/PxBJwbDl4qjRPkVuzMkQmQsBhSRFps11uz30gNXc0glYrMpC5h0tCuDRiDHvX5Ze0EGgN7Ncq3epZsPqup8Gc28qADREDd9YfZRkff+X+bcHbhxF3P43tqzHhhlJeqpJqHh7DWssPNg5rCqP6O4gGzJIYjc0uApUD+AREEtQLDKxtbHDYipc8DdEIMNlCdnYhNTmu2WdLUVYCcFbP6g== 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=+1rt2CLKIoLvqMTWoPf5gSooH/yfnRwwg7rs65ofnSw=; b=qpWHjDDPC5HhepmU5wl13L4iiy1oHv5FJn0dBUtEoQkX+tdQxziP1xDds5VwRxzGabIqBWtbwkZ7QUMjxgf32E4LOFWUvA9J0uJLqvfEDADWdb1mS/oW1yqShvB5kKi+xJZiZXsGmuDOgDnfJQcq9WHIkwUqkl4s0oG1/6PH0dE= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:13:56 +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.8583.041; Thu, 3 Apr 2025 23:13:56 +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 v5 3/9] ACPI: APEI: EINJ: Fix kernel test robot sparse warning Date: Thu, 3 Apr 2025 16:13:33 -0700 Message-ID: <20250403231339.23708-4-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: 750e9ad3-f457-46af-752c-08dd73053506 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: LJIM/Qiv8Y3DTiof97EtN6iacVRS+fJ4h1gJNFe0aHI/QEYG2gh6hhMO3dFnldjvAgin3k37jwGi5nlGNHik/yaY+tVSGrLpilKd6oaxEfTXPydOyyaFuZHauG/CT+b7c2rQ41shgV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RCYKkzP1qYLE63Ye3JLRGT8D9foAGXBnJ5ljN8GSJkb+cF5GqWoPV11bT4eNzYn1k4Ry8Z5OblBTHQXn3qPEWBeE1SwnsDIGH71iWsiI/SiS9vDIhA7pjRlW6lM0qdCe4AIdKF4JMn/sSSrGrY6/9UgwWCJU9lDYoHqd8yg6yZxu3RdFKKD9z20aW4VJDSVxAjCDKIlZwPbHXuUc/veT+cQmvTvz2eOL3sP5p1ruotV5Nm+JYncQl8VtKKnVa45SarKos2jOoMqf1cQNJ4p2Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: tXjd2P+1utnoU1ckbQXGhxXVtTRcTa4tRe2tEAJ+HvR1RqwpoWPsoXm/6lDr6eynXCXIs/dvDx0Ojp5ZPNLtn1R6o4SlKM05c2g4Lgcm46og9E4uTLdWU3nIyVrCOD4RDcoC9gRMH0rGW6l5RIMvLM41p9eCoe5BCbZcJKFHKiHkKU84bpelEFykk9xD+d38/Tjrg8YkOFe9Ra2+KE02YbrCNLL83+RBibahMSSYlbT0foLRoi6nISF9XU3cbgmmfyZ3Jr9WMSrTRt9C0dRH4F737EmpqfkrwCmxq9zKMOb3pjChUeaLujvjF2sBsKmB8/QMzpboZAOnod1OnZpfxYsmiMh5T2xpRxtVuH6MclMbhsGktKBuh99jWcdKIQPZEPRHHr9Njn9cGNwkz/ajE8pA0BzNOXYdGnnq45AY7k94kd73alFEAdBsK18SBhuvWNNaN8385b8q/F+r3M+EQUTfT095hH8p8thxPHKF55qEb5LTTbMnUig57QwPrf6hEJOqBYO4i2heiRBGK3Lj9Lvt/oZ14JDwzCaXo3rdjf8s8JLjda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kA= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 750e9ad3-f457-46af-752c-08dd73053506 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:13:55.9477 (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: AGAsLviV909sqJbDZ8wYjfVK6IK+kg1EyoYCfVAsDEtLQHJCLBrUKd2Kl4k+M0ZpK87sCPSD+wh2oY1OaLRcV6c5v+1K/Igf8UAv5WAgnAp6wd0ZkscIgoo6iTyJ0KQE X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 This patch fixes the kernel test robot warning reported here: https://lore.kernel.org/all/202410241620.oApALow5-lkp@intel.com/ Signed-off-by: Zaid Alali --- drivers/acpi/apei/einj-core.c | 106 +++++++++++++++++++--------------- 1 file changed, 60 insertions(+), 46 deletions(-) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 04731a5b01fa..47abd9317fef 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -149,7 +149,7 @@ static DEFINE_MUTEX(einj_mutex); */ bool einj_initialized __ro_after_init; -static void *einj_param; +static void __iomem *einj_param; static void einj_exec_ctx_init(struct apei_exec_context *ctx) { @@ -214,24 +214,26 @@ static void check_vendor_extension(u64 paddr, struct set_error_type_with_address *v5param) { int offset = v5param->vendor_extension; - struct vendor_error_type_extension *v; + struct vendor_error_type_extension v; + struct vendor_error_type_extension __iomem *p; u32 sbdf; if (!offset) return; - v = acpi_os_map_iomem(paddr + offset, sizeof(*v)); - if (!v) + p = acpi_os_map_iomem(paddr + offset, sizeof(*p)); + if (!p) return; - get_oem_vendor_struct(paddr, offset, v); - sbdf = v->pcie_sbdf; + memcpy_fromio(&v, p, sizeof(v)); + get_oem_vendor_struct(paddr, offset, &v); + sbdf = v.pcie_sbdf; sprintf(vendor_dev, "%x:%x:%x.%x vendor_id=%x device_id=%x rev_id=%x\n", sbdf >> 24, (sbdf >> 16) & 0xff, (sbdf >> 11) & 0x1f, (sbdf >> 8) & 0x7, - v->vendor_id, v->device_id, v->rev_id); - acpi_os_unmap_iomem(v, sizeof(*v)); + v.vendor_id, v.device_id, v.rev_id); + acpi_os_unmap_iomem(p, sizeof(v)); } -static void *einj_get_parameter_address(void) +static void __iomem *einj_get_parameter_address(void) { int i; u64 pa_v4 = 0, pa_v5 = 0; @@ -252,26 +254,30 @@ static void *einj_get_parameter_address(void) entry++; } if (pa_v5) { - struct set_error_type_with_address *v5param; + struct set_error_type_with_address v5param; + struct set_error_type_with_address __iomem *p; - v5param = acpi_os_map_iomem(pa_v5, sizeof(*v5param)); - if (v5param) { + p = acpi_os_map_iomem(pa_v5, sizeof(*p)); + if (p) { + memcpy_fromio(&v5param, p, sizeof(v5param)); acpi5 = 1; - check_vendor_extension(pa_v5, v5param); - return v5param; + check_vendor_extension(pa_v5, &v5param); + return p; } } if (param_extension && pa_v4) { - struct einj_parameter *v4param; + struct einj_parameter v4param; + struct einj_parameter __iomem *p; - v4param = acpi_os_map_iomem(pa_v4, sizeof(*v4param)); - if (!v4param) + p = acpi_os_map_iomem(pa_v4, sizeof(*p)); + if (!p) return NULL; - if (v4param->reserved1 || v4param->reserved2) { - acpi_os_unmap_iomem(v4param, sizeof(*v4param)); + memcpy_fromio(&v4param, p, sizeof(v4param)); + if (v4param.reserved1 || v4param.reserved2) { + acpi_os_unmap_iomem(p, sizeof(v4param)); return NULL; } - return v4param; + return p; } return NULL; @@ -317,7 +323,7 @@ static struct acpi_generic_address *einj_get_trigger_parameter_region( static int __einj_error_trigger(u64 trigger_paddr, u32 type, u64 param1, u64 param2) { - struct acpi_einj_trigger *trigger_tab = NULL; + struct acpi_einj_trigger trigger_tab; struct apei_exec_context trigger_ctx; struct apei_resources trigger_resources; struct acpi_whea_header *trigger_entry; @@ -325,54 +331,57 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, u32 table_size; int rc = -EIO; struct acpi_generic_address *trigger_param_region = NULL; + struct acpi_einj_trigger __iomem *p; - r = request_mem_region(trigger_paddr, sizeof(*trigger_tab), + r = request_mem_region(trigger_paddr, sizeof(trigger_tab), "APEI EINJ Trigger Table"); if (!r) { pr_err("Can not request [mem %#010llx-%#010llx] for Trigger table\n", (unsigned long long)trigger_paddr, (unsigned long long)trigger_paddr + - sizeof(*trigger_tab) - 1); + sizeof(trigger_tab) - 1); goto out; } - trigger_tab = ioremap_cache(trigger_paddr, sizeof(*trigger_tab)); - if (!trigger_tab) { + p = ioremap_cache(trigger_paddr, sizeof(*p)); + if (!p) { pr_err("Failed to map trigger table!\n"); goto out_rel_header; } - rc = einj_check_trigger_header(trigger_tab); + memcpy_fromio(&trigger_tab, p, sizeof(trigger_tab)); + rc = einj_check_trigger_header(&trigger_tab); if (rc) { pr_warn(FW_BUG "Invalid trigger error action table.\n"); goto out_rel_header; } /* No action structures in the TRIGGER_ERROR table, nothing to do */ - if (!trigger_tab->entry_count) + if (!trigger_tab.entry_count) goto out_rel_header; rc = -EIO; - table_size = trigger_tab->table_size; - r = request_mem_region(trigger_paddr + sizeof(*trigger_tab), - table_size - sizeof(*trigger_tab), + table_size = trigger_tab.table_size; + r = request_mem_region(trigger_paddr + sizeof(trigger_tab), + table_size - sizeof(trigger_tab), "APEI EINJ Trigger Table"); if (!r) { pr_err("Can not request [mem %#010llx-%#010llx] for Trigger Table Entry\n", - (unsigned long long)trigger_paddr + sizeof(*trigger_tab), + (unsigned long long)trigger_paddr + sizeof(trigger_tab), (unsigned long long)trigger_paddr + table_size - 1); goto out_rel_header; } - iounmap(trigger_tab); - trigger_tab = ioremap_cache(trigger_paddr, table_size); - if (!trigger_tab) { + iounmap(p); + p = ioremap_cache(trigger_paddr, table_size); + if (!p) { pr_err("Failed to map trigger table!\n"); goto out_rel_entry; } + memcpy_fromio(&trigger_tab, p, sizeof(trigger_tab)); trigger_entry = (struct acpi_whea_header *) - ((char *)trigger_tab + sizeof(struct acpi_einj_trigger)); + ((char *)&trigger_tab + sizeof(struct acpi_einj_trigger)); apei_resources_init(&trigger_resources); apei_exec_ctx_init(&trigger_ctx, einj_ins_type, ARRAY_SIZE(einj_ins_type), - trigger_entry, trigger_tab->entry_count); + trigger_entry, trigger_tab.entry_count); rc = apei_exec_collect_resources(&trigger_ctx, &trigger_resources); if (rc) goto out_fini; @@ -390,7 +399,7 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, apei_resources_init(&addr_resources); trigger_param_region = einj_get_trigger_parameter_region( - trigger_tab, param1, param2); + &trigger_tab, param1, param2); if (trigger_param_region) { rc = apei_resources_add(&addr_resources, trigger_param_region->address, @@ -419,13 +428,13 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type, out_fini: apei_resources_fini(&trigger_resources); out_rel_entry: - release_mem_region(trigger_paddr + sizeof(*trigger_tab), - table_size - sizeof(*trigger_tab)); + release_mem_region(trigger_paddr + sizeof(trigger_tab), + table_size - sizeof(trigger_tab)); out_rel_header: - release_mem_region(trigger_paddr, sizeof(*trigger_tab)); + release_mem_region(trigger_paddr, sizeof(trigger_tab)); out: - if (trigger_tab) - iounmap(trigger_tab); + if (p) + iounmap(p); return rc; } @@ -444,8 +453,10 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, return rc; apei_exec_ctx_set_input(&ctx, type); if (acpi5) { - struct set_error_type_with_address *v5param = einj_param; + struct set_error_type_with_address *v5param, v5_struct; + v5param = &v5_struct; + memcpy_fromio(v5param, einj_param, sizeof(*v5param)); v5param->type = type; if (type & ACPI5_VENDOR_BIT) { switch (vendor_flags) { @@ -490,15 +501,18 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, break; } } + memcpy_toio(einj_param, v5param, sizeof(*v5param)); } else { rc = apei_exec_run(&ctx, ACPI_EINJ_SET_ERROR_TYPE); if (rc) return rc; if (einj_param) { - struct einj_parameter *v4param = einj_param; + struct einj_parameter v4param; - v4param->param1 = param1; - v4param->param2 = param2; + memcpy_fromio(&v4param, einj_param, sizeof(v4param)); + v4param.param1 = param1; + v4param.param2 = param2; + memcpy_toio(einj_param, &v4param, sizeof(v4param)); } } rc = apei_exec_run(&ctx, ACPI_EINJ_EXECUTE_OPERATION); From patchwork Thu Apr 3 23:13:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 878223 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11022135.outbound.protection.outlook.com [40.107.200.135]) (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 7142D1E7C28; Thu, 3 Apr 2025 23:14:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.135 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722043; cv=fail; b=NK+DbhjQ8/W7PxFGtjy9OQ2GY0FQX3hx/Jr8N4j52tjK3WpfnwXcTS09bpwYyGmzLD7ktEhxOofa892tZLA0vrWTjCEF211hZxsYPjTowBUuthsGayx0KyqxVu1iNYcIfqe3bDtI3GqIl9RWBzLiq/BgcLVMDpSOJT1QLumLymo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722043; c=relaxed/simple; bh=YDQSp9R7+JMkLmQJLGg7mO66m+pzZMMvwOjXOctAby0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=R9kDxtPio7FjFlIqWKZTXN9mOYZtRnUoWyxOS5F9XbFAw/RmjtCqSFYFPWHZLZZ8yIUkhLB0OMjiPdSq5pax07fg6oHyZMXblO9stp09B4hqKtuLKxKOBzQyDeX4CSHnWrkzUu0V23cPRnegINlOw3TW9PRLJfxLC7V9MS5iwA8= 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=UUSM7tyI; arc=fail smtp.client-ip=40.107.200.135 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="UUSM7tyI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lLxc6HPVYcv/bQERJbnC8LUI2vT0FZ2TlmBSvnbPk6qfuqKGvJJLvZcAtZAfpEhmgvvPjPnn/YmtQX7dxwnn/LvaF7MCuILkN/Ld9IOBuRnvctgWBoN79d3neodkBAiwtemmtLoU5pALhkgos2Z88dLQzEc8WAGdPJ0ohYCX2ZcwNrPHpdgnX16zaQpwjirz5gJpRJ5MvGlX+s3Opu10/4gfLoBxXz1Ovfc+vYiX2IKi1FKKLBsNKmyxObl7+C8lbXvUiHdySA2ND3R7c3cmbbz/8Sih1xrV3VUXzIdRkAgvP+HBAHg5EwKcP/v0B1rczkyIYd5/Q9QyKihqSeOVwA== 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=nwmqqIQL/vrDMoYIKeju7fvcFrp/HmvPD+PE5/qvbO0=; b=MZ53pQSVpO53SvWNcae5TJVptBlAKCuTGlBrrHqJ7PFmC8IGhOXzHQETxMarwxGhZZwPc+cIPibe4aZ2v9X+0JInSKFEeTc4GNZi6ouiZ1y8QM7jLQiHsqcj0ZdFynk09K9sFKYIosos8x5t+AydbVQ8PTm3qnSUp94wbCpo9BbsTotJsNHh+MyaepuhlVq3OwZJf/OYAxz8GEfB7bIZMz9Y7nSdnnybsWHp9PTXVoBX4himU4kwtGLto/xVG7IeMbx06K+L0l/tFhDDNPhJRzAG8pdwwMpyW5VXLQCCQmee/SGbQLyyd7tEB4JKjX5qavgBgx9NlablpZQIQJ/Ccw== 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=nwmqqIQL/vrDMoYIKeju7fvcFrp/HmvPD+PE5/qvbO0=; b=UUSM7tyIITjNQ0riInK8hCU+nzKUbSE3kDFrHFDhUCWnqhNrpe/Rh6CCPuObn69jG323g0PmtOQaHa7BUn7SJkhYY+X5BVQhXz9/oIJoQCOTus6srLbnyBIoDRIAd4PW6lWI6PJV90PVqzr0oMlHJxTBsUQX4mwjqlT40DJGxqE= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:13:57 +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.8583.041; Thu, 3 Apr 2025 23:13: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, 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 v5 4/9] ACPI: APEI: EINJ: Remove redundant calls to einj_get_available_error_type Date: Thu, 3 Apr 2025 16:13:34 -0700 Message-ID: <20250403231339.23708-5-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: eeae6055-214c-45ed-a5f6-08dd73053604 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 1aVUDx4A9yQaNkX/WNatNPzV+jy6K6ksci5k3yYSMB0tuHGHH06Tsf3E6X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56W2+KD47zFlKFDnlmdNmGhaPXIqTATU25BCYLW47hq2wvcYdJ2Xu89mHM2+vJVg982w7ohuXkZLvBuo9eIaJ3gmaEyTSZ02Bn+UATRbhbYVrjHm9CCy0Bre1kxO7UYtY90WTu+CvyNVVqE/IzWyAXNmu1LyvAx190RznphFbqGqx4Nm1t2Mxsxyvn+0iBlP6TzpSMME4Y4OgaptTuJTM9kXWeQGBVZgOv3oa7I/aNQ1eQ1SxxyhvGdIx7cvLldkUArsMzYL8IrC2IEViJ6nP9Wtbzz7lwS6PxjENyAZjpdjboteNvgdWuFIrTvbcdYbU9/50CJAvszbolWZ2omaMGAutUjLXV65gYpUN2A== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lEk0FGbewhEnkvi04uYDcHCjblty3Z5THME0Kb3yB0X8zlE0svN+JT4l2s07btkrTrhrTHT1yYLocpqjjJ41XVKRUZuXpmBouTFtXE72NByb5Vw0Utax78v2mXTzec6eD/Zs9jsdHE4Y5kaSmfU2EU+BizXm4Rh3Pc6V8p8ffFYJUPSdL2otXhWt5hg76rHZLzkcVUHZtzwBzHWGy8J1uHmaf5oO57fQ1GtTO4xr9/UPQ9Q6WP+FwkFwDzk2mRjREn736R+J0Nl7ZNbVCv/VMsmzCzUin49WVlsGO3AybkhyVhl6ttR1UAyF0mtonEZ+c+0XqMof3EtRJBcQ6KPK2Tv4gN0Hl0zd/1fe0Bs7qJTBRj3axDSlFbMU+PjxkuW/2eg8x3DkHpvv1qmsqDrB2hva/LMgc7M0n9CnbjYONXMiy7VbEDQkuAbJRBjGpe1RPim8QbNrNjacEAHtlk+KEc295OqOVD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asphWaytWFB1/ep48XgtqS5dEkkBesSZ4XoCWmgtk038Obez3kEObXa80YUKuuQO/ucaPQ+RBDRKpMcQFg= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: eeae6055-214c-45ed-a5f6-08dd73053604 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:13:57.6238 (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: kn1irnWO6YqLlqZKUtd335BSGIPe1opCtf+IB/5IN1sTdj4RFpVKi4DS5xjnXF+3Qph1I8tBHEMOj0anjkicD9CVrdZcdYDTMouVorYl9n0Fxm37njMAkM5ZGeovvecN X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 A single call to einj_get_available_error_type in init function is sufficient to save the return value in a global variable to be used later in various places in the code. This commit does not introduce any functional changes, but only removing unnecessary redundant function calls. Signed-off-by: Zaid Alali Reviewed-by: Jonathan Cameron --- drivers/acpi/apei/einj-core.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index 47abd9317fef..ada1d7026af5 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 @@ -662,14 +664,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); @@ -692,8 +689,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)) @@ -709,13 +705,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; } @@ -791,6 +783,10 @@ static int __init einj_probe(struct platform_device *pdev) goto err_put_table; } + rc = einj_get_available_error_type(&available_error_type); + if (rc) + return rc; + rc = -ENOMEM; einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir()); From patchwork Thu Apr 3 23:13:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 877998 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11022135.outbound.protection.outlook.com [40.107.200.135]) (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 F3D561EDA23; Thu, 3 Apr 2025 23:14:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.135 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722045; cv=fail; b=ifBDNsyxh2A3J3y2b/GOWN+YVtlbWeO/YUJZw0E5dHGE0NqSpHnSxO5uu3fvxbxgVFqyhjXtDVcAhqmcggYgDiHbMm9P3g5v58xSccU/p/8tP6osXq7eUQd3W71gDjG3sZv/oDVbekHjmXHkOhx5naGLQR3ai8Eaq1fNnOHgLDI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722045; c=relaxed/simple; bh=cNaw6M13aVwe2UTXqUqnQ1nmCgb+Zj3YHACRyVGKY30=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=puMyYG9fluw3Bhmw0AnWbNL9ltZg1sazEyeR95zxBJqTY1GBHzulfwCvABqe9jM8k3MTAcDC4ZuPm4c3ardr2e4lNEgTG0leSTw/WyrgXUl9waLGRFNWS+mnHCBd8uWEyAXO6EwImDtIWGETIVDWeS683OaEieaAFS287Kvozl4= 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=BUCucobP; arc=fail smtp.client-ip=40.107.200.135 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="BUCucobP" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AUnt45Oj6wtTj5wYvoxkYINc5TCQvDI6XzAt8KmekecRyLV5bvL4UT7oSBFnAQ+2X1obbUv05eMcOLYVI82/0+fWmgQDgsrJleXe5Wqet/d1SjTGBthDBqyC0td92m0cAJC9zQvYhIJv+DwgBLWQA39lQUpVYUrvG+AjylumJ5lieaVUoekEKvDECnpITZqWlOzRsfkfpzWAaXZcJKcm/y84rPsvlChZyaFiDjc+2qEZif3zx6gWbEiVAB+pl/XXDAFQ1m+iB0+WsDq0WkNPzQJp/+XaoBf42F7EFN0RyfyNaj6UOmhxNQnrf8Ad7MWKCoUzn4WGw3PKHeIN+qSsmw== 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=R2Yls5G1bkQlJDqGKWWgLAA706BgvYQKQ3x+rT4Hgo0=; b=B6g9Zr1+Dm9azSMGQc5uciDWsDnZ6hUSDCZpO+wIuqjG14DXOkXNpBf/QVZQzv/6nRfKBS8ftPc7eeC3RJ7qkvYA+IRDt3apfPD8Q+nxpz4D3W2QZ27EV/gxcrmGyxOelCtkoU0ItryUI/VAihFUqI1WLiwNXsSilUwL3SOH53ydWVbYekjHTRYgrr3z7gfJQCk/D5z7pV+zvMtmUPPKopkkoCrjqkUVuFMsfsn5Ll1vJ6J0JsJYKyC/unGEBn/lRhZ05N/4ZhXQKAVN/bRly+1bzHeMCI6VASdsO11hk63a3X8f4bri31tfrAkBfKJZsHSBJF0cCwoF/dHvVPm33A== 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=R2Yls5G1bkQlJDqGKWWgLAA706BgvYQKQ3x+rT4Hgo0=; b=BUCucobPCayjR+6tQ9vOtjOINeY7M4XR/+V8LEEjGT/ekeFnJrVtcb9qXybzLAv/F9VC4JHrDkoeclnixHUmqjMW5TFDRb1YUw4S+OW0UdwiKXsPDIjur1xqieJo5HgEoruQO9O5sQuCd+DHv63TPAmTYohEg58MpiHVg9Bup0U= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:13:59 +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.8583.041; Thu, 3 Apr 2025 23:13:59 +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 v5 5/9] ACPI: APEI: EINJ: Enable the discovery of EINJv2 capabilities Date: Thu, 3 Apr 2025 16:13:35 -0700 Message-ID: <20250403231339.23708-6-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: 8bd5edf9-a4f7-4526-76f2-08dd73053708 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: ohgRZsN7AU5GaMaMp9/8CpaTw6m6l7yC/D9f/30eauIGorSnvDOOWcauH1lOMZm4173CkyV4Z3evz2EdtTah39vDmSpAhKjOIN4Yrl8T5NTFF/3zDqVj6fGiHCK4lOj/gjvV+8FTYBfsdjlmKJqqUyirQ6U8jKevqdjcYc5hZ4IhpMZ9ZvRYbQgTKMtVXQHSEEdfZx1mdq5v5OFZadXiUalvXdl6adYhLC1pIBvrkZeahFW9nYAyn0OTSjgJFjhDTTu14yREH3adBFlXUrNNouormsnT/1ySacEoVXFWLrBUiZEo0j4XUSwRcy81/5LNSqZ122i1WnFA81rhX62octdtSW3CpnEWJRD90D6UKpk/107JLRRDeeuvGUhC+rda9S4ttVQQIWRo7cw2MbRXBmJY0AAIGR4aGUjjx1LSfGLjNneQPOAEU0kJL4botZubY3RR9LEAl7ecEprWXEonCLR8F7ZmsI+7+2Htiw3EVy6pforkn60wrP45zOeQTo1j40BA3D3i+4yq0myQDghKLQJVOUgG6aE4D4NNg7YAgHcgsY/LoWPu0/n/35H6wfjGJjnMesVpexYMvgUxrjbWNvalZBQmy4W+1rxRi2x7rEBMwx7zctOKEgLaPSck96NKI7uom5VtZhT+3HARFzbqAbmO6ilPwGHU0ucRKJfPoNh0X5r07jg+Lp7NMyfGGuUaTnEYTf8GTGdflj0moXTNt0ld+XQi8dGUfbXrfyEwFXVmjfAWq5/Ghia8YD5bvWbw+1RXkZR4AxSSWEt6A3SQPBSc8IylxqPBlPlpdmEbZSige0cl82/GIO0qqnGDi1K4NdDtcdbyOcQ6BwxZ6mvCSaWNJjIdZlT88Bh+5xPrcapcBxCCXjyx6bQxfg6RzSJDO8rl/m4A9IOucS7Q9Cvbik38UYAXTMVuraDkBqwO0odRiJSS9eYYnC/hJN13y9q+ZDqDjp2U70+EyBoNll3/EiI+4mc4QC0xVYAmrMBXc6v0KmHhClwuHQc7N31YleC3unihnGtFPPYQlEakdYc/rBT26KLSwoecRD6DY89ag5gJ5Qf6zwv0i/BPW81QG1pua8MLjZzYHu8VKRlawqAIrjNwrMp5USLvSVOJNtEjxQEWyP2kX9pSAUEf50XygQEYiZj0B2xWO6rQWAtSz+Y+XSLEp/W79LHfXXBYQyFMvgFFGnYk1m1YWjfIYpm/gXFXFsckRuLT113+7zOB8+tzGUWcSENhxUZ2fbzHWGctd79om3au01ixxv8tBU2qyaNMlXfh10bX2jyGdT94MhaOfj1nLBkBM6hJRGe+jVqSnOzuo3Uap4ifz+mAK6FWmYtmh+aZN9rNlkxj6OI3k9UghmnmHrkz4I7YHNYPPnZCcTPlcnuIRArFWFuxffFxxtmbzW8RFzFEZ/obeTHh2FGIZc4T0iXNVc+G1RpGlTm/joCvGoX7mqWctsSAttuKYuhVskz4o+QjMUQF2HvdGe68iw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: HUNWJ6mE2el8szIbZeZ0jTGFx3TEDhGu5bFnbhG1nWEENG1K8f6DeZcIrilunJZaGlTHt95mCLYe3WpEM8euKMcMFiRs44sTR33TB1lld4RgiRJZ7AYNuaa4Gz/jVlyFYTILvB0fCTPmiUTrQateqybrvmli0cmEAMrRWQP7pO1bBgcgPDBHVbna0SpbuhbX6myFM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RrqPNysB95t3ox4a3eKJhoERnpSTtk0X0hs5wCFg9rifcHEKTxr/ktpBLbLi6yOBxFE3lbGJeVkw8LNBIFaiM/uSXPQkJBEwPNYs7Y4r/rQF4lDBznWOpCjObtSSamUZqBTyhBziQ738ooh5UXpHv1Ngtad8UUwLNJHaNJWIsTeFZmRsmJcljSjAZzngSrdI2Tgf2Fp7NZ3QSTHtVASQUNmkmXYDDjiPehRXKkAPK/Yv1lhCX6Oo8LzUxp8jrqpedtWB24BdUNH2C2taC2NUW8Dy8imrn/F5uAGXsf8X96A5chcO18Rm4SMvFLqDOnLcsPlra0pm60IldLmBP3amqPNRZwfoz7vbDo3wMJFAvuiTqpk= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8bd5edf9-a4f7-4526-76f2-08dd73053708 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:13:59.3205 (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: Hcu9l6fPZ8Ol9jIw0CIJNdZtwqV1bH3elOOfHc4a6LQHuRYgE0oqlrnVEKva3oV6R1QM8jyOwPCAzt416NJjVUZdV9dTEvRsNmk+i1rp8RPn87SLA9puX5YkA7Xi2om0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 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 Reviewed-by: Jonathan Cameron --- drivers/acpi/apei/apei-internal.h | 2 +- drivers/acpi/apei/einj-core.c | 64 ++++++++++++++++++++++++------- drivers/acpi/apei/einj-cxl.c | 2 +- 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/drivers/acpi/apei/apei-internal.h b/drivers/acpi/apei/apei-internal.h index cd2766c69d78..77c10a7a7a9f 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 einj_action); 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 ada1d7026af5..0d99f9951c03 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 einj_action) { 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, einj_action); 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 einj_action) { int rc; mutex_lock(&einj_mutex); - rc = __einj_get_available_error_type(type); + rc = __einj_get_available_error_type(type, einj_action); mutex_unlock(&einj_mutex); return rc; @@ -646,6 +648,7 @@ static u64 error_param2; static u64 error_param3; static u64 error_param4; static struct dentry *einj_debug_dir; +static char einj_buf[32]; static struct { u32 mask; const char *str; } const einj_error_type_string[] = { { BIT(0), "Processor Correctable" }, { BIT(1), "Processor Uncorrectable non-fatal" }, @@ -662,6 +665,12 @@ static struct { u32 mask; const char *str; } const einj_error_type_string[] = { { 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) { @@ -669,17 +678,22 @@ static int available_error_type_show(struct seq_file *m, void *v) 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); - + if (available_error_type & ACPI65_EINJV2_SUPP) { + for (int pos = 0; pos < ARRAY_SIZE(einjv2_error_type_string); pos++) { + if (available_error_type_v2 & einjv2_error_type_string[pos].mask) + seq_printf(m, "V2_0x%08x\t%s\n", einjv2_error_type_string[pos].mask, + einjv2_error_type_string[pos].str); + } + } return 0; } DEFINE_SHOW_ATTRIBUTE(available_error_type); -static int error_type_get(void *data, u64 *val) +static ssize_t error_type_get(struct file *file, char __user *buf, + size_t count, loff_t *ppos) { - *val = error_type; - - return 0; + return simple_read_from_buffer(buf, count, ppos, einj_buf, strlen(einj_buf)); } bool einj_is_cxl_error_type(u64 type) @@ -712,9 +726,23 @@ int einj_validate_error_type(u64 type) return 0; } -static int error_type_set(void *data, u64 val) +static ssize_t error_type_set(struct file *file, const char __user *buf, + size_t count, loff_t *ppos) { int rc; + u64 val; + + memset(einj_buf, 0, sizeof(einj_buf)); + if (copy_from_user(einj_buf, buf, count)) + return -EFAULT; + + if (strncmp(einj_buf, "V2_", 3) == 0) { + if (!sscanf(einj_buf, "V2_%llx", &val)) + return -EINVAL; + } else { + if (!sscanf(einj_buf, "%llx", &val)) + return -EINVAL; + } rc = einj_validate_error_type(val); if (rc) @@ -722,11 +750,13 @@ static int error_type_set(void *data, u64 val) error_type = val; - return 0; + return count; } -DEFINE_DEBUGFS_ATTRIBUTE(error_type_fops, error_type_get, error_type_set, - "0x%llx\n"); +static const struct file_operations error_type_fops = { + .read = error_type_get, + .write = error_type_set, +}; static int error_inject_set(void *data, u64 val) { @@ -783,9 +813,15 @@ 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 78da9ae543a2..e70a416ec925 100644 --- a/drivers/acpi/apei/einj-cxl.c +++ b/drivers/acpi/apei/einj-cxl.c @@ -30,7 +30,7 @@ int einj_cxl_available_error_type_show(struct seq_file *m, void *v) int cxl_err, rc; u32 available_error_type = 0; - rc = einj_get_available_error_type(&available_error_type); + rc = einj_get_available_error_type(&available_error_type, ACPI_EINJ_GET_ERROR_TYPE); if (rc) return rc; From patchwork Thu Apr 3 23:13:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 878222 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11022135.outbound.protection.outlook.com [40.107.200.135]) (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 D7F241EF0A1; Thu, 3 Apr 2025 23:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.135 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722047; cv=fail; b=GdyDYIriLdEW+lmcaS9DNbcPWnvtAY1mnIgOeLHDHDOsPnq/I/OQ8qZKs/GGYwpGRNEYMihJ6dcdys6cjS6Ytvv22kuc2HBfzI8tA7nE73oVv/gSros8hmp1M8VAiV5DWc38J6H7l/K1co2kKFMbx/uYGz/ccpkY4Eg8/rZBV0Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722047; c=relaxed/simple; bh=YBaXosnlYoxfqOdoTDewJ8lp/ZRQ5lfcJesq/VckaMs=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=EB2igMmHBo64jFPLfOfp8hH0VAmitnc+7cItVQ3GUFyJz6IxNeuCzqxVPbLq8ODoMPqDHHckMDAL+ZxOI3oqrDzT5XsdWUaEWe63Gsa6f/EVgcz1QGFlDIYK79+Zq6do3A9CDBsYLDPLOIqJB4GrxXrHWP+8yc5xEf697dqqs0k= 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=IFP0MhxE; arc=fail smtp.client-ip=40.107.200.135 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="IFP0MhxE" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=i7fUdAmCvifb5HVoqV8tFPem1Ocq0hELVmthlWMY7aAHbRNgTDNad+fZ1w5Tidflqq70UEhqnZ0O3HDdr1SCljASoGMAYu2U8fzqnJVbaAf9K0XvEQu4vTg3UTyALK0cRmMWA5f/puijScXk3UXnWd3CLf6H+YPzNXQmZCJiFVkyb/Rn6xkxwm1IuRR/rpiiQ9lvmYROfG4see74PftRGJ8o/CB7q41QCziWd9i+syi6zuxwqSgZhccxDIdYH1w6V854YQ/YP5am6aHzI8GtYrbP25QZMi0AbWu1r2ZZGSZU3+BZ9uaoVOtgArwiDI9Xsotd+edNKNNl1YgHHKgDqw== 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=hNfVLYnHUMgY755sV0Sp9+69FAaT8tvLDJ45aeDF0Gw=; b=Z/QqJexQcq0vItjNLeCo0Szq0IQBEQbHvwSkiGNo1vson/eBsAtlD2gRjktwvCfuL2dkQkctP5UBr6dmbEyCw/9vTUYmbKdjnKQb0cHCuOHv6bldxyEjK5q3sBeiEZJ+YfSXg/wbDKtazTJ13kyc//LQZ2d4KiDonFyNvbzscHiFv+zANeRjxzG93uSU+5n73dFNb29boc33DRV3lvpKcB5amgdiTprad3tqBRusHEzl45afH5mAVvmUpT3it/X43Kdwv+UWMSCr6O6GuhQfHW2QO+vcHDVeBxV76+BoXgqvlHG8wnQuF0NxJSPcKCWUadGZPhXaHjgsCu8uILXcag== 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=hNfVLYnHUMgY755sV0Sp9+69FAaT8tvLDJ45aeDF0Gw=; b=IFP0MhxE/tTxMZpzwFQPXiDh1mHv+T5Pdq8/oc/G7nZN+SF9ABcVpc52mSI4UUQ6lJP3ERTqDHeCMlEW2AhhhGS6Uthq6ZnG/Dus2OGZZQCSjjGqwFz+q12LzKGGwL+yYsqWsg/qgyD7lT2vfvXimpCuO1pVXdJb9pJsoEjLgig= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:14:01 +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.8583.041; Thu, 3 Apr 2025 23:14: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, 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 v5 6/9] ACPI: APEI: EINJ: Add einjv2 extension struct Date: Thu, 3 Apr 2025 16:13:36 -0700 Message-ID: <20250403231339.23708-7-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: 49e57ab6-b78a-44e0-024f-08dd73053804 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 6MzI5eiHmUb67L3rtaBhuRFm6Nus12c6bSTKjyGgaZi6wx6zVu4x4IqlwYlkATgYzbl2mCjAtvvrm4gqW+MIxdAnpgWE7cF3nkheJkkiSveJMfrq6HcQSwpPUFzo+mPh00l4lLPtKjj+Z+Pk0YNxfibYNIAb9Xil6CdBoxMhOwFzUu6og4hDOorpUJkPq6zt9SIn0n0QVgyote282lLlKLVCj9RL6Yzf/geEIlPlNX/T37ZozPSunv0wmh0Vb5PB73BP/EOmK9Oe0gPFkEHnKjiI9bFu7cUPPBzXJWWzM99RR0+RbrlJV+bK93v5UkPXIQL5Cd1E0vjqd0G0gAPm02K9HkDT7L7tEFd7fVgF/iLlPO6GD0XR0LoFZ9jdQmhyA8oGM2Frf4XWWm2M/kcXnqFEuFHgpB1CrRdzfJwbzBHs10i+ENbppa5wh8f+85tMt39+KCI6k0qI9uyd8kQ0VanNvaMPAcNZ2nR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N7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: caCZfXspToDjT3otwfqqIDJKX5jkQPIYV1egExu78Tz9/KTHEV/PXrS5uJofqz2s7SKeRxtRotKTvdxmAt+quztOdR5Ecnz5DkpWP8haau4YhpdRSZJ0SV2j1k5xAWqA87muubCf/7i4ROoKw2Q2ViqRDYSM8o1b8iehYm78BTsfiSv/MwcGEAZJ9LN4iEfzyrrA0HFQn8hPkDC241JXpmICpnCdi2n5hy5jCB37WR/QzCDtT16aZo6ne4fBlPAnPRrrzNsnthO74l1tr4oAvTz71wNqGT3iaXjUVWdArN3L9jl4oaEAsZ7qPfQtNQkxbbB7QZ4kdihDgnynBenwtZn4XZGUVZ2d/oHRIiM2nVMJGh1vPDPVB2sz7pQfYXAqu32t5FSrTvEu99v+vB3p6zI6oV32xlVREl5QgkhUdb9V+KfRYt6qdIdd6YANZdjaAnyvtwXdIb9w/0/+G9j+tyfiJxagNvr9qTi2YHNRphg1BLydt6bMw3wAqBL1cwPDXWB8+2y4lcBuMhPXnbp1N/wBERnJ2j7d/igmpNg1IcYV9eMc8g2c16hZt2slMDKMFCzSPjUJoGsc1KTkMEfQbNwNimdQdI0P/FfnqCs/YNKfrlefdeZgUMTA5Fif/hmA8qayPj/a4OSdYGJqhy+Gia4WPMD6kLyfcqNhZbJloNv6Qe+7wjZzOTHgI0tUj8HVPwi7AIqtx3a3OPqXb199N6PwPfxDUCUn2H0bsEgVk7C7AJwSuv5SYUXsbJDqIStX12ChP1pB87mzMHGbqplXfgoLuQcgX2gMADXjpSNAuiPlj9P1P7UvODK9CxUku8KOs49izdt2m4EtxS7FC4C57V3JaBGhL52RWcdOU82fYhantPss+Zc3MHhDLm6ndl4FNdcf7VKWVYbWT3nZnIULe4hCGPTjF+Vfnd0jN07rqMHrNLabNwGmHYe4Wqb+FhNyb71lpoHLUkQClqiqnbhF58tPoPo4lttnws2veMc3of52M26CDUh6uatu1hl4uY1m8xUzOGa8RsZDwRg9xL8lX24TV4aQvx64FedOvKDjUkyImRPF6Ek8pXhx1tjPOaRyOt5hP27akBZKGR1U19k6x0bjtjRn24ctxcnBkYiYs3F023MBykjpEyY354swe3AJRFuHi2xMp87FixURfxE1ITh5eTpl1CwF9IHg5e4RpupTtcsRB5UU2+3yWipVgD+PPXmiQt2M43G992Vw3jEzqkyGU2vGK66O3sESEYJvuOKPUyES0Xu7vGgpNPZhoF3pOON7U43tRUN7hcgbTT+VLAhugtPlY5NjIebjKlpxr88XDK45XbkmAFOPeWQmmSeV52wKSWSX2qXO65VWqD3Bujo4liwJlG3IhyC47ZOe28+AJoIfIyp7HqdZlKgrj7S5RtEayDDeINLw36m7/tC91uId/jebsi5JVfP+TrHxAPO/8XFGVjLe77sUp8v+UuUFnHrkv5AZ9Nd/8mtqgb3W5TovSKcyg/kKMQaYz3AsqXlo123KcbzHW+THZJweyeZPjreNGkKG1CyTUFJHoGtVDrkt7ebawwb5TyG354EmXAEWf4gY5H4OSvVj3yoG7AGdXy/RgoUxFpC8AH41P3wgWtQL9lSaX5fnGzANIkETCmA= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49e57ab6-b78a-44e0-024f-08dd73053804 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:14:00.9761 (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: jJX6IXB1c5ArJK3XXg7Lw394xIIXBodJ4RP4ZL2Gl7ZCmvVW/ZMbHgbL+ihEi4SH/Eu0J8h2TH3TUj+dugH4Ry/lQdeC+vQ/uZ9bhvf852P5jUS8DUeLPa19KknborA+ X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 Add einjv2 extension struct and EINJv2 error types to prepare the driver for EINJv2 support. ACPI specifications(1) enables EINJv2 by extending set_error_type_with_address struct. (1) https://github.com/tianocore/edk2/issues/9449 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 0d99f9951c03..d1ddc82744c7 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[] __counted_by(component_arr_count); +}; + struct set_error_type_with_address { u32 type; u32 vendor_extension; @@ -58,6 +80,7 @@ struct set_error_type_with_address { u64 memory_address; u64 memory_address_range; u32 pcie_sbdf; + struct einjv2_extension_struct einjv2_struct; }; enum { SETWA_FLAGS_APICID = 1, From patchwork Thu Apr 3 23:13:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 877997 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11022135.outbound.protection.outlook.com [40.107.200.135]) (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 848BF1F09AF; Thu, 3 Apr 2025 23:14:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.135 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722049; cv=fail; b=eTWUrto+6YeirTB88uqYYHFuwRXYnieLMIFQGzrKDwOF2hzKgqmLAtfU1Tkc3bc6OIHExYX5R+p/W1i+6Z+Z18cxYhaDH8ZB+43dOysq5VGjLv2NM3B0IDxCxt1wXARAy3rr34I4ZCoCQZ4Skz+CNMQVVhKT5mgmQa+xGqDn5a8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722049; c=relaxed/simple; bh=lstlSZ7XMXsrplDA+YRXXh+sh5eYzsb+Bzo5Q8i9r8Y=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Rmy24WEmIRjym4U29dt97j5KKCm3t/7TYRUnU4c1MkkGiTrHaD7EIPCLm4UeV+v1aePC+HouPT44tBrwvirr216hSx22S1rKu0jElbKFjD2CFTDaZK2erVxpwk7gIsnzKB8oe3XApodNsE3jEWmkPPkiPPqkigZX3p+d3Mtaz/8= 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=WFUQ4K3D; arc=fail smtp.client-ip=40.107.200.135 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="WFUQ4K3D" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=p+bqjCSZfOPjViZVhc3Kcf0P1JS9cLkvqAnmm+cH5WyfV47JylFG6+MlFQfGF2n6OeysdGCOI5q7FxpBEBD/cGDyHUhaz/2xEbsMRRP/cf1IajEquFukWYOLefqbouh7rtt4fK+xPD3EHHXg0sCLHhv8jWXFdQhrt1xZ895+a6ikP5FdXnaIqkvdW26YcsSEf2LTrk/GHlDnt+fHBimaqIYBrOKPVmq24b8ZBk4EN4d6HibtJ0wKGdfltCAB8xxFydH2kyThaMqtLMOx5X4p/zFDgIYe220FIy6LLgcFt2hxUwNI8al/tn9nd2yVmnKuT0DcYlQvEhsO6S34UMzAmQ== 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=NFeP4KcucCQrGcRiL65WcPBiuZolI4awpICQrs9qdlE=; b=LIVm0Vr7za06jA+//8Ow1TCSRvF+9QEbc3G0j+RxRyYiA8ncvFBqt6bejYF5nC4SnsCf2ovfhXn64oBVEHR7Du2m3JzZIgmXMU+CX1D8WjOGECFgjjO3K97MWtxi5XT0lpx2iKpJNEJa/0F/5+3MUsJs2WFNgMYyqF6dqLcq33xhX+VrldtDCqq27zKxUKyPOi8U62M5XURryuGjiA4JsVYRb25BQ+OQD+j5+FE/DaMfSCx5/qylidzgUOelm3jXroeoFzjVS2igL2XOzsiS5oyIZDUHpUBCot7OFuwZtt0sUKCeIlZvkz7ZUeP7FeMAH/8TwIeYgkXk+qS20tY6Rg== 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=NFeP4KcucCQrGcRiL65WcPBiuZolI4awpICQrs9qdlE=; b=WFUQ4K3DVTkCSOn15rKto/lJ0hN7MDV4fID04lDPJSzGwyVBlVM9KLk/ff7mrXO03B8nAENz81Pr41R+QaJ43IFDkHLkS9TRCNYQpZiIasTs3akME4sfYnH88qs528p8XcQSRWV6yURhVkEiL7qYTsdtDZ2jyn9Uh4qpVXCl420= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:14:02 +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.8583.041; Thu, 3 Apr 2025 23:14:02 +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 v5 7/9] ACPI: APEI: EINJ: Add debugfs files for EINJv2 support Date: Thu, 3 Apr 2025 16:13:37 -0700 Message-ID: <20250403231339.23708-8-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: c0d4ff25-a240-4fc7-0b3c-08dd73053904 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: PXlyNA4xgTIKzqnWbPvH4VeHBnpAC+VL7jmruEzTV6ARHx/jsLPNrrxe8wj/Xe8EmXTe6GSQjiBwxIfFKh5iYEezgJiJlR4ToKmjeM1WOUI3ESoJIUNWS7+DYlIkovFlz1WA00QJmxsbkQvZ2DvONS4YA0FfKooFR+pLD9x9WpRFFoT8v8l0fENc9ow0FmIzXKKFVu2odClVsmBK/JssS6QI7u8rVQRsjHA6uUSP2XiMh4X7E2W0g9f4gNw4BIjOkg7gKhysUxr0bv1S+YB3shRe5KPre1R9bLRnREXO4dqKQCOhl2Qdr8IA0OhT9k+enntCt4T/D2G2PCsEANYKeo/YkmcpP8299eONMZJaaPz6mZvJHhSqQ0BFSL33+loyWrMGe8EG8FAlRn6IK/5yHeNJ8Js0fesX4aPXz3NP17MFSGmDigJID/aSE6hYf62SR93oKtWsTKyGGBzZss2/3d55W+gqn/tux65Ge8IEO9JffX8Gk+rIMMtbJZjIlozx6qo0+9axjc0r7Fz35HEq6M7JW5dCNNGz7aTjl/zjpKPFbRrO4j0r0pOVIKqKY6gF3DzoF6gWhi/LJJ2djCqv9T+slDOr+FCwuEiEDg81w9etIsUe4ObFw/gKDvyKOvVz4d78K1WlXpkItDLPk9xiLg7U4IlvTx5myIoih9NnBElI8v1kIs2qLua6onCrai+i9FjEgI3RuIG+SSaWZBTv5ssKfQamVuKiVybWPZ+1vFs8kGE2CMHWvR+Cpy2pXv7HEdU7yOf0gwT0zvJ1aUYHbe4F6LPOGlr1pR/GawvZXyuflblq/SljBN5azn0z735RU1eejbA6uQhOoTed8QJyBqUS2EcWi8SH7TR7t1QNk2wK3GHAobtukz6tDbpWR1QRIRiGsA9EowSJEYuRx9NqdS22HVRmP2w81jcxdBM8IxOiZk0tODqvm/MeLPtUl0HjvZtqWaxGqsUs2WtBluUQIkMlMnWQv5l7KMpZdzBB3sVU1EBP/zZ8cvWFxGjtXZKMO4UTXWtZ/cK6A2OFpCOLD9uNsFyvgKeIQsnrTuAbz3/qs+QxeFD0yQQxUzLu9Ub/HIOHGCMh7NkfsIIWNzWJwknxKap02AcTRpSgDRXClf5ht0zMVnQhu+frqszEtkaUm3UNOfGWfDLsRNH/Ha5P0H8FM2urYE6Ay/AACv03KzqXzQ8vK5IhhWBhAERtTpVUwChQDh999vDf4aaMhhCTbYnhMw41lkkUIYuAHTrtpD9j67pR9o6+24KsR73jHvVLfrozaLqzywZGrqfDXenFgn++RplebYWfuM4EPJM9cVZE1/OEmC786TdbwDcrTkGBdaUbpAm8IH6sC7o3fMjFSNXcLoCz8K3GPqACP361h2HG3iE7+bkU4Xexp7iI/ibnKGVsW8cS0M/RvHvTcMRHcsDvhcT/yl7y83z3s8hfIr59SEauzt5olOChfMlk/XFgAx04l4lIjUlc4M+HSSzTGg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7V3RYkeTrBCoIFKyCbgvOM6f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wsIF1YtWWA0D1zfU1ppl6/TZksTUgnmFPnGRvFcSQmDKKBNjU+h1Aw3QjDXNgOJkeqBJ2OnHcZ1I85XWa7Rr9oRoixuiA+TPtiinYDuYYnh/2iiIkYtIPv2ZebHI1J/rftX7BU97e37MkcKBEyxxfDHXmogwP2fiwDVN/9P4+IzCwv/HgiDv2GEa2YysV2KZZJCXO0jfEZPXEQhRAgynOv3kj2G0lpRkImt0q2OLx6N+tT2EvTLDEQ2GQFKVGp/AiSExnuvYW4GP58L9q3yqm7rLax6OqVRjTsUUKis9Te+myPT08l8Xl37B6c1lKws1drO9kh4BkgMswmY1MNNHJBteB/KDuCzMkMCNg39cZa04yik1DFpuSvN1zdd2/r6U9tKm2KVcThw2XMBdzsIWPXzmRwj/RZRhrEHkqoYN5Dn5ZmNWdYvWSjvtz7n/zlJO0+/k94IgB7L5a+ggcU9p8GFCFdp9G11pk96Y/SecoBcsGWHHSapPk7m1lH+Oye7HySC59ByYPwZ6NRr4RbI0LgZuuOXKhOeh8XbD/sqwtA= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: c0d4ff25-a240-4fc7-0b3c-08dd73053904 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:14:02.7178 (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: Icwk+e3P8wga1vTwWYf8GhaSsfpNEtQhm8xUGfTNkTn9VfybXttUfB67NKdJx9cdiztoRxBLJbwPV4fwkWfhCZ3B6QyYnCDnOaexZW2w7I8CB2zLSyQVRhgiRiwBBkyG X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 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 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index d1ddc82744c7..dd7626da360c 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,8 @@ 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 void *user_input; static u32 available_error_type; static u32 available_error_type_v2; @@ -890,6 +893,17 @@ 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) { + user_input = kzalloc(COMP_ARR_SIZE, GFP_KERNEL); + if (!user_input) { + rc = -ENOMEM; + goto err_alloc; + } + 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]) { @@ -909,6 +923,8 @@ static int __init einj_probe(struct platform_device *pdev) return 0; +err_alloc: + apei_exec_post_unmap_gars(&ctx); err_release: apei_resources_release(&einj_resources); err_fini: @@ -933,6 +949,7 @@ static void __exit einj_remove(struct platform_device *pdev) if (vendor_errors.size) acpi_os_unmap_memory(vendor_errors.data, vendor_errors.size); } + kfree(user_input); einj_exec_ctx_init(&ctx); apei_exec_post_unmap_gars(&ctx); apei_resources_release(&einj_resources); From patchwork Thu Apr 3 23:13:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 878221 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11022135.outbound.protection.outlook.com [40.107.200.135]) (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 594E71F12F2; Thu, 3 Apr 2025 23:14:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.135 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722051; cv=fail; b=JQgb80lqviTmd22zUBctBCA8R3FJI4PJD2YJj5wj/PEDM/zMHTDtyg8mvN38DIZPxUmEWQMwO/5KA1GPWxWDcNCD9FN6n+i0jFqrXhBcF9xbzPTVbJdI8uFbo/tpTFhu4MYNbhKlbIltM4UYIDSUSRS5nWhZ8kMmRTG556kpRTY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722051; c=relaxed/simple; bh=S86WihB82vxxno/BIteZNs+msI04CdzIhMIrbAvXIMo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=EdWFrLEmCubu6qujgfhL3iEhDRF0R8EYadOmGDLJdM9HpIUdt9BckxyyLdkDc7e2WBxxVwpDuylr/VmsnIe3jcV4YIy+5NzZSVSH2O8pFKgEEegCo7yri5OjvHUOUulslV4WPCMamFtPnxaCg/v2X9M9wGUfnD22wn7n6ejSGk8= 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=if/Qw+9L; arc=fail smtp.client-ip=40.107.200.135 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="if/Qw+9L" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jYnLzh6bIQCnFMD9jzRSr+L1R/SIEWYHRa1Ps2UJ32bG94TldAEl21a/Asah2XHBd1yxsB4BjMS8WJECVi+WL8qul712Jys/7GYmOwEgrEqHHrfhZa5QCs6s+EfaLcbmer50GIqwFB9ygIg4j+vQeMVe4zs3StzBYQN95/N+FoiaGAUYOAVSa5RDahq0I5R5NNuSwQWqpOKsIumUrTqr2Bl/ldGhLfHXF2kBo0C+Qxe+FJT0Gow0QvSOSofE2dAA7oI+YIp6tJoIjEe/Qabb019HouwrWS8C+hceCqbCZMlbVsHOIb/ymS5MyIPh46Irjrehd2s5Pe0vIDdJvjpr5Q== 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=tCAJ75EktdlwyIlq8GyFjYM5y1B214Ldw4A925zUBCA=; b=ZVi3H2BKRc1nJnFKVI0jBBe85d/994oEYIMLm5ovUnIXUsFm0cRl1fKeanPjGb0qeupQW+D2ZSWwd3A5eIh4+5w3KHni1ZqWwrpo7SYHs+lnfNHlLDCjNhudzUe8WP9ACdlMYvb9ky5sopAwaNmplozEA0VRm0SQMiDcTpUIvWDe51zVkW1J9EOVpO2ZN3XXb2GIcBY03hXT2QGQwDetbDCJDEs15U2+HGNptIE6/rsLgmOPvZFGuK3GIgc9mLHk0jdBkrVg4eKfmWP425V0N3zqZBlyHr7jGUsMxBLPS6nLhfuP6RgSY9Hw8psCTo0qWalk5se9WDg45MKiToC1WA== 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=tCAJ75EktdlwyIlq8GyFjYM5y1B214Ldw4A925zUBCA=; b=if/Qw+9LYVQc1NgSkFddK3uCQx9GDMqEmJmZ7q6hGie43c9PHf+ljGHsCiUd0BI+x0JcBET82bzuSG9wQW3QGdcn4m1CqXR12+kBGpS2AQlnx24DTKwcPR5wHpAI1GEVlV7MtgpfrEFv9uCrrzUCBxXVrEk1wVr7eLHDkyH7RE4= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:14:04 +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.8583.041; Thu, 3 Apr 2025 23:14:04 +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 v5 8/9] ACPI: APEI: EINJ: Enable EINJv2 error injections Date: Thu, 3 Apr 2025 16:13:38 -0700 Message-ID: <20250403231339.23708-9-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: 2b383345-3eef-4f65-8670-08dd73053a17 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 7L398faQyqP4N+UL05FcdKowmiILth5ze5XlErbRTu/RollH4wBq8puUM9h119502KvFAKPgOGShVCZduEQ1ay1v3WDYpmi6qQyrjaccCnWlc9zNvmyETUiSOnwuZjLA1B5ePwdIDXABMA/YfqeX1zMEMSjc+k6egeEvUZo/wVmatUjpJVkEtFtKxzNraMERNQTHAoRefDfm98N23xKxoSaJACQX/jER6nDLVTC5gvwFyKNVtqGqZUFMGXWMDw7AROUpggzb/rNXHJxoSEJrNYI+aUDJx/66PRZW2gAve+abZ9Obc5Ho0UTRJBH5BbaO/lVP9Uv4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5nYNr0xzg8N5YQg8frBy3mjoh+WNsd8afqNReuP1j7JUbdb9w+vIdcQbGlSHiihCX9XPiw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: W+7VilQX5Th+3/HM9kdPPA8aFPPeP/vH2pDXrnBf0c4uMDkLUKBm7x9VlxE7wuLUONCpps8/eeuHS0/5Ql4c5FWQXgKQwnjmvnop6orihklfFb4C/u8gys/Lomhlyef+ZLicYZmopkabyuDyRj3RDuivlJqL5whowJ5ls8UtVKmV4JULbroqjNd8lIHqJXOrHfrWE4NhBnn74AlV1UNnzRv/n+AJnzLrUWxVbyCZJRUEfuJCqbitQKtb5LgLBJ339CDFCUatBcvn3OSSDlhtonwr2aQ0+TRmmlqspJp8WLipR9kFt0OOuW6SBVS5gdPDqXeMlJ2pwZf33CZFZvhkgyNk6MM2Ds7Qe/JNZXm44mNmbRiVSNSBzDlIqvIeVTHoppDd+a32dO6CnnErE1uON8R4zg0YnNOjh6IwaGSlf3jcWwD4i1ZdY2rxefQEFnnOBoJtNpd1DyYvBgcObDIKTkmqjxKdIUGDNi8iXikmDADtdVVqEUvdnltDvXQv1EDgS+P0ED+B864SYBhAjAkHCZ+XhZ58IOygbIruA8w+LuO2r7fTrwr1Gpv8DsZrTVQGEkgZ5z2vBEN7kSklATADWxLObLRyzceI+z/EeJBVHSDIBCNCnvRSMf1kcrPr5D2khISo95Qa3sIEJSlEBjBdFkhqwXHQQ6wUKuUZ66DTtBkopV48cM8l6nqpeh53lM9YrtR7ZPV6LFgW6qH/uabDsHOsBfBgtZC2G7Avae59Vo4+WUg/GwbeUm8CPn2Q/nfCSFd7s6LHUHe28ufeKfrs0SeB9IgIDiC8yHrTqBH8buNLfN+Q5yjsDP9AHzTxuG8kHoPWL0vPNfGPOa/7F7EtccLH6laTGFMQgl0O5ouLX03RSSAK+pUAZrXeddWOGx/bMcrFhDD+XXyO+N8tqwvKUPOX+8VP94mwtsgbPEKFl2+mhy+T2khsxLcEv0Y2OhPM8IYoeRulc7EyzcI0/N2Pa9fT9wvN0IJZidsPXqKKp77yFe9PzGh4ECTeVSps6a19HCTk/TusAdCnRZJ5rpjHQozPoGU7G5Bq/fqpkF69mwLDxqhJIksUAePx4OiJqqVrwjDluCZW/JlF7Cq+2ZFQbrJgwo47HniPOOMYUKfruoEwyocouXAZ3aZTN+o2ESYLsVA3Rjf2/SI//ko6OF9TLEnSfS3C5ekz7AuLoVZYpTV5dNj5xsdbfoK0vzPY8PNq5hT5TU8AyJKXn7aoVltaaayr/mm9zJTOYrg39D+G626u6OvWj3pF9IUM08+Cjw/nqlhpbsmK1bvJ0vJeRrPNq47vbW5vOFrrxYONY/ZLygo3zaheEL9EnWbHSanpWhBAAyUTkr4k9K8EwJcCR4dYq9PDQI0GMLw/+V5uqmc1wHBTIul5dC1s+3biKfREEpzc92CD5zHFbN9Fx1/p4X92QVsy40XL2Uj/zE1nC84A6lHr1umqR7Hxtz9tdUYAUhSlnQDSb9/WhDpF8A4xeclKVKyoN9nTfv3ytbg+drhq3sAut1quZbseGb9+GANTLL74+NoxNs0RiYkYTOTv8ZqHYJrvhbhGf73Zq9QRMwHzq1jXVrNZElpRFRIFct6Xki4sq8lT2hk/wR34qUs92uNawEe+vcce6Ws5SmtsyeRY6PI= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b383345-3eef-4f65-8670-08dd73053a17 X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:14:04.5194 (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: nBNmz4kbLafAd9YCwFbdv93FEHkzKjBIfo78b8ixJQEIIdK/O/9kwHAxWMGKlCcl9lWjJe1X/bNSx+YwcJC383HVd32jjsT2frV8ziuzaJyAN1WyM4HHz+hq2p22mGca X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 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 | 108 ++++++++++++++++++++++++++++++---- 1 file changed, 97 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/apei/einj-core.c b/drivers/acpi/apei/einj-core.c index dd7626da360c..b90865c2d995 100644 --- a/drivers/acpi/apei/einj-core.c +++ b/drivers/acpi/apei/einj-core.c @@ -34,6 +34,7 @@ /* Firmware should respond within 1 seconds */ #define FIRMWARE_TIMEOUT (1 * USEC_PER_SEC) #define COMP_ARR_SIZE 1024 +#define COMPONENT_LEN 32 #define ACPI65_EINJV2_SUPP BIT(30) #define ACPI5_VENDOR_BIT BIT(31) #define MEM_ERROR_MASK (ACPI_EINJ_MEMORY_CORRECTABLE | \ @@ -87,6 +88,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, }; /* @@ -110,6 +118,7 @@ static char vendor_dev[64]; static struct debugfs_blob_wrapper einjv2_component_arr; static void *user_input; +static int nr_components; static u32 available_error_type; static u32 available_error_type_v2; @@ -180,6 +189,8 @@ static DEFINE_MUTEX(einj_mutex); bool einj_initialized __ro_after_init; static void __iomem *einj_param; +static u32 v5param_size; +static bool is_V2; static void einj_exec_ctx_init(struct apei_exec_context *ctx) { @@ -287,11 +298,30 @@ static void __iomem *einj_get_parameter_address(void) struct set_error_type_with_address v5param; struct set_error_type_with_address __iomem *p; + v5param_size = sizeof(v5param); p = acpi_os_map_iomem(pa_v5, sizeof(*p)); if (p) { - memcpy_fromio(&v5param, p, sizeof(v5param)); + int offset, len; + + memcpy_fromio(&v5param, p, v5param_size); 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) / COMPONENT_LEN; + /* + * The first call to acpi_os_map_iomem above does not include the + * component array, instead it is used to read and calculate maximum + * number of components supported by the system. Below, the mapping + * is expanded to include the component array. + */ + acpi_os_unmap_iomem(p, v5param_size); + offset = offsetof(struct set_error_type_with_address, einjv2_struct); + v5param_size = offset + struct_size(&v5param.einjv2_struct, + component_arr, nr_components); + p = acpi_os_map_iomem(pa_v5, v5param_size); + } return p; } } @@ -483,10 +513,10 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, return rc; apei_exec_ctx_set_input(&ctx, type); if (acpi5) { - struct set_error_type_with_address *v5param, v5_struct; + struct set_error_type_with_address *v5param; - v5param = &v5_struct; - memcpy_fromio(v5param, einj_param, sizeof(*v5param)); + v5param = kmalloc(v5param_size, GFP_KERNEL); + memcpy_fromio(v5param, einj_param, v5param_size); v5param->type = type; if (type & ACPI5_VENDOR_BIT) { switch (vendor_flags) { @@ -506,8 +536,50 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, v5param->flags = flags; v5param->memory_address = param1; v5param->memory_address_range = param2; - v5param->apicid = param3; - v5param->pcie_sbdf = param4; + + if (is_V2) { + int count = 0, bytes_read, pos = 0, nr_parsed = 0, str_len; + unsigned int comp, synd; + struct syndrome_array *component_arr; + + component_arr = v5param->einjv2_struct.component_arr; + str_len = strlen(user_input); + + while ((nr_parsed = sscanf(user_input + pos, "%x %x\n%n", &comp, + &synd, &bytes_read))) { + pos += bytes_read; + + if (nr_parsed != 2) + goto err_out; + if (count >= nr_components) + 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 (pos >= str_len) + break; + } + v5param->einjv2_struct.component_arr_count = count; + + /* 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: @@ -531,7 +603,8 @@ static int __einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, break; } } - memcpy_toio(einj_param, v5param, sizeof(*v5param)); + memcpy_toio(einj_param, v5param, v5param_size); + kfree(v5param); } else { rc = apei_exec_run(&ctx, ACPI_EINJ_SET_ERROR_TYPE); if (rc) @@ -583,6 +656,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 */ @@ -593,10 +669,15 @@ int einj_error_inject(u32 type, u32 flags, u64 param1, u64 param2, u64 param3, u64 base_addr, size; /* If user manually set "flags", make sure it is legal */ - if (flags && (flags & - ~(SETWA_FLAGS_APICID|SETWA_FLAGS_MEM|SETWA_FLAGS_PCIE_SBDF))) + if (flags && (flags & ~(SETWA_FLAGS_APICID | SETWA_FLAGS_MEM | + SETWA_FLAGS_PCIE_SBDF | SETWA_FLAGS_EINJV2))) return -EINVAL; + /* check if type is a valid EINJv2 error type */ + if (is_V2) { + if (!(type & available_error_type_v2)) + return -EINVAL; + } /* * We need extra sanity checks for memory errors. * Other types leap directly to injection. @@ -746,7 +827,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; @@ -765,9 +846,11 @@ static ssize_t error_type_set(struct file *file, const char __user *buf, if (strncmp(einj_buf, "V2_", 3) == 0) { if (!sscanf(einj_buf, "V2_%llx", &val)) return -EINVAL; + is_V2 = true; } else { if (!sscanf(einj_buf, "%llx", &val)) return -EINVAL; + is_V2 = false; } rc = einj_validate_error_type(val); @@ -789,6 +872,9 @@ static int error_inject_set(void *data, u64 val) if (!error_type) return -EINVAL; + if (is_V2) + error_flags |= SETWA_FLAGS_EINJV2; + return einj_error_inject(error_type, error_flags, error_param1, error_param2, error_param3, error_param4); } @@ -942,7 +1028,7 @@ static void __exit einj_remove(struct platform_device *pdev) if (einj_param) { acpi_size size = (acpi5) ? - sizeof(struct set_error_type_with_address) : + v5param_size : sizeof(struct einj_parameter); acpi_os_unmap_iomem(einj_param, size); From patchwork Thu Apr 3 23:13:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zaid Alali X-Patchwork-Id: 877996 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazon11022079.outbound.protection.outlook.com [40.93.200.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3AC631F3D58; Thu, 3 Apr 2025 23:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.200.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722053; cv=fail; b=bl/JR5I+9IisYeAIJ1PRXDk6w7iVzeib5PiJ7fw3RdEOXP+5DvAIlS9giJK96A+cvyZXZ6HNQI9QKkausbHg/ZRmnPMOpvVEHwvVvAxo+yQQHDHVBQdROX9XRpW31mgWoZqC/tOTS9ZTlRy1++j3aGNV0KhXuu/PNSL4RwmaLxw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743722053; c=relaxed/simple; bh=8l1aecv3m3Eye5jGNqtGIg0tv5Pp21pIoCRGocqzii0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=UTlcthY8Z74TQmMneQEE8DsbsR8HhmVRLKTxP5nPLpk0Y8gLO3kq3KnVK0sh0R1luHvrpjC8qcuFRopBcLHqRs43W3U+VJRZ9Yg0cMmG9rQFNJEQ+4Pyi8hdWqPeNd7CFAHftawRA00xdRte72WqzaKKf2tqXx7ayT2Dj9qSguA= 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=Hzc0VsoI; arc=fail smtp.client-ip=40.93.200.79 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="Hzc0VsoI" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=qBTVC3OBMWncK5xAYjNWdye7uQt0cFBS1jDEAECNsYt3lSWDPjzXWE/aLe14PR1Vip52euEr8BMPLHDs3JX8cxznPehXqoxOvmJ2PLIy0tY/zroGwyzcBJ+u07Ln/CDx65rajOnnnxsbWznlsdQc6J2w6CM8Sj0j+qXC2mVRH09qCW+7plWBsSGynGHFox0CV/iYtNJ9yXxgRY9zbqQCnplvipOWu2itIkgC0HCTEBrmeHI+ZOLXjTt8LoryRIE0xIS4NfjUCzn32hNLOUmP+6XfMpBkHK7kcsb0eSrk9aIMb9JD0oROyVi6BNmsgajPtmMUJhCuZSdnm8VzDT/xhg== 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=yaQEEJnlTyB8l5akguvmwyT5/C8ipo0witpQc+5/aw8=; b=VZKucTgjh2vTJnDZjGHtTOyNRhwUu7pXJlsUIhsBxc3IlwgbAs3PUi121rNSc1oWYg1ciCDF0WSoTLxLLvD9Yko/LrIQRjqmMoQjGhX3ozR1LVV9ZjR4/py008XV+yLorU8ePGtQwf04eu6KrG+XE0c9xQ4okFkir7tpXPHaEFOisWe5OR9U3ofZntRCiaeNTdnBYI3Blvp6VSqEAXuN80w2gzdwakP6FoMQdThd/IBU0S8Fi6ozI09UHfzsOw6wsyB5z8VsOZY9By8JrkoqhyHrqD+el6H4dvSdpZ0vCeRW4dEf6U2I0kWXJ/dFfOPxHIq1WssR09zsX2CAwMbCjA== 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=yaQEEJnlTyB8l5akguvmwyT5/C8ipo0witpQc+5/aw8=; b=Hzc0VsoIxvodlX01iHKOkFhea9oK5NZT2aJQCd8b2v85gqPgMVSdVRojXo/+IBtjzgqHEolqP6hFtfNH8Gp6llViqhsfQmYy093lzurdAUstllXTFnRPw8Gm+0tPObs5qoGUShhluFTgXc/H5u93M1XnrkoR2JDGkz7pht+eoUc= 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 BN0PR01MB6925.prod.exchangelabs.com (2603:10b6:408:168::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.43; Thu, 3 Apr 2025 23:14:06 +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.8583.041; Thu, 3 Apr 2025 23:14:06 +0000 From: Zaid Alali To: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, robert.moore@intel.com, dan.j.williams@intel.com, zaidal@os.amperecomputing.com, Jonathan.Cameron@huawei.com, Benjamin.Cheatham@amd.com, Avadhut.Naik@amd.com, viro@zeniv.linux.org.uk, arnd@arndb.de, ira.weiny@intel.com, dave.jiang@intel.com, sthanneeru.opensrc@micron.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, acpica-devel@lists.linux.dev Subject: [PATCH v5 9/9] ACPI: APEI: EINJ: Update the documentation for EINJv2 support Date: Thu, 3 Apr 2025 16:13:39 -0700 Message-ID: <20250403231339.23708-10-zaidal@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250403231339.23708-1-zaidal@os.amperecomputing.com> References: <20250403231339.23708-1-zaidal@os.amperecomputing.com> X-ClientProxiedBy: MW4PR03CA0246.namprd03.prod.outlook.com (2603:10b6:303:b4::11) To SN7PR01MB7903.prod.exchangelabs.com (2603:10b6:806:34f::17) Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR01MB7903:EE_|BN0PR01MB6925:EE_ X-MS-Office365-Filtering-Correlation-Id: a078f4ff-5066-4dbf-7fe6-08dd73053b1f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|7416014|376014|52116014|366016|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: 1vSB78m5Mhybd6piYpGGiIhVr49+ozsp3DX9VR65WcpPhpDdQdk+e5s6BZpeOHaZOy1UlbKYKA3PmHfQbdxiW/Hd+ZmLuhfD7mOLSCr0CA5L6CN+sPqt6C6smeYNuzj2fUrgVgqhz8pitToLxlDqITznGUMSmt6NkIF0JrGktp7UXvTLgXOXoCx0FCcOy/qnmzjIMr8LsDJymnUkw866SAXVEEikE5ExIpGjA5go5U8rB37W76m4jXfKdGrsQH3mCyyqzzHYbFzTvbkiwd34V0s5sfIGd+B94PQ+xdWTXCxXQsDKIwD3nRKu2UqqKWcyhJXGynnTuh4ydW3Hx3vG4eM5e5+llsrYhCmMYad+PZmXQfSohWehJOMahMXYmQk1leaXfwwCk+XlFf+P5KNxmrSi2GVe8Xagf2f8Rht+CMG1PyxGdq21J1ingguMF/ikoj+hDWhqDuSgQhgz2/hxWVrpIaI9kutBVjyap20QgMCnNekLh2zxoP3StX/VFV+x7ZJULYsuinVSVxyfSmRV3tKD5AxVmBXzCN84P2s62AH69sa52+bwOEKJiTQPt+bKHa+02B+Oq2vRJZPsXWN6fzohO1XnNeUaysgZWPcZ2XHvRVpViKM30Nh2Oos5ZW9JuXSEADMj+PMiTFNThaBPScy9bUQMaQlYJED3o7+gEkAEvF26Alt0nYq5ve2id02tGHMOT7jIn/PmzXmyoJtAN3Y0vnL7mAdiwGeYnmy9LkxuNp9ermyB5dbKxypXXIX3hc/6fFb4QgwTL0QB+Hzw5vauBuyPxaX+mo3eeD4vheI7ldhP2L8wLY/NfgVy+GObcYRJqNq/CuLL9PP5NUAS8lvh9k6NdTMjQDd3xAZgO6QkxX0H2BWQinRgyY8F2tbEiMH/y7WwY9AIbNTal5BiU6tXhdiTkjtQ6YAx7UfFeIIGEn1Z8xOmr8lXVokDcsqtHEG8oqUR7FpoHVynz3Wf8UGreshQ8NECVRe5mh4sFGUK2oqDhutuTymYhNfGT5MgR5pziBTvhCT3EiqGz0e+p4js75whzCZvUK19fJFR/t/wC72ekSGEcV+/DtHE0EK2cVK5itSmvBdQE6t5sgPxMUjvidQtQlerKqHsvyfB8h/8aeSYAFgPlQA1fyKtZnB15PSg5jswe96jO4/4zKb5zZn1Sx+0n3EHI+GAMcDCJpFxOfKCrLsKbdG/Lw74tkFQKdO/vz3pm66kfnxoD+Mq7Tq1B2EtuIYfikyJkHpRMwzdvSglGDnOdnSRQNNuCIPT47TuopDFee9eCCxEPR5C3/amefZrJ1fWcltTB30AX8fay15TioRTLrn/Q6pERWOYtmFYiA65Xm1u9iU8ifMnRa2rMSIUJix0QKauxRV34jzyQHgms7a/K71sffl9qAtrfCI8846bepCdw3jDrtebrL2d9As/6cZHtIOa3Lmp6JEw289rcO05zKzVbzFzmZ28vgU7YV+GgFExI3F3/qPtCw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR01MB7903.prod.exchangelabs.com; PTR:; CAT:NONE; SFS:(13230040)(7416014)(376014)(52116014)(366016)(1800799024)(38350700014)(921020); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-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vkL18Jp9i0zzj7FrW4GcJgtYlLgcrre7zvtS3XX2RwfSG6iuJNddCYoS4HQtQRxB0gEyiyjeXXgrFMKYYvkZqSt3gpoe9s/r7sw0osv11+rtwsWo2RGtQ6HZ+FGOQUEA+QlnejIlc8WIvCBsYLeIJveV54/rhK4y/owd6MBx07DiZKlEVsrBouyCRCFLdBRDe5NF+dS1Xd5fy/9hGtU+Hu8Fp+Pc/C5tQL0vsQmltg06Eco3mV146xz+lEfI3sr5ojGTruz+7y283J1in4M0SuwEpsyjnhgS27Fj+JCXLvTUE3dN134BinN2ViQy54tOFyABFrKJhPKJgjUma9StufbHAbLGDvjGiINScwz5ujXnPjH+SgegB66PJj9p3MpxWO7sqG+uU1c0Bt3kAzWZEW3Nca1FB2qSrVk83cACCD3X21pmr7ctw9eJ78YI7ZBRH15xgWSNpsU/5miRXVqUD64q+Rpg4twhQ2n8TYeKJQJDchG/m521DdN26aZhP9hMU0uQMg8yvbCoMkI9tQWTF87atZEnalOnWlj2BMVv8h0B6kfK1YvvxltIQ= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: a078f4ff-5066-4dbf-7fe6-08dd73053b1f X-MS-Exchange-CrossTenant-AuthSource: SN7PR01MB7903.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2025 23:14:06.1842 (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: pirHuQ1Bv+IhGgtj7AiWz7/Zm+uEkZPxs6Ion8j+ZQGn2aGuXfDRGKJ/ysXpWVdjLKVbBx6Z0JMBPpd2Gvr3u8eQfCcncPwufKTh8JeI9SCKcgvAOWTOcv51Na8lpH5Z X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB6925 Add documentation for the updated ACPI specs for EINJv2(1)(2) (1) https://github.com/tianocore/edk2/issues/9449 (2) https://github.com/tianocore/edk2/issues/9017 Signed-off-by: Zaid Alali Reviewed-by: Jonathan Cameron --- .../firmware-guide/acpi/apei/einj.rst | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Documentation/firmware-guide/acpi/apei/einj.rst b/Documentation/firmware-guide/acpi/apei/einj.rst index c52b9da08fa9..edf3a2165e75 100644 --- a/Documentation/firmware-guide/acpi/apei/einj.rst +++ b/Documentation/firmware-guide/acpi/apei/einj.rst @@ -59,6 +59,9 @@ The following files belong to it: 0x00000200 Platform Correctable 0x00000400 Platform Uncorrectable non-fatal 0x00000800 Platform Uncorrectable fatal + V2_0x00000001 EINJV2 Processor Error + V2_0x00000002 EINJV2 Memory Error + V2_0x00000004 EINJV2 PCI Express Error ================ =================================== The format of the file contents are as above, except present are only @@ -88,6 +91,8 @@ The following files belong to it: Memory address and mask 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. @@ -122,6 +127,13 @@ The following files belong to it: this actually works depends on what operations the BIOS actually includes in the trigger phase. +- 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: @@ -194,6 +206,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 + V2_0x00000001 EINJV2 Processor Error + V2_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 V2_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