From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.44]) by mx.groups.io with SMTP id smtpd.web11.24799.1658134163006418678 for ; Mon, 18 Jul 2022 01:49:23 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=njmEO/bt; spf=pass (domain: arm.com, ip: 40.107.8.44, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=GNBHhIYz6Wp6wJUaZxIEX3NneztdjCXNbdoBiKm4tjC4hQGjTQTsz7myOpunv6LxgLiXH/80+lQuK45NXfvQpptZrEBoEMfaRGjrtmWa/1bSxqKCpkD3FW10ol4VrdSJJhOht800jfmV0nZH4ZEpqplhI21q6Wm3yiHfhBoe23cwunm2XfUxwre/RuhivegEU/aF/R13MX83lQV5fXLQyAXji7h7SZGAX40H/HG2mCiiytZcW5hyeRP1F5kcg+rGSjY2jLageGq4zuPOyB++wUY1oRdnHcCto1WoaGK9mQI3ZNOJz5JaShocK0Ual8tpB2ywrCz9xED7NBQYWl8tKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QJsAb9XIdYyF/vd+1QcvsUZl/6ixsjqoHoNOBOX0LNA=; b=FOzyth5XGvpaNUTwYbirYpvB0Q8nfJnbJD1Qyp43JBZU0tbgSpEp1Vyn2n6SL6o8eFdS15yWf3nnMqN4mFjoNEXPmkYeEtZs0+TMCn6j5q/MR9DfbHHJ0vyWBECcngbfv9z2ze8a4WLlVlXSmCc5YipCwJc5kzS/b6CcMugNeWFfz7tHCoKhat2r+xWlxLEELvCUDJsb5SnPsb65puMG1ugXM4VNH15Hh9OB+cpBfwItcts6tIXAQFE6vhEm/oNyGV6IH+U9YsWMTjJlZef4o/NFEwHh07Dt5ulFSflffMaCqGugxs92XCdKvACpPC9GhJ6ao27WPDlFoilubqWrbw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QJsAb9XIdYyF/vd+1QcvsUZl/6ixsjqoHoNOBOX0LNA=; b=njmEO/bt0LzoPJUoHM/y8stQk+AiN63I7FptJr2miwTd8D71Rzsf5/ZOgyakHFC/VnElwHf5fEGbaXMr5XxpZm5HG6jSDyl7Gnukv0E1WyonjwMON450iIfYeuSlFb2eq99/eujpGjQxRCxrZlriWOXF6IX1as0XubKWlJLo4FU= Received: from AM5PR0201CA0013.eurprd02.prod.outlook.com (2603:10a6:203:3d::23) by VE1PR08MB4911.eurprd08.prod.outlook.com (2603:10a6:802:af::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Mon, 18 Jul 2022 08:49:15 +0000 Received: from AM5EUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:3d:cafe::76) by AM5PR0201CA0013.outlook.office365.com (2603:10a6:203:3d::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23 via Frontend Transport; Mon, 18 Jul 2022 08:49:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT057.mail.protection.outlook.com (10.152.17.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12 via Frontend Transport; Mon, 18 Jul 2022 08:49:14 +0000 Received: ("Tessian outbound cc6a8ab50b6b:v123"); Mon, 18 Jul 2022 08:49:14 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 5d8b5d5d2abee467 X-CR-MTA-TID: 64aa7808 Received: from 1c6dc065278b.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id DD0A2C44-D7CD-47A7-B49F-66B69E71CF7D.1; Mon, 18 Jul 2022 08:49:08 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1c6dc065278b.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 18 Jul 2022 08:49:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DgjlqkwpH19vpoeUUYeIYsN521rSghJnvpeixn9qEVOo1M+TQv4+g99pIS4MPRx3UZrp0OB/8CCCjfCPiF3gPherbMcakN7/kb/WEnNL9XKGACVm+GwuOkk3NdKAm2laNDp/uC//6ttMwVL1Lh0T5jSE/DzL9sXbvYXH/l+INRvkFxMWcOXhBZrl3t1jl+MAWP7Si8ULKqCAwm9u+Q9DpjMtWCSlcLcVyqxn99uNzRU54en3eaPnrIfsBmhI6ExSJ6JrJu/Gz7EjWwfW5upyZBj+IQ6vnU0dpK+iUNrJdsfb6rRAWP1oNtaW7cbnOkmQxF+pJtedf5cF+UOO6tSMCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QJsAb9XIdYyF/vd+1QcvsUZl/6ixsjqoHoNOBOX0LNA=; b=L2LQ+TRptYSFA7oNXBor80TP2n2hLvNwirggP9404vcQzfj2sR7iKjtbq5AlbpofHLOfNi48Ar/eSeK4RditHXstDkE7XhvjgaevvT7KDXq3MhzLZ/uvcLV6s6SNX9SD2+YiiGeTZBSmTVaDXc+foF0XI8ChO4muft9EHNP+54FOjdhnquentD0reghU/mAqYfXkwypDgSKMcYb36JWdB8XRQUbXrwubE5XvISetx/Gq/vrCnTAxBEYokgHKTTJNG/eWIxCKyVq5Ku2HTa6Qpf97o2pa9NbvqmUvMDEnFCBi8Ef+8m+BC51WVzEP+qJV/z4drk5qmKwrjR2C2cYDBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QJsAb9XIdYyF/vd+1QcvsUZl/6ixsjqoHoNOBOX0LNA=; b=njmEO/bt0LzoPJUoHM/y8stQk+AiN63I7FptJr2miwTd8D71Rzsf5/ZOgyakHFC/VnElwHf5fEGbaXMr5XxpZm5HG6jSDyl7Gnukv0E1WyonjwMON450iIfYeuSlFb2eq99/eujpGjQxRCxrZlriWOXF6IX1as0XubKWlJLo4FU= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by DB7PR08MB3563.eurprd08.prod.outlook.com (2603:10a6:10:4d::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.12; Mon, 18 Jul 2022 08:49:01 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9%5]) with mapi id 15.20.5438.023; Mon, 18 Jul 2022 08:49:01 +0000 Message-ID: <2b73b490-9eaf-911a-103e-45f81bcc0d11@arm.com> Date: Mon, 18 Jul 2022 09:48:58 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v6 6/8] ShellPkg: Acpiview: IORT parser update for IORT Rev E.d spec To: devel@edk2.groups.io, zhichao.gao@intel.com Cc: Alexei.Fedorov@arm.com, pierre.gondois@arm.com, steven.price@arm.com, Lorenzo.Pieralisi@arm.com, Matteo.Carlini@arm.com, Akanksha.Jain2@arm.com, Ben.Adderson@arm.com, ray.ni@intel.com, nd@arm.com References: <20220714165031.42640-1-sami.mujawar@arm.com> <20220714165031.42640-7-sami.mujawar@arm.com> From: "Sami Mujawar" In-Reply-To: <20220714165031.42640-7-sami.mujawar@arm.com> X-ClientProxiedBy: LO4P265CA0014.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ad::8) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: e242f7b5-e0ff-4a13-210e-08da689a64b5 X-MS-TrafficTypeDiagnostic: DB7PR08MB3563:EE_|AM5EUR03FT057:EE_|VE1PR08MB4911:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: xS/NPcn9hNKaMY+Hk8hLj6PZ+sP50DYgKixYFoZTmHe7BM6Urivcju/XtfgqkWmPoyQb7skflcrh78BDjparQnj/BU27D+KgBC0n5xy9loA95m4SNaUvk1iw7XJaLvghgqlM7855VgB3GBkiUYQuWc1XMAR+BK6hVNO8tBoguCo11lS2ap3Cr/egKaamAPrjT7vPQvvyUtMXpZymUlFWx5ujvCdiSdxRaD+ctJC/ns2ymIg1dRgObn7sIqMujwQ3H6f4bo0OyVYYe8pE6SuUF9Fzf8Li8W0kwaOPMEUOWlHDbMoB4IlSnrtx9DBsfdTySy8/6SdUsHsF+W2DClPU8zAf7NG7t2MkwF4/MMNjn6qJJk/9Kr5MIgIeXO9RlILw0FzhxXBYAWi/OIGVshrmbgZGkDWiUboeZf3rYbIM9b+LXIRbSd8MQY3qyW3bgoG2AHBnT+PWWRerXCK8sc5TR8UX3tj46PlLaRouspjRBYAARkleeNNDW11DAaHsPR7mGwNvbGGvpXk+oNt5J/aB3/SJL8inYfJe1KzcMGRy5C0EKr8P0BgavA0vp0HkGszP6nIRLZAoOJQ302EBmduZmLLpKSMsXlmy1wTUXf46HqiWBpqU6mvZHywldFhnVe71Z3r8KYmwpRDHInwEGb6OueamPCsqiVc1ChD/X3+xV59dF1ZPyGPrj2+ZfOHTaRjUiZErq6LzeYBluBRQ4vEOdTbfUAtrf8qDr5DePpgSs0gHzuJPZAyCg2vUZyBOyLW4C4nCzI+KzrvdCgW5NglNRav3F+0Iy0YlmVlJu1nWqtOhcgVnwMZHU/Bo7J8neAbu94eMidwn4An2dXx6kdMrDUO+yIEw36xl6SAkmmFKDwGXRAGeRaRhIwiHp9XPhTsGXPc01e2sIUgYFAEjaQGhYQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(136003)(376002)(346002)(396003)(39850400004)(366004)(478600001)(66476007)(8936002)(66946007)(66556008)(4326008)(86362001)(8676002)(31686004)(6486002)(316002)(966005)(36756003)(44832011)(31696002)(30864003)(6666004)(38100700002)(6506007)(5660300002)(53546011)(2906002)(6512007)(26005)(41300700001)(15650500001)(186003)(83380400001)(2616005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR08MB3563 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 65cf69b7-9385-4d4a-1a25-08da689a5bde X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7pJXMfabLxeT1uFBDSxddfkDBc4n05nPgK0mOtTOpx4E1G3U/9MZnfCS1xXiqkuA/sX5q0T3Qm0P/MxfDN3UbgsmKJJL+OmwaTZD4qmmnnHzjVVYYe77+RQ7RRxBR3u28M8voLr+ECazdU8qBfbjgXDPII5tn6wNDvvSueyxu4DMS5JSDKOfB42hCCkrj+GO+g2yHf7tmnOhCOnm1V6Cz1eyScx4Vv/rrbj/iAf6hTZ4gPBUbPMDjCz2IBgx1xtSxyVGBAw7H6tMPcJyAlIQip1ZBnfAbJtzokaBt0gsOUhYzRxdskqniTQn3EAkykbJfMeExoS2Oa5A/B3GF+f9Zp9solkKdsphmO3jhQ7afaTfd6+16QEyaecwdiSanM2GatJv9Rcd/Tjucm7+P3HJLReSMPG2mJyiKhaoRH5XDajf9stlQp3RjwgYlHxf8yiVIdu5meaYaC+NMZgJUyfDYpk7UUCFUngpEqAtTadjWpAjR5ag3SmM3LoLbFVDEm4E5oO2z0kMTykDyjH06NqFkxjrWdFgk1XVs5Z0jpTmWP+0ED2SwC1MHtsZ3J7JjDFX3wzCu1QQ/PmPfetWfb9yUDwkqXEc/cUZRQkZi426UFRTUV9/Y62XdBZFrFOMMXp3NkLKJc4I2j6QPF3pBHpDlwFOMOjppKTshbpNPik9NuoqQcPE2Nb0XLHgGa2eBF6YIVoBekLYjGquQzXKEYo4X1Qm2ZwiMeZVsF5A1GoBLsMpYT/olppsKdFI+no/aK1aS1Sb3AdS58KZBRSl1wHOwIFLf9Jcie0+iTAvBihafkYaJBcWwsiIbnadz1S3GOkWk2iECSYI+TQ2766/Ehqf6nR2/M8p3NjC90QTLOOBpWHxY8/wVyNxFzCzT6J5tXWanqksYGVDF4Be0o9bZAETgQ== X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230016)(4636009)(346002)(39850400004)(396003)(136003)(376002)(36840700001)(46966006)(86362001)(8936002)(8676002)(4326008)(70206006)(31696002)(70586007)(15650500001)(36756003)(6506007)(82740400003)(356005)(53546011)(316002)(31686004)(44832011)(83380400001)(41300700001)(6666004)(2616005)(186003)(36860700001)(478600001)(30864003)(336012)(82310400005)(966005)(47076005)(5660300002)(40480700001)(6486002)(2906002)(81166007)(26005)(6512007)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2022 08:49:14.9409 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e242f7b5-e0ff-4a13-210e-08da689a64b5 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT057.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB4911 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Zhichao, Is it possible to provide your feedback for this patch, please? Regards, Sami Mujawar On 14/07/2022 05:50 pm, Sami Mujawar wrote: > Bugzilla: 3458 - Add support IORT Rev E.d specification updates > (https://bugzilla.tianocore.org/show_bug.cgi?id=3458) > > The IO Remapping Table, Platform Design Document, Revision E.d, > Feb 2022 (https://developer.arm.com/documentation/den0049/) > introduces the following updates, collectively including the > updates and errata fixes to Rev E, Rev E.a, Rev E.b, Rev E.c: > - increments the IORT table revision to 5. > - updates the node definition to add an 'Identifier' field. > - adds definition of node type 6 - Reserved Memory Range node. > - adds definition for Memory Range Descriptors. > - adds flag to indicate PRI support for root complexes. > - adds flag to indicate if the root complex supports forwarding > of PASID information on translated transactions to the SMMU. > - adds flag to indicate if the root complex supports PASID. > - adds flags to define access privilege and attributes for the > memory ranges. > > Therefore, update the IORT parser to: > - parse the Identifier field. > - parse Reserved Memory Range node. > - parse Memory Range Descriptors. > - add validations to check that the physical range base > and size of the Memory Range Descriptor is 64KB aligned. > - add validation to check that the IORT Table Revision is > not 4 as IORT Rev E.c is deprecated. > - add validation to check that the IORT RMR node revision > is not 2 as it breaks backward compatibility and was > deprecated as part of IORT Rev E.c. > - skip parsing of IORT Rev E, Rev E.a, Rev E.b, Rev E.c as > some fields were deprecated in these revisions. > > Signed-off-by: Sami Mujawar > --- > > Notes: > v6: > - Make output format for Flags filed consistent. [PIERRE] > - Define macro for IORT Rev E.c and RMR Node revision 2 [PIERRE] > and use these to check for deprecated table/node > revisions. > - Identifier field size changed between IORT revision E [PIERRE] > and E.a. so extra checks should be needed. > - Added check to skip parsing if IORT Rev E, E. [SAMI] > as various fields were deprecated between revisions. > > v5: > - No code change since v4. Included r-b received for [SAMI] > v5 series. > > v4: > - Add validation to check that the IORT Table Revision is [SAMI] > not 4 as IORT Rev E.c is deprecated. > - Add validation to check that the IORT RMR node revision [SAMI] > is not 2 as it breaks backward compatibility and was > deprecated as part of IORT Rev E.c. > > v3: > - No code change since v1. Included r-b received for [SAMI] > v2 series. > Ref: https://edk2.groups.io/g/devel/topic/83600720#7665 > > v2: > - No code change since v1. Re-sending with v2 series. [SAMI] > > ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c | 230 ++++++++++++++++++-- > 1 file changed, 212 insertions(+), 18 deletions(-) > > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c > index 44d633c5282463078a4cc990bb24ca1992f95634..599cf0ee8f7e4c7ed398fa604602604d1955d2e6 100644 > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Iort/IortParser.c > @@ -1,14 +1,16 @@ > /** @file > IORT table parser > > - Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. > + Copyright (c) 2016 - 2022, Arm Limited. All rights reserved. > SPDX-License-Identifier: BSD-2-Clause-Patent > > @par Reference(s): > - - IO Remapping Table, Platform Design Document, Revision D, March 2018 > + - IO Remapping Table, Platform Design Document, Revision E.d, Feb 2022 > + (https://developer.arm.com/documentation/den0049/) > > @par Glossary: > - Ref - Reference > + - Desc - Descriptor > **/ > > #include > @@ -26,6 +28,7 @@ STATIC CONST UINT32 *IortNodeOffset; > > STATIC CONST UINT8 *IortNodeType; > STATIC CONST UINT16 *IortNodeLength; > +STATIC CONST UINT8 *IortNodeRevision; > STATIC CONST UINT32 *IortIdMappingCount; > STATIC CONST UINT32 *IortIdMappingOffset; > > @@ -36,6 +39,9 @@ STATIC CONST UINT32 *PmuInterruptOffset; > > STATIC CONST UINT32 *ItsCount; > > +STATIC CONST UINT32 *RmrMemDescCount; > +STATIC CONST UINT32 *RmrMemDescOffset; > + > /** > This function validates the ID Mapping array count for the ITS node. > > @@ -100,6 +106,52 @@ ValidateItsIdArrayReference ( > } > } > > +/** > + This function validates that the Physical Range address or length is not zero > + and is 64K aligned. > + > + @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 > +ValidatePhysicalRange ( > + IN UINT8 *Ptr, > + IN VOID *Context > + ) > +{ > + UINT64 Value; > + > + Value = *(UINT64 *)Ptr; > + if ((Value == 0) || ((Value & (SIZE_64KB - 1)) != 0)) { > + IncrementErrorCount (); > + Print (L"\nERROR: Physical Range must be 64K aligned and cannot be zero."); > + } > +} > + > +/** > + This function validates that the RMR memory range descriptor count. > + > + @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 > +ValidateRmrMemDescCount ( > + IN UINT8 *Ptr, > + IN VOID *Context > + ) > +{ > + if (*(UINT32 *)Ptr == 0) { > + IncrementErrorCount (); > + Print (L"\nERROR: Memory Range Descriptor count must be >=1."); > + } > +} > + > /** > Helper Macro for populating the IORT Node header in the ACPI_PARSER array. > > @@ -108,15 +160,15 @@ ValidateItsIdArrayReference ( > @param [out] ValidateIdArrayReference Optional pointer to a function for > validating the ID Array reference. > **/ > -#define PARSE_IORT_NODE_HEADER(ValidateIdMappingCount, \ > - ValidateIdArrayReference) \ > - { L"Type", 1, 0, L"%d", NULL, (VOID**)&IortNodeType, NULL, NULL }, \ > - { L"Length", 2, 1, L"%d", NULL, (VOID**)&IortNodeLength, NULL, NULL }, \ > - { L"Revision", 1, 3, L"%d", NULL, NULL, NULL, NULL }, \ > - { L"Reserved", 4, 4, L"0x%x", NULL, NULL, NULL, NULL }, \ > - { L"Number of ID mappings", 4, 8, L"%d", NULL, \ > - (VOID**)&IortIdMappingCount, ValidateIdMappingCount, NULL }, \ > - { L"Reference to ID Array", 4, 12, L"0x%x", NULL, \ > +#define PARSE_IORT_NODE_HEADER(ValidateIdMappingCount, \ > + ValidateIdArrayReference) \ > + { L"Type", 1, 0, L"%d", NULL, (VOID**)&IortNodeType, NULL, NULL }, \ > + { L"Length", 2, 1, L"%d", NULL, (VOID**)&IortNodeLength, NULL, NULL }, \ > + { L"Revision", 1, 3, L"%d", NULL, (VOID**)&IortNodeRevision, NULL, NULL }, \ > + { L"Identifier", 4, 4, L"0x%x", NULL, NULL, NULL, NULL }, \ > + { L"Number of ID mappings", 4, 8, L"%d", NULL, \ > + (VOID**)&IortIdMappingCount, ValidateIdMappingCount, NULL }, \ > + { L"Reference to ID Array", 4, 12, L"0x%x", NULL, \ > (VOID**)&IortIdMappingOffset, ValidateIdArrayReference, NULL } > > /** > @@ -235,11 +287,13 @@ STATIC CONST ACPI_PARSER IortNodeNamedComponentParser[] = { > **/ > STATIC CONST ACPI_PARSER IortNodeRootComplexParser[] = { > PARSE_IORT_NODE_HEADER (NULL, NULL), > - { L"Memory access properties",8, 16, L"0x%lx", NULL, NULL, NULL, NULL }, > - { L"ATS Attribute", 4, 24, L"0x%x", NULL, NULL, NULL, NULL }, > - { L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL }, > - { L"Memory access size limit",1, 32, L"0x%x", NULL, NULL, NULL, NULL }, > - { L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL } > + { L"Memory access properties",8, 16, L"0x%lx", NULL, NULL, NULL, NULL }, > + { L"ATS Attribute", 4, 24, L"0x%x", NULL, NULL, NULL, NULL }, > + { L"PCI Segment number", 4, 28, L"0x%x", NULL, NULL, NULL, NULL }, > + { L"Memory access size limit",1, 32, L"0x%x", NULL, NULL, NULL, NULL }, > + { L"PASID capabilities", 2, 33, L"0x%x", NULL, NULL, NULL, NULL }, > + { L"Reserved", 1, 35, L"%x", NULL, NULL, NULL, NULL }, > + { L"Flags", 4, 36, L"0x%x", NULL, NULL, NULL, NULL }, > }; > > /** > @@ -253,6 +307,29 @@ STATIC CONST ACPI_PARSER IortNodePmcgParser[] = { > { L"Page 1 Base Address", 8, 32, L"0x%lx", NULL, NULL, NULL, NULL } > }; > > +/** > + An ACPI_PARSER array describing the IORT RMR node. > +**/ > +STATIC CONST ACPI_PARSER IortNodeRmrParser[] = { > + PARSE_IORT_NODE_HEADER (NULL, NULL), > + { L"Flags", 4, 16, L"0x%x", NULL, NULL, NULL, NULL }, > + { L"Memory Range Desc count", 4, 20, L"%d", NULL, > + (VOID **)&RmrMemDescCount, ValidateRmrMemDescCount,NULL }, > + { L"Memory Range Desc Ref", 4, 24, L"0x%x", NULL, > + (VOID **)&RmrMemDescOffset, NULL, NULL } > +}; > + > +/** > + An ACPI_PARSER array describing the IORT RMR Memory Range Descriptor. > +**/ > +STATIC CONST ACPI_PARSER IortNodeRmrMemRangeDescParser[] = { > + { L"Physical Range offset", 8, 0, L"0x%lx", NULL, NULL, ValidatePhysicalRange, > + NULL }, > + { L"Physical Range length", 8, 8, L"0x%lx", NULL, NULL, ValidatePhysicalRange, > + NULL }, > + { L"Reserved", 4, 16, L"0x%x", NULL, NULL, NULL, NULL} > +}; > + > /** > This function parses the IORT Node Id Mapping array. > > @@ -607,9 +684,102 @@ DumpIortNodePmcg ( > ); > } > > +/** > + This function parses the IORT RMR Node Memory Range Descriptor array. > + > + @param [in] Ptr Pointer to the start of the Memory Range Descriptor > + array. > + @param [in] Length Length of the buffer. > + @param [in] DescCount Memory Range Descriptor count. > +**/ > +STATIC > +VOID > +DumpIortNodeRmrMemRangeDesc ( > + IN UINT8 *Ptr, > + IN UINT32 Length, > + IN UINT32 DescCount > + ) > +{ > + UINT32 Index; > + UINT32 Offset; > + CHAR8 Buffer[40]; // Used for AsciiName param of ParseAcpi > + > + Index = 0; > + Offset = 0; > + > + while ((Index < DescCount) && > + (Offset < Length)) > + { > + AsciiSPrint ( > + Buffer, > + sizeof (Buffer), > + "Mem range Descriptor [%d]", > + Index > + ); > + Offset += ParseAcpi ( > + TRUE, > + 4, > + Buffer, > + Ptr + Offset, > + Length - Offset, > + PARSER_PARAMS (IortNodeRmrMemRangeDescParser) > + ); > + Index++; > + } > +} > + > +/** > + This function parses the IORT RMR node. > + > + @param [in] Ptr Pointer to the start of the buffer. > + @param [in] Length Length of the buffer. > + @param [in] MappingCount The ID Mapping count. > + @param [in] MappingOffset The offset of the ID Mapping array > + from the start of the IORT table. > +**/ > +STATIC > +VOID > +DumpIortNodeRmr ( > + IN UINT8 *Ptr, > + IN UINT16 Length, > + IN UINT32 MappingCount, > + IN UINT32 MappingOffset > + ) > +{ > + ParseAcpi ( > + TRUE, > + 2, > + "RMR Node", > + Ptr, > + Length, > + PARSER_PARAMS (IortNodeRmrParser) > + ); > + > + if (*IortNodeRevision == EFI_ACPI_IORT_RMR_NODE_REVISION_02) { > + IncrementErrorCount (); > + Print ( > + L"ERROR: RMR node Rev 2 (defined in IORT Rev E.c) must not be used." > + L" IORT tabe Revision E.c is deprecated and must not be used.\n" > + ); > + } > + > + DumpIortNodeIdMappings ( > + Ptr + MappingOffset, > + Length - MappingOffset, > + MappingCount > + ); > + > + DumpIortNodeRmrMemRangeDesc ( > + Ptr + (*RmrMemDescOffset), > + Length - (*RmrMemDescOffset), > + *RmrMemDescCount > + ); > +} > + > /** > This function parses the ACPI IORT table. > - When trace is enabled this function parses the IORT table and traces the ACPI fields. > + When trace is enabled this function parses the IORT table and traces the ACPI > + fields. > > This function also parses the following nodes: > - ITS Group > @@ -618,6 +788,7 @@ DumpIortNodePmcg ( > - SMMUv1/2 > - SMMUv3 > - PMCG > + - RMR > > This function also performs validation of the ACPI table fields. > > @@ -643,6 +814,22 @@ ParseAcpiIort ( > return; > } > > + if ((AcpiTableRevision > EFI_ACPI_IO_REMAPPING_TABLE_REVISION_00) && > + (AcpiTableRevision < EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05)) > + { > + Print ( > + L"ERROR: Parsing not supported for IORT tabe Revision E, E..\n" > + ); > + if (AcpiTableRevision == EFI_ACPI_IO_REMAPPING_TABLE_REVISION_04) { > + IncrementErrorCount (); > + Print ( > + L"ERROR: IORT tabe Revision E.c is deprecated and must not be used.\n" > + ); > + } > + > + return; > + } > + > ParseAcpi ( > TRUE, > 0, > @@ -765,7 +952,14 @@ ParseAcpiIort ( > *IortIdMappingOffset > ); > break; > - > + case EFI_ACPI_IORT_TYPE_RMR: > + DumpIortNodeRmr ( > + NodePtr, > + *IortNodeLength, > + *IortIdMappingCount, > + *IortIdMappingOffset > + ); > + break; > default: > IncrementErrorCount (); > Print (L"ERROR: Unsupported IORT Node type = %d\n", *IortNodeType);