From nobody Tue Feb 10 10:04:08 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+43940+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1563453175174627.1375976108702; Thu, 18 Jul 2019 05:32:55 -0700 (PDT) Return-Path: X-Received: from EUR02-HE1-obe.outbound.protection.outlook.com (EUR02-HE1-obe.outbound.protection.outlook.com [40.107.1.45]) by groups.io with SMTP; Thu, 18 Jul 2019 05:32:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QVTPYM/w+piUphMelHtnacRRIj0ScsMukYL2UKr5gpSnLgPi+zKM0tsj2lHwggp3poelkVyGG/vUPfXNZXHTQ7NyuL3CQWDKpPgST6m+MQVIyNBsgzV3FJRaiFfMQoxJDsALiccW32uZrmvvnr3AUqmZR35kTdcXgtPyG9ptUQI3GmCwL665GIEuLSdHBcdvMsSuSUUWTmG9fHAuFxCgLKDP2RaZUCr61fcNl6jbPdZ3qz0xd4Wm/Ah2joyaskAp7zph9BeV+rgkrf8StHYtHiFcQad1unyLN0KS9LzDJMTH9U8Nx0jd+gZvZvHi6ShS0/Cec88rmjkEsgMzOYeOHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gX9dJ9s+kYI/CA325gcdOiHHzp1w1rtvk5Nhwv3N8xo=; b=DTxif5RWN8kshZkj8pBSBT4oFJ8tsiOSyLPBZLZf8YmDtxh3JuA/rouXIXBvyp6p1r8pZZW6oh0396EdbUV+ThpUnea31gcNygTNtM0mfio3WEKEEzFu3YNgpf+y91tPZSiwSVKqWELBaQDnWBYkMrL1iJsBqoWQ7c6V3G/0YvkBlRqVGQuYisSK09Gc4l0bx4qRtxVfglPGEJ1SixJBJearfXYInKyPUCuCv6O1L5TeRxz8aEPsucKTXNdoRzQtjsgM359EIysWbKxBL1z/bfUQ7OlKWah5w4CS265QGjnJXLwnERtKxFcA007dHiXoMa6d0mC+SA4n/r6a+wbSQw== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=temperror (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com;dmarc=temperror action=none header.from=arm.com;dkim=none (message not signed);arc=none X-Received: from AM6PR08CA0016.eurprd08.prod.outlook.com (2603:10a6:20b:b2::28) by VI1PR0802MB2608.eurprd08.prod.outlook.com (2603:10a6:800:ae::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2094.12; Thu, 18 Jul 2019 12:32:50 +0000 X-Received: from AM5EUR03FT061.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::200) by AM6PR08CA0016.outlook.office365.com (2603:10a6:20b:b2::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2094.12 via Frontend Transport; Thu, 18 Jul 2019 12:32:49 +0000 Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+43940+1787277+3901457@groups.io; helo=web01.groups.io; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) X-Received: from nebula.arm.com (40.67.248.234) by AM5EUR03FT061.mail.protection.outlook.com (10.152.16.247) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.2052.18 via Frontend Transport; Thu, 18 Jul 2019 12:32:48 +0000 X-Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1415.2; Thu, 18 Jul 2019 12:31:53 +0000 X-Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1415.2; Thu, 18 Jul 2019 12:31:52 +0000 X-Received: from E119924.Arm.com (10.1.199.124) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Thu, 18 Jul 2019 12:31:52 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 6/6] ShellPkg: acpiview: IORT: Refactor PMCG node mapping count validation Date: Thu, 18 Jul 2019 13:31:42 +0100 Message-ID: <20190718123142.5696-7-krzysztof.koch@arm.com> In-Reply-To: <20190718123142.5696-1-krzysztof.koch@arm.com> References: <20190718123142.5696-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ba5d3bc0-75c7-4a4c-c0b2-08d70b7c0b14 X-MS-TrafficTypeDiagnostic: VI1PR0802MB2608: X-Microsoft-Antispam-PRVS: NoDisclaimer: True X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: nOqczlDAU/LqQJPH6Y1wsBPrmCObSVU1SG6mFuinWuXNNhVVcgyZhHBCswEWtBdUSE/wx9d754TAwOUA0fmyqsoCClxTDQ3Lrlfultdu9cjfU0X87MP4W/mgdZRscIZgCAtA/xueB3MFp9DcWCevXzrgNFYLWBXIykc5OXhgaCuJDFy18a82sFDyUFl6DQiuYeTM7N0u0LxD33DFbSb5WtHec6wza7waaWynJYzIJaV0xJrecAA0gI/6Dgz45D+9rTZjDxwUtw7U/NZortPRR35E/CLW3MIJIf0xnyrKHgAYivrpr309KTfgAus4+eHPcrPAaE32AexrmP/ij3Y+xdGadkl0a7Qd/pGRDjW9z2Sry292N7uQWhqYgwvjW04/GV7ApyTAmnQ+cvlgjfATn1KONvR8Yv/QQjBj2gpkJJs= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2019 12:32:48.4723 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ba5d3bc0-75c7-4a4c-c0b2-08d70b7c0b14 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[40.67.248.234];Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0802MB2608 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,krzysztof.koch@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1563453174; bh=Fbq4NBBYdLu+T1Oj8kl1zOzx0wDRBJrx+56TdgwfA+s=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=BglsDrxYvDDc6PuNkef18Uq3IidBciUxkGui5RDfe+WblmlXaddsdBV0ROqgy7E45Jf S5c+kS6+bWZ1OIKCtyQZQMAwo/ojA4CVhwcS7IoicDjS4Jysy12YzAmZHOfAxt5uhiGVB Hgnd/dXwwYi55W7aXLq0lKkaW5wd8xn3bfY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Move Performance Monitoring Counter Group (PMCG) node ID mapping count validation from the core IORT acpiview parser logic to a dedicated function. Now, the pointer to the validation function is passed to the IortNodePmcgParser[] ACPI_PARSER array. This check does not affect the flow of IORT parsing and is limited to a single table field in scope, therefore, it is better to keep it away from the code responsible for traversing the table. Signed-off-by: Krzysztof Koch Reviewed-by: Alexei Fedorov --- Notes: v1: - refactor PMCG node mapping count validation [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 3= 2 ++++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/Iort= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortPa= rser.c index 93f78e1a9786ed53f6b5529f478b72a220b4f8df..4d29ca2818804fb472bec0f632a= 87cd3c8a7cd48 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c @@ -47,6 +47,28 @@ ValidateItsIdMappingCount ( IN VOID* Context ); =20 +/** + This function validates the ID Mapping array count for the Performance + Monitoring Counter Group (PMCG) node. + + @param [in] Ptr Pointer to the start of the field data. + @param [in] Context Pointer to context specific information e.g. this + could be a pointer to the ACPI table header. +**/ +STATIC +VOID +EFIAPI +ValidatePmcgIdMappingCount ( + IN UINT8* Ptr, + IN VOID* Context + ) +{ + if (*(UINT32*)Ptr > 1) { + IncrementErrorCount (); + Print (L"\nERROR: IORT ID Mapping count must not be greater than 1."); + } +} + /** This function validates the ID Mapping array offset for the ITS node. =20 @@ -204,7 +226,7 @@ STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] = =3D { An ACPI_PARSER array describing the IORT PMCG node. **/ STATIC CONST ACPI_PARSER IortNodePmcgParser[] =3D { - PARSE_IORT_NODE_HEADER (NULL, NULL), + PARSE_IORT_NODE_HEADER (ValidatePmcgIdMappingCount, NULL), {L"Base Address", 8, 16, L"0x%lx", NULL, NULL, NULL, NULL}, {L"Overflow interrupt GSIV", 4, 24, L"0x%x", NULL, NULL, NULL, NULL}, {L"Node reference", 4, 28, L"0x%x", NULL, NULL, NULL, NULL}, @@ -567,14 +589,6 @@ DumpIortNodePmcg ( if (*IortIdMappingCount !=3D 0) { DumpIortNodeIdMappings (Ptr, MappingCount, MappingOffset); } - - if (*IortIdMappingCount > 1) { - IncrementErrorCount (); - Print ( - L"ERROR: ID mapping must not be greater than 1. Id Mapping Count =3D= %d\n", - *IortIdMappingCount - ); - } } =20 /** -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#43940): https://edk2.groups.io/g/devel/message/43940 Mute This Topic: https://groups.io/mt/32514387/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-