From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (EUR02-VE1-obe.outbound.protection.outlook.com [40.107.2.53]) by mx.groups.io with SMTP id smtpd.web11.9473.1661338287991586257 for ; Wed, 24 Aug 2022 03:51:29 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=FY2kpVSY; spf=pass (domain: arm.com, ip: 40.107.2.53, mailfrom: rohit.mathew@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=EcPv1gLyxU01rFAMC3AxGXH7b5usi2R3MGvbemtU2Gey6X6UX6DtmzXQTGoYiz/zxb/CGmFm81FA7HY4vGZfw63eoMcxq0XqOPWdiSAMvkV7NLh9Czja0GVEx2yqSheq5e0LBFt1W5wRscnSutKqKkQI/dFVL0xHs2pb3PGYv4tGtAHOO34IHjngODE6o3Jxpwkl4Je1oQMrFgLk//+4rq1tsPqUjDJY8qSGWKYyLffUyj6n17H+51eet4YzXuuI65qN/J36IlKspfbdp4CtfsXsRNp47MPDQUbJv+TZMc04Bv3JppR7Ue1TNY8UHXU6GIgpAKwRQSamZNYiDUxFSw== 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=K0ed9oJeaTGZBlPzSWoNhOoyaP3vJxaM+WeMwV3ucGM=; b=AfrIeElUvWDJZXtSsbllyTvLe0FIQ8xDWWAeTidzWREfitrbrv8ylD1w7rtv2UXfwprp1C+nNpAMwAP8/QnnCcBxtCLLtg3TGpEPYJbgOo7EHWSRzF8x9UhiyFxFHXH+3eRtGx0pdx+vgM85TbBUT1ziCDCMmkmdepLCdIToZChA2AOXIaiIPV1TuYbn9Y9e9+Lwkyil2pu1AMTyRFSGQSQHX7pjJ/N4PSZttKwi/8F/OaOKylOZA8D3BD0+FyRqT06ToLHK6f887HuGAD5ErqVXlijs9WzhdWo/uvFIms6Y7bbz2/jAjruH3k8Essjw83GFZ/fzg+zHQmPEGXTCwA== 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=K0ed9oJeaTGZBlPzSWoNhOoyaP3vJxaM+WeMwV3ucGM=; b=FY2kpVSYRwGwKQBF4z3pmh9YTm+ll1pdmMgVhNKNhuXUOX6FKzBPAYGN/hycM2bRrBxfrZzbG9f8uO19PAvNj+QkgtzcN1eLSWQBl1/ttsnjnhnWogEVx9Yhp/R1De5TLtGr9Ihv9+HhaiV2NyZodu1VnxHt1zxdhIIkq/BqWfQ= Received: from AM6P191CA0061.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:7f::38) by HE1PR0801MB2025.eurprd08.prod.outlook.com (2603:10a6:3:50::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.18; Wed, 24 Aug 2022 10:51:22 +0000 Received: from AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:7f:cafe::dc) by AM6P191CA0061.outlook.office365.com (2603:10a6:209:7f::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14 via Frontend Transport; Wed, 24 Aug 2022 10:51:22 +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 AM7EUR03FT059.mail.protection.outlook.com (100.127.140.215) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Wed, 24 Aug 2022 10:51:22 +0000 Received: ("Tessian outbound 6a3290ff1310:v123"); Wed, 24 Aug 2022 10:51:22 +0000 X-CR-MTA-TID: 64aa7808 Received: from 163d115f0800.3 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6CB5FCC2-6BEF-4198-BBE8-54C74F471761.1; Wed, 24 Aug 2022 10:51:16 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 163d115f0800.3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 24 Aug 2022 10:51:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EkZ2bDhPtwjn0lMz+hGgHleh8QMg/Z09w9enMZ3MUHwkv8C/F0PU3OVN6MpQZC4CuGhO07fC4xgDsvgh8f0nAAqdnqrtSQdTYvBUuD98oV3S7UZp4V3Vhmowf91Dv4a9HroWytjUU5+oQw6Jo7Uyn9G3W0VgZoIrmp4v7hw0M504z8Laek9TvrwhpPJq9jZtkwWn0gk0gPT+GGNVBASV0xP4m/am/kXC3PXfbP3tdF4Qd0Srrt8hRpkcKz3nChowFcxXghaihI/jA2eYroI1E0xvydOLgVwuuWqXpLvY4iHzXcVr20RFgyOr0AW8fkNmtcpXg+btdliZj4tSBHzRgg== 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=K0ed9oJeaTGZBlPzSWoNhOoyaP3vJxaM+WeMwV3ucGM=; b=hkDPyOT4bTIQzzMvmZVv1mgfzveKocRZBErgNhMiLmOcmvzH085RiCuZSqWDhK5BWP/tH3GnPunyPOo+4EsUqxJL+LgqvvVji9ZgP+C0HeXdqd3IF5iBTn71LAZ4iN3McclrPgCmCGxD+UBsV5mu3jx7IfwmLVX8qDuNDd46F55mIHcaw5FV8QYEpUN5bMKeGyfoZMf8/5g0qHcsD53psYsjlZP0f0ReFso//ZyheMk8giDmYvgMrMXmgTBf1zlYkDYLKzwCBHkSQxhoHdge9Hxz7CSB0skPDgL3JxtOXnAM8FqmG2npfmv3VMiO90L4OH0QVH6Q+e/tkP0/UIaybg== 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=K0ed9oJeaTGZBlPzSWoNhOoyaP3vJxaM+WeMwV3ucGM=; b=FY2kpVSYRwGwKQBF4z3pmh9YTm+ll1pdmMgVhNKNhuXUOX6FKzBPAYGN/hycM2bRrBxfrZzbG9f8uO19PAvNj+QkgtzcN1eLSWQBl1/ttsnjnhnWogEVx9Yhp/R1De5TLtGr9Ihv9+HhaiV2NyZodu1VnxHt1zxdhIIkq/BqWfQ= Received: from AM6PR08MB3783.eurprd08.prod.outlook.com (2603:10a6:20b:8a::13) by DB6PR08MB2629.eurprd08.prod.outlook.com (2603:10a6:6:22::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Wed, 24 Aug 2022 10:51:13 +0000 Received: from AM6PR08MB3783.eurprd08.prod.outlook.com ([fe80::2012:400b:f926:7801]) by AM6PR08MB3783.eurprd08.prod.outlook.com ([fe80::2012:400b:f926:7801%6]) with mapi id 15.20.5546.024; Wed, 24 Aug 2022 10:51:13 +0000 From: "Rohit Mathew" To: "devel@edk2.groups.io" , Swatisri Kantamsetti CC: Thomas Abraham , Thanu Rangarajan , nd , Andrew Fish , Sami Mujawar , Alexei Fedorov , "michael.d.kinney@intel.com" , "gaoliming@byosoft.com.cn" , "zhiguang.liu@intel.com" Subject: Re: [edk2-devel] [PATCH 2/2] Dynamic Tbl Mgr: MPAM: MPAM Generator and supporting files Thread-Topic: [edk2-devel] [PATCH 2/2] Dynamic Tbl Mgr: MPAM: MPAM Generator and supporting files Thread-Index: AQHYsb2AG22NGPQPJk6CwfZk+a3M1K21KmvwgAi/kwA= Date: Wed, 24 Aug 2022 10:51:13 +0000 Message-ID: References: <7f8a5c9bbdf1a1f01c6fc822fa298067d280079a.1660667637.git.swatisrik@nvidia.com> <6fcb277bec0d58c11a6af6b2cbbea57177f3722e.1660667637.git.swatisrik@nvidia.com> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 9A920258B9C487418E30BB5B64F14168.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-MS-Office365-Filtering-Correlation-Id: 68ad377d-d90a-4e41-e05b-08da85be959c x-ms-traffictypediagnostic: DB6PR08MB2629:EE_|AM7EUR03FT059:EE_|HE1PR0801MB2025: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: 0oShCM19sPcZG5JdgzthYwI1P+FS1ZllFErUCznBriMdsWSRAshUepJLtraHA/eWHUmdXBxKFdfvfWXuKbFcg5IYbubadTWFPWIUV7rlj0SluYnnZkw7dBZmjQAGbrXHtVn+dwfve2Mm3HGLJqmdfuYTrAwD1kdFMCDAdaA0iscfdfSw7fXXyBzMGt4UMCL/YcLbZLCK7aCAM2ptI+R4r6K5ubKhit61z+qqbqVH1EYxnXti5UD/fMZHoFQBKMT93vBisHn0bgeS3y/nlQTwgmjcYYmt14eokMUuRePloLz5M6pV1yBMLRw5P3z73j2j/2NKlcAM5KwtY5yverVo5Ulb+I4PDuADgUmoVBg6nlJkaWp1wqfiq7kHa6h1NrddTOJQ5S7cpQ2Tt5VIXG0/YWyMdhV+p8xVh/fOQgG5/fDMS0mOVzwV4HaCu3RL93llxsnSHv3jiezOq3xQXs35ieybGhWLki2Dy+eJ2jmNy1IxsU+6Ei/T0RYvMsqBFDsh7GCOlfondETp2me8rFI/Jtd+iK+6Y0JjIYZntuhmYRa7oJ4bUiRAcffjIVfXJmWBIgEJaM2BEF1A7UHb7+0IiBBh5RRe0K/+hm0YIgerVK27N0Am4vD2IEerHwklY9Bl6i8t//Nsw/1bTWNkoguxnd18zCyGRcGf/H88UIwQuZ1cd2rjkx//e6oKOQZ3bYyWhy3ltXxPrcnYVmtNWvIL+5zNQYE+OaWdXBUptroAmNyAnB1tC9Tb6iYiXTr9h9KWDaC5IsdCTiOwRM5uyHGS+4J078mubQcJWmmjzjyIh/bfSOKTaXGCh6Y+PxtVl9MDJ4n7OuRXlJQRS7IacFjJzw== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3783.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(376002)(366004)(136003)(396003)(346002)(83380400001)(7696005)(2906002)(41300700001)(6506007)(53546011)(5660300002)(55016003)(30864003)(9686003)(478600001)(966005)(71200400001)(66476007)(110136005)(54906003)(316002)(33656002)(38100700002)(122000001)(186003)(86362001)(38070700005)(8936002)(4326008)(8676002)(76116006)(64756008)(66946007)(66556008)(66446008)(52536014)(579004)(559001);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR08MB2629 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Rohit.Mathew@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 4389632e-17c3-435e-c7f4-08da85be9016 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hdAnCSp7rSGS+k2uKnquaGT8JapBgSyK27ZVIKcrfwbtpv1UOIx2h8iLRKcYy9Q1qNn8dwrFAHdjmOWTVLBLBLKxoyI/+kX4TQ/JgZOMGyRsfRhaYF/RCBBImdJDMoDkpmqNrA7JcZKqkSiOtPZKJkX1mEXBPoVK7/URelBGw9RRUPpZDqQqeg8giLBrWLsfxWzD5KX4pVPGJZwSrwlBMUyz/ygvj4ghwJVd+ovAe/qDQE7/3KxpkvVx+miKlj3Qs+UwmlheolnA8C+T/VLiUoWGk6IUK9/cs+c2IFVJxGPsMlT3SsQdQdlHkA37j+DWRGO7RP5MpVKUGjwKaE/5IwWT+PMTkk8ALtoY3Y4YK/cc0c9y33NViuxw6wLORU/fLNEeyvQ6ur1qXyLuNKBKDkAASnjZcI+KYA4ZiQR2yeXYRujdRxgdJlySpIUaHmuxDNz0FI7huZSV8oAm7EjstJheQGfCXvSVy+RX1JgmN4qEn9QHSVybfCriWX8HaWzTjnijl2DZUHIhGPq9wCG7zU2sUx49gXDsO4vDpnZzj7gLByhWvaio9PiGU89IIf9tu4bzL5uf5jQq/k80afwUrjq4eI780FrkYHW7ljWk5JUBgbRs3e5HHK7swR9hs0kYOzMFFimygGUUjv8ButO308lFFHalGGG0TYojTdv7SCH7hi25XeTjtZTGIws+GRZQv/LVLQaWhe62cxc5tAmcjzYIEYXBEuMrxxjqIdllSNU/pDcoxFkRUy0Z/D44VBmJbhNzNN3uYYR8ZTE7dUA32hlwJUYUtLDaGyDbOxXRgtlc+joUOubS1mDlCKBjxbLA6l9W4s3e0zlwiOdpUVTbRleFGbB3QNLLLsvUXRNcG2cxtpOkZnnzfef0i/A3nb+I 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)(136003)(396003)(39860400002)(376002)(346002)(46966006)(36840700001)(40470700004)(83380400001)(81166007)(36860700001)(356005)(82740400003)(40460700003)(70586007)(70206006)(4326008)(110136005)(54906003)(82310400005)(8676002)(316002)(2906002)(30864003)(47076005)(52536014)(55016003)(40480700001)(5660300002)(7696005)(6506007)(9686003)(53546011)(26005)(8936002)(336012)(186003)(107886003)(478600001)(966005)(41300700001)(86362001)(33656002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2022 10:51:22.5775 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 68ad377d-d90a-4e41-e05b-08da85be959c 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: AM7EUR03FT059.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB2025 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Swatisri, I have dropped comments on the Flag's type based on Andrew's feedback. Regards, Rohit > -----Original Message----- > From: Rohit Mathew > Sent: 19 August 2022 09:26 > To: devel@edk2.groups.io; username@nvidia.com; Sami Mujawar > ; Alexei Fedorov ; > michael.d.kinney@intel.com; gaoliming@byosoft.com.cn; > zhiguang.liu@intel.com > Cc: Swatisri Kantamsetti ; Thomas Abraham > ; Thanu Rangarajan > ; nd > Subject: RE: [edk2-devel] [PATCH 2/2] Dynamic Tbl Mgr: MPAM: MPAM > Generator and supporting files >=20 > Hi Swatisri, >=20 > Thanks for the patch. Please find my comments inline marked [Rohit] - >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Name > > via groups.io > > Sent: 16 August 2022 21:18 > > To: devel@edk2.groups.io; Sami Mujawar ; > Alexei > > Fedorov ; michael.d.kinney@intel.com; > > gaoliming@byosoft.com.cn; zhiguang.liu@intel.com > > Cc: Swatisri Kantamsetti > > Subject: [edk2-devel] [PATCH 2/2] Dynamic Tbl Mgr: MPAM: MPAM > > Generator and supporting files > > > > From: Swatisri Kantamsetti > > > > ACPI header, MSC and Resource Nodes are populated in the MPAM Table > > > > Signed-off-by: Swatisri Kantamsetti > > --- > > DynamicTablesPkg/DynamicTables.dsc.inc | 2 + > > DynamicTablesPkg/Include/AcpiTableGenerator.h | 1 + > > .../Include/ArmNameSpaceObjects.h | 68 ++ > > .../Arm/AcpiMpamLibArm/AcpiMpamLibArm.inf | 30 + > > .../Acpi/Arm/AcpiMpamLibArm/MpamGenerator.c | 649 > > ++++++++++++++++++ > > .../Acpi/Arm/AcpiMpamLibArm/MpamGenerator.h | 47 ++ > > 6 files changed, 797 insertions(+) > > create mode 100644 > > > DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/AcpiMpamLibArm.in > > f > > create mode 100644 > > DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/MpamGenerator.c > > create mode 100644 > > > DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/MpamGenerator.h > > > > diff --git a/DynamicTablesPkg/DynamicTables.dsc.inc > > b/DynamicTablesPkg/DynamicTables.dsc.inc > > index 3d4fa0c4c4..745d5f0633 100644 > > --- a/DynamicTablesPkg/DynamicTables.dsc.inc > > +++ b/DynamicTablesPkg/DynamicTables.dsc.inc > > @@ -29,6 +29,7 @@ > > DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/AcpiIortLibArm.inf > > > DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibArm.inf > > > DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibArm.inf > > + > > > DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/AcpiMpamLibArm.in > > f > > DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/AcpiPpttLibArm.inf > > DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm.inf > > DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm.inf > > @@ -54,6 +55,7 @@ > > > > > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibAr > > m.inf > > > > > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibAr > > m.inf > > > > > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/AcpiPpttLibArm. > > inf > > + > > + > > > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/AcpiMpamLib > > Arm.i > > + nf > > > > > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm. > > inf > > > > > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm. > > inf > > > > > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/AcpiSratLibArm.i > > nf > > diff --git a/DynamicTablesPkg/Include/AcpiTableGenerator.h > > b/DynamicTablesPkg/Include/AcpiTableGenerator.h > > index f962dbff57..56d7375b4a 100644 > > --- a/DynamicTablesPkg/Include/AcpiTableGenerator.h > > +++ b/DynamicTablesPkg/Include/AcpiTableGenerator.h > > @@ -94,6 +94,7 @@ typedef enum StdAcpiTableId { > > EStdAcpiTableIdIort, ///< IORT Generator > > EStdAcpiTableIdPptt, ///< PPTT Generator > > EStdAcpiTableIdSrat, ///< SRAT Generator > > + EStdAcpiTableIdMpam, ///< MPAM Generator > > EStdAcpiTableIdSsdtSerialPort, ///< SSDT Serial-Port = Generator > > EStdAcpiTableIdSsdtCmn600, ///< SSDT Cmn-600 Gene= rator > > EStdAcpiTableIdSsdtCpuTopology, ///< SSDT Cpu Topology > > diff --git a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h > > b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h > > index 102e0f96be..39a14ed0b3 100644 > > --- a/DynamicTablesPkg/Include/ArmNameSpaceObjects.h > > +++ b/DynamicTablesPkg/Include/ArmNameSpaceObjects.h > > @@ -63,6 +63,8 @@ typedef enum ArmObjectID { > > EArmObjPciInterruptMapInfo, ///< 39 - Pci Interrupt Map Inf= o > > EArmObjRmr, ///< 40 - Reserved Memory Range= Node > > EArmObjMemoryRangeDescriptor, ///< 41 - Memory Range > Descriptor > > + EArmObjMscNodeInfo, ///< 40 - Msc Memory System Con= troller > > Node Info > > + EArmObjResNodeInfo, ///< 41 - Res Resource Node Inf= o > > EArmObjMax > > } EARM_OBJECT_ID; > > > > @@ -1070,6 +1072,72 @@ typedef struct CmArmRmrDescriptor { > > UINT64 Length; > > } CM_ARM_MEMORY_RANGE_DESCRIPTOR; > > > > +/** A structure that describes Memory System Controller Node. > > + > > + MPAM Memory System Component Nodes are described by > > + this object. > > + > > + ID: EArmObjMscNodeInfo > > +*/ > > +typedef struct CmArmMscNodeInfo { > > + /// An unique token used to identify this object > > + CM_OBJECT_TOKEN Token; > > + > > + /// MPAM Base Address > > + UINT64 BaseAddress; > > + /// MMIO Size > > + UINT32 MmioSize; > > + /// Overflow Interrupt > > + UINT32 OverflowInterrupt; > > + /// Overflow Interrupt Flags > > + UINT32 OverflowInterruptFlags; >=20 > [Rohit] I have added a comment on Flag's type in [PATCH 1/2]. Same > comment here. [Rohit] Please ignore this. >=20 > > + /// Overflow Interrupt Affinity > > + UINT32 OverflowInterruptAff; > > + /// Error Interrupt > > + UINT32 ErrorInterrupt; > > + /// Error Interrupt Flags > > + UINT32 ErrorInterruptFlags; > > + /// Error Interrupt Affinity > > + UINT32 ErrorInterruptAff; > > + /// Not Ready Signal time > > + UINT32 MaxNRdyUsec; > > + /// Linked Device HWID > > + UINT64 LinkedDeviceHwId; > > + /// Linked Device Instance ID > > + UINT32 LinkedDeviceInstanceHwId; > > + /// Number of Resource nodes > > + UINT32 NumResourceNodes; > > + /// Reference token for the list of resource nodes > > + //CM_OBJECT_TOKEN ResourceNodeListToken; > > + > > +} CM_ARM_MSC_NODE_INFO; > > + > > +/** A structure that describes Memory System Controller Node. > > + > > + MPAM Memory System Component Nodes are described by > > + this object. > > + > > + ID: EArmObjResNodeInfo > > +*/ > > +typedef struct CmArmResNodeInfo { > > + /// An unique token used to identify this object > > + CM_OBJECT_TOKEN Token; > > + > > + /// Identifier > > + UINT32 Identifier; > > + /// RIS Index > > + UINT8 RisIndex; > > + /// Locator Type > > + UINT8 LocatorType; > > + /// Locator > > + UINT64 Locator; >=20 > [Rohit] I have added a comment on Locator's type and size in [PATCH 1/2]. > Same comment here. >=20 > > + /// Num functional dependencies > > + UINT32 NumFuncDep; > > + /// Reference token for the list of resource nodes > > + CM_OBJECT_TOKEN FuncDepListToken; > > + > > +} CM_ARM_RESOURCE_NODE_INFO; > > + > > #pragma pack() > > > > #endif // ARM_NAMESPACE_OBJECTS_H_ > > diff --git > > > a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/AcpiMpamLibArm > > .inf > > > b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/AcpiMpamLibArm > > .inf > > new file mode 100644 > > index 0000000000..480130dc21 > > --- /dev/null > > +++ > > > b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/AcpiMpamLibArm > > .in > > +++ f > > @@ -0,0 +1,30 @@ > > +## @file > > +# MPAM Table Generator Inf file > > +# > > +# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. > > +# Copyright (c) 2022, ARM Limited. All rights reserved. > > +# SPDX-License-Identifier: BSD-2-Clause-Patent ## > > + > > +[Defines] > > + INF_VERSION =3D 0x0001001B > > + BASE_NAME =3D AcpiMpamLibArm > > + FILE_GUID =3D 02d0c79f-41cd-45c9-9835-781229c619d1 > > + VERSION_STRING =3D 1.0 > > + MODULE_TYPE =3D DXE_DRIVER > > + LIBRARY_CLASS =3D NULL|DXE_DRIVER > > + CONSTRUCTOR =3D AcpiMpamLibConstructor > > + DESTRUCTOR =3D AcpiMpamLibDestructor > > + > > +[Sources] > > + MpamGenerator.c > > + MpamGenerator.h > > + > > +[Packages] > > + EmbeddedPkg/EmbeddedPkg.dec > > + DynamicTablesPkg/DynamicTablesPkg.dec > > + MdeModulePkg/MdeModulePkg.dec > > + MdePkg/MdePkg.dec > > + > > +[LibraryClasses] > > + BaseLib > > diff --git > > > a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/MpamGenerator. > > c > > > b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/MpamGenerator. > > c > > new file mode 100644 > > index 0000000000..db3e8e95bc > > --- /dev/null > > +++ > > > b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/MpamGenerator. > > c > > @@ -0,0 +1,649 @@ > > +/** @file > > + MPAM Table Generator > > + > > + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. > > + Copyright (c) 2022, ARM Limited. All rights reserved. > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > + @par Reference(s): > > + - ACPI 6.4 Specification, January 2021 > > + > > + @par Glossary: > > + - Cm or CM - Configuration Manager > > + - Obj or OBJ - Object > > +**/ > > + > > +#include > > +#include > > +#include > > +#include > > +#include #include > > + > > + > > +// Module specific include files. > > +#include > > +#include #include > > + #include > > +#include > > + > > +#include "MpamGenerator.h" > > + > > +/** > > + ARM standard MPAM Generator > > + > > + Requirements: > > + The following Configuration Manager Object(s) are used by this > > Generator: > > + - EArmObjMscNodeInfo (REQUIRED) > > + - EArmObjResNodeInfo > > +*/ > > + > > +/** > > + This macro expands to a function that retrieves the MSC Node > > +information > > + from the Configuration Manager. > > +*/ > > +GET_OBJECT_LIST ( > > + EObjNameSpaceArm, > > + EArmObjMscNodeInfo, > > + CM_ARM_MSC_NODE_INFO > > + ); > > + > > +/** > > + This macro expands to a function that retrieves the Resource Node > > + information from the Configuration Manager. > > +*/ > > +GET_OBJECT_LIST ( > > + EObjNameSpaceArm, > > + EArmObjResNodeInfo, > > + CM_ARM_RESOURCE_NODE_INFO > > + ); > > + > > +/** > > + Returns the size of the MPAM Memory System Controller (MSC) Node > > + > > + @param [in] Node Pointer to MSC Node Info CM object > > + > > + @retval Size of the MSC Node in bytes. > > +**/ > > +STATIC > > +UINT32 > > +GetMscNodeSize ( > > + IN CONST CM_ARM_MSC_NODE_INFO *Node > > + ) > > +{ > > + ASSERT (Node !=3D NULL); > > + > > + // > > + return (UINT32)(sizeof (EFI_ACPI_6_4_MPAM_MSC_NODE) + > > + Node->NumResourceNodes * sizeof > > +(EFI_ACPI_6_4_MPAM_RESOURCE_NODE)); >=20 > [Rohit] Shouldn't the node size include the size of functional dependency > descriptor * number of functional dependency descriptor? >=20 > > +} > > + > > +/** Returns the total size required for the MSC and > > + updates the Node Indexer. > > + > > + This function calculates the size required for the node group > > + and also populates the Node Indexer array with offsets for the > > + individual nodes. > > + > > + @param [in] NodeStartOffset Offset from the start of the > > + MPAM where this node group start= s. >=20 > [Rohit] Should it be "start of the MPAM table where .."? >=20 > > + @param [in] NodeList Pointer to MSC Group node list. > > + @param [in] NodeCount Count of the MSC Group nodes. > > + @param [in, out] NodeIndexer Pointer to the next Node Indexer= . > > + > > + @retval Total size of the ITS Group Nodes. > > +**/ > > +STATIC > > +UINT64 > > +GetSizeofMscGroupNodes ( > > + IN CONST UINT32 NodeStartOffset, > > + IN CONST CM_ARM_MSC_NODE_INFO *NodeList, > > + IN UINT32 NodeCount, > > + IN OUT MPAM_NODE_INDEXER **CONST NodeIndexer > > + ) > > +{ > > + UINT64 Size; > > + > > + ASSERT (NodeList !=3D NULL); > > + > > + Size =3D 0; > > + while (NodeCount-- !=3D 0) { > > + (*NodeIndexer)->Token =3D NodeList->Token; > > + (*NodeIndexer)->Object =3D (VOID *)NodeList; > > + (*NodeIndexer)->Offset =3D (UINT32)(Size + NodeStartOffset); > > + DEBUG (( > > + DEBUG_INFO, > > + "MPAM: MSC Node Indexer =3D %p, Token =3D %p, Object =3D %p, Off= set =3D > > 0x%x\n", > > + *NodeIndexer, > > + (*NodeIndexer)->Token, > > + (*NodeIndexer)->Object, > > + (*NodeIndexer)->Offset > > + )); > > + > > + Size +=3D GetMscNodeSize (NodeList); > > + > > + (*NodeIndexer)++; > > + NodeList++; > > + } > > + > > + return Size; > > +} > > + > > +/** Update the MSC Group Node Information. > > + > > + @param [in] This Pointer to the table Generator. > > + @param [in] CfgMgrProtocol Pointer to the Configuration Mana= ger > > + Protocol Interface. > > + @param [in] Mpam Pointer to MPAM table structure. > > + @param [in] NodesStartOffset Offset for the start of the Msc G= roup > > + Nodes. > > + @param [in] NodeList Pointer to an array of Msc Group = Node > > + Objects. > > + @param [in] NodeCount Number of Msc Group Node Objects. > > + > > + @retval EFI_SUCCESS Table generated successfully. > > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > > + @retval EFI_NOT_FOUND The required object was not found. > > +**/ > > +STATIC > > +EFI_STATUS > > +AddMscNodes ( > > + IN CONST ACPI_TABLE_GENERATOR > *CONST > > This, > > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL > > *CONST CfgMgrProtocol, > > + IN CONST > > > EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > > G_TABLE_HEADER *Mpam, > > + IN CONST UINT32 > > NodesStartOffset, > > + IN CONST CM_ARM_MSC_NODE_INFO > > *NodeList, > > + IN UINT32 = NodeCount > > + ) > > +{ > > + EFI_STATUS Status; > > + EFI_ACPI_6_4_MPAM_MSC_NODE *MscNode; > > + EFI_ACPI_6_4_MPAM_RESOURCE_NODE *ResourceNodeArray; > > + CM_ARM_RESOURCE_NODE_INFO *ResourceNodeList; > > + UINT64 NodeLength; > > + UINT32 ResourceNodeCount; > > + > > + ASSERT (Mpam !=3D NULL); > > + > > + MscNode =3D (EFI_ACPI_6_4_MPAM_MSC_NODE *)((UINT8 *)Mpam + > > + NodesStartOffset); > > + > > + // Get the Resource Node info to update the MPAM MSC node Status = =3D > > + GetEArmObjResNodeInfo ( > > + CfgMgrProtocol, > > + CM_NULL_TOKEN, > > + &ResourceNodeList, > > + &ResourceNodeCount > > + ); > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Failed to add resource nodes info. Status =3D %r\n= ", > > + Status > > + )); > > + return Status; > > + } > > + > > + while (NodeCount-- !=3D 0) { > > + NodeLength =3D GetMscNodeSize (NodeList); > > + > > + if (NodeLength > MAX_UINT16) { > > + Status =3D EFI_INVALID_PARAMETER; > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: MSC Node length 0x%lx > MAX_UINT16. Status =3D > > %r\n", > > + NodeLength, > > + Status > > + )); > > + return Status; > > + } > > + > > + // Populate the node header > > + MscNode->Length =3D (UINT16)NodeLength; > > + MscNode->Reserved =3D EFI_ACPI_RESERVED_WORD; > > + MscNode->Identifier =3D EFI_ACPI_RESERVED_DWORD; >=20 > [Rohit] MPAM ACPI 1.0, section 2.1, table 4 - MSC node body, defines > identifier as a unique value. For systems with multiple MSCs, the OS coul= d > expect identifiers to be unique. Could this be addressed, please? >=20 > > + MscNode->BaseAddress =3D NodeList->BaseAddress; > > + MscNode->MmioSize =3D NodeList->MmioSize; > > + MscNode->OverflowInterrupt =3D NodeList->OverflowInterrupt; > > + MscNode->OverflowInterruptFlags =3D NodeList- > >OverflowInterruptFlags; > > + MscNode->Reserved1 =3D EFI_ACPI_RESERVED_DWORD; > > + MscNode->OverflowInterruptAff =3D NodeList->OverflowInterruptA= ff; > > + MscNode->ErrorInterrupt =3D NodeList->ErrorInterrupt; > > + MscNode->ErrorInterruptFlags =3D NodeList->ErrorInterruptFlag= s; > > + MscNode->Reserved2 =3D EFI_ACPI_RESERVED_DWORD; > > + MscNode->ErrorInterruptAff =3D NodeList->ErrorInterruptAff; > > + MscNode->MaxNRdyUsec =3D NodeList->MaxNRdyUsec; > > + MscNode->LinkedDeviceHwId =3D NodeList->LinkedDeviceHwId; > > + MscNode->LinkedDeviceInstanceHwId =3D NodeList- > > >LinkedDeviceInstanceHwId; > > + MscNode->NumResourceNodes =3D NodeList->NumResourceNodes; > > + > > + // ResourceNode List for each MSC > > + if (MscNode->NumResourceNodes > 0) { > > + // Resource Node array for this Msc node > > + ResourceNodeArray =3D (EFI_ACPI_6_4_MPAM_RESOURCE_NODE > > *)((UINT8 *)MscNode + sizeof (EFI_ACPI_6_4_MPAM_MSC_NODE)); > > + // Adding Resource Node content > > + while ( MscNode->NumResourceNodes-- !=3D 0 ) { > > + ResourceNodeArray->Identifier =3D ResourceNodeList->Identifie= r; > > + ResourceNodeArray->RisIndex =3D ResourceNodeList->RisIndex; > > + ResourceNodeArray->Reserved1 =3D EFI_ACPI_RESERVED_WORD; > > + ResourceNodeArray->LocatorType =3D ResourceNodeList- > >LocatorType; > > + ResourceNodeArray->Locator =3D ResourceNodeList->Locator; > > + ResourceNodeArray->NumFuncDep =3D ResourceNodeList- > > >NumFuncDep; >=20 > [Rohit] If NumFuncDep > 0, shouldn't we need an additional loop to popula= te > functional dependency list? >=20 > > + > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Failed to add Resource Node List. Status =3D= %r\n", > > + Status > > + )); > > + return Status; > > + } > > + > > + ResourceNodeList++; > > + ResourceNodeArray++; > > + } > > + } > > + > > + // Next MSC Node > > + MscNode =3D (EFI_ACPI_6_4_MPAM_MSC_NODE *)((UINT8 *)MscNode > + > > MscNode->Length); > > + NodeList++; > > + } // Msc Node > > + > > + return EFI_SUCCESS; > > +} > > + > > +/** > > + Construct the MPAM ACPI table. > > + > > + This function invokes the Configuration Manager protocol interface > > + to get the required hardware information for generating the ACPI > > + table. > > + > > + If this function allocates any resources then they must be freed > > + in the FreeXXXXTableResources function. > > + > > + @param [in] This Pointer to the table generator. > > + @param [in] AcpiTableInfo Pointer to the ACPI table generato= r to be > > used. > > + @param [in] CfgMgrProtocol Pointer to the Configuration Manag= er > > + Protocol Interface. > > + @param [out] Table Pointer to the constructed ACPI Ta= ble. > > + > > + @retval EFI_SUCCESS Table generated successfully. > > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > > + @retval EFI_NOT_FOUND The required object was not found. > > + @retval EFI_BAD_BUFFER_SIZE The size returned by the > Configuration > > + Manager is less than the Object si= ze for > > + the requested object. > > +**/ > > +STATIC > > +EFI_STATUS > > +EFIAPI > > +BuildMpamTable ( > > + IN CONST ACPI_TABLE_GENERATOR *CONST This, > > + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST > AcpiTableInfo, > > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST > > CfgMgrProtocol, > > + OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table > > + ) > > +{ > > + EFI_STATUS Status; > > + UINT64 TableSize; > > + UINT64 NodeSize; > > + UINT32 MpamNodeCount; > > + > > + UINT32 MscNodeCount; > > + UINT32 MscNodeOffset; > > + > > + > > > EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > > G_TABLE_HEADER *Mpam; > > + ACPI_MPAM_GENERATOR = *Generator; > > + CM_ARM_MSC_NODE_INFO = *MscNodeList; > > + MPAM_NODE_INDEXER = *NodeIndexer; > > + > > + ASSERT ( > > + (This !=3D NULL) && > > + (AcpiTableInfo !=3D NULL) && > > + (CfgMgrProtocol !=3D NULL) && > > + (Table !=3D NULL) && > > + (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID) && > > + (AcpiTableInfo->AcpiTableSignature =3D=3D This->AcpiTableSignature= ) > > + ); > > + > > + DEBUG (( > > + DEBUG_ERROR, > > + "DEBUG PRINT: MPAM: Requested table revision =3D %d\n", > > + AcpiTableInfo->AcpiTableRevision > > + )); > > + > > + if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) = || > > + (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Requested table revision =3D %d is not supported. = " > > + "Supported table revisions: Minimum =3D %d. Maximum =3D %d\n", > > + AcpiTableInfo->AcpiTableRevision, > > + This->MinAcpiTableRevision, > > + This->AcpiTableRevision > > + )); > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + Generator =3D (ACPI_MPAM_GENERATOR *)This; > > + *Table =3D NULL; > > + > > + // Get the Memory System Controller Node info and update the MPAM > > + // structure count with MSC Node count (Type 0) Status =3D > > + GetEArmObjMscNodeInfo ( > > + CfgMgrProtocol, > > + CM_NULL_TOKEN, > > + &MscNodeList, > > + &MscNodeCount > > + ); > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Failed to get memory system controller node info. > > Status =3D %r\n", > > + Status > > + )); > > + goto error_handler; > > + } > > + > > + MpamNodeCount =3D MscNodeCount; > > + Generator->MscNodeCount =3D MscNodeCount; > > + > > + // Allocate Node Indexer array > > + NodeIndexer =3D (MPAM_NODE_INDEXER *)AllocateZeroPool ( > > + sizeof (MPAM_NODE_INDEXER) * > > + MpamNodeCount > > + ); if (NodeIndexer =3D=3D NULL= ) { > > + Status =3D EFI_OUT_OF_RESOURCES; > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Failed to allocate memory for Node Indexer. > > + Status =3D > > %r\n ", > > + Status > > + )); > > + goto error_handler; > > + } > > + > > + DEBUG ((DEBUG_INFO, "MPAM INFO: NodeIndexer =3D %p\n", > > NodeIndexer)); > > + Generator->MpamNodeCount =3D MpamNodeCount; > > + Generator->NodeIndexer =3D NodeIndexer; > > + > > + // Calculate the size of the MPAM table TableSize =3D sizeof > > + > > > (EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > > G_TABLE_HEA > > + DER); > > + > > + // Include the size of MSC Nodes and index them if > > + (Generator->MscNodeCount !=3D 0) { > > + MscNodeOffset =3D TableSize; > > + // Size of MSC nodes. > > + NodeSize =3D GetSizeofMscGroupNodes ( > > + MscNodeOffset, > > + MscNodeList, > > + Generator->MscNodeCount, > > + &NodeIndexer > > + ); >=20 > [Rohit] MscNodeOffset is sizeof > (EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > G_TABLE_HEADER), which moves past EFI_ACPI_DESCRIPTION_HEADER by > 12 bytes. Should we be having these fields in the table type? > UINT32 NumNodes; > UINT32 NodeOffset; > UINT32 Reserved; >=20 > I had added a similar comment on [PATCH 1/2]. > [/Rohit] >=20 > > + if (NodeSize > MAX_UINT32) { > > + Status =3D EFI_INVALID_PARAMETER; > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Invalid Size of Group Nodes. Status =3D %r\n", > > + Status > > + )); > > + goto error_handler; > > + } > > + > > + TableSize +=3D NodeSize; > > + > > + DEBUG (( > > + DEBUG_INFO, > > + " MscNodeCount =3D %d\n" \ > > + " MscNodeOffset =3D 0x%x\n", > > + Generator->MscNodeCount, > > + MscNodeOffset > > + )); > > + } > > + > > + DEBUG (( > > + DEBUG_INFO, > > + "INFO: MPAM:\n" \ > > + " MpamNodeCount =3D %d\n" \ > > + " TableSize =3D 0x%X\n", > > + MpamNodeCount, > > + TableSize > > + )); > > + > > + if (TableSize > MAX_UINT32) { > > + Status =3D EFI_INVALID_PARAMETER; > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: MPAM Table Size 0x%lx > MAX_UINT32," \ > > + " Status =3D %r\n", > > + TableSize, > > + Status > > + )); > > + goto error_handler; > > + } > > + > > + // Allocate the Buffer for the MPAM table *Table =3D > > + (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize); if > > + (*Table =3D=3D NULL) { > > + Status =3D EFI_OUT_OF_RESOURCES; > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Failed to allocate memory for MPAM Table. " \ > > + "Size =3D %d. Status =3D %r\n", > > + TableSize, > > + Status > > + )); > > + goto error_handler; > > + } > > + > > + Mpam =3D > > + > > > (EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > > G_TABLE_HEA > > + DER *)*Table; > > + > > + DEBUG (( > > + DEBUG_INFO, > > + "MPAM: Mpam =3D 0x%p. TableSize =3D 0x%x\n", > > + Mpam, > > + TableSize > > + )); > > + > > + // Add ACPI header > > + Status =3D AddAcpiHeader ( > > + CfgMgrProtocol, > > + This, > > + &Mpam->Header, > > + AcpiTableInfo, > > + TableSize > > + ); > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Failed to add ACPI header. Status =3D %r\n", > > + Status > > + )); > > + goto error_handler; > > + } > > + > > + // Update MPAM table > > + Mpam->NumNodes =3D MscNodeCount; > > + Mpam->NodeOffset =3D sizeof > > > (EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > > G_TABLE_HEADER); > > + Mpam->Reserved =3D EFI_ACPI_RESERVED_DWORD; > > + > > + // Add MSC Nodes to the generated table if (Mpam->NumNodes !=3D 0) = { > > + Status =3D AddMscNodes ( > > + This, > > + CfgMgrProtocol, > > + Mpam, > > + MscNodeOffset, > > + MscNodeList, > > + MscNodeCount > > + ); >=20 > [Rohit] Same comment as above >=20 > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: MPAM: Failed to add MSC Nodes. Status =3D %r\n", > > + Status > > + )); > > + goto error_handler; > > + } > > + } > > + > > + return Status; > > + > > +error_handler: > > + if (Generator->NodeIndexer !=3D NULL) { > > + FreePool (Generator->NodeIndexer); > > + Generator->NodeIndexer =3D NULL; > > + } > > + > > + if (*Table !=3D NULL) { > > + FreePool (*Table); > > + *Table =3D NULL; > > + } > > + > > + return Status; > > +} > > + > > +/** Free any resources allocated for constructing the MPAM >=20 > [Rohit] Should this be "constructing the MPAM table"? >=20 > > + > > + @param [in] This Pointer to the table generator. > > + @param [in] AcpiTableInfo Pointer to the ACPI Table Info. > > + @param [in] CfgMgrProtocol Pointer to the Configuration Manager > > + Protocol Interface. > > + @param [in, out] Table Pointer to the ACPI Table. > > + > > + @retval EFI_SUCCESS The resources were freed successfully. > > + @retval EFI_INVALID_PARAMETER The table pointer is NULL or invalid. > > +**/ > > +STATIC > > +EFI_STATUS > > +FreeMpamTableResources ( > > + IN CONST ACPI_TABLE_GENERATOR *CONST This, > > + IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST > > AcpiTableInfo, > > + IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST > > CfgMgrProtocol, > > + IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table > > + ) > > +{ > > + ACPI_MPAM_GENERATOR *Generator; > > + > > + ASSERT (This !=3D NULL); > > + ASSERT (AcpiTableInfo !=3D NULL); > > + ASSERT (CfgMgrProtocol !=3D NULL); > > + ASSERT (AcpiTableInfo->TableGeneratorId =3D=3D This->GeneratorID); > > + ASSERT (AcpiTableInfo->AcpiTableSignature =3D=3D > > + This->AcpiTableSignature); > > + > > + Generator =3D (ACPI_MPAM_GENERATOR *)This; > > + > > + // Free any memory allocated by the generator if > > + (Generator->NodeIndexer !=3D NULL) { > > + FreePool (Generator->NodeIndexer); > > + Generator->NodeIndexer =3D NULL; > > + } > > + > > + if ((Table =3D=3D NULL) || (*Table =3D=3D NULL)) { > > + DEBUG ((DEBUG_ERROR, "ERROR: MPAM: Invalid Table Pointer\n")); > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + FreePool (*Table); > > + *Table =3D NULL; > > + > > + return EFI_SUCCESS; > > +} > > + > > +/** The MPAM Table Generator revision. > > +*/ > > +#define MPAM_GENERATOR_REVISION CREATE_REVISION (1, 0) > > + > > +/** The interface for the MPAM Table Generator. > > +*/ > > +STATIC > > +ACPI_MPAM_GENERATOR MpamGenerator =3D { > > + // ACPI table generator header > > + { > > + // Generator ID > > + CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdMpam), > > + // Generator Description > > + L"ACPI.STD.MPAM.GENERATOR", > > + // ACPI Table Signature > > + > > > EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > > G_TABLE_STRUCTURE_SIGNATURE, > > + // ACPI Table Revision supported by this Generator > > + > > > EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > > G_TABLE_REVISION, > > + // Minimum supported ACPI Table Revision > > + > > > EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORIN > > G_TABLE_REVISION, > > + // Creator ID > > + TABLE_GENERATOR_CREATOR_ID_ARM, > > + // Creator Revision > > + MPAM_GENERATOR_REVISION, > > + // Build Table function > > + BuildMpamTable, > > + // Free Resource function > > + FreeMpamTableResources, > > + // Extended build function not needed > > + NULL, > > + // Extended build function not implemented by the generator. > > + // Hence extended free resource function is not required. > > + NULL > > + }, > > + > > + // MPAM Generator private data > > + > > + // MPAM node count > > + 0, > > + // MSC node count > > + 0, > > + > > + // Pointer to MPAM Node Indexer > > + NULL > > +}; > > + > > +/** > > + Register the Generator with the ACPI Table Factory. > > + > > + @param [in] ImageHandle The handle to the image. > > + @param [in] SystemTable Pointer to the System Table. > > + > > + @retval EFI_SUCCESS The Generator is registered. > > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > > + @retval EFI_ALREADY_STARTED The Generator for the Table ID > > + is already registered. > > +**/ > > +EFI_STATUS > > +EFIAPI > > +AcpiMpamLibConstructor ( > > + IN EFI_HANDLE ImageHandle, > > + IN EFI_SYSTEM_TABLE *SystemTable > > + ) > > +{ > > + EFI_STATUS Status; > > + > > + Status =3D RegisterAcpiTableGenerator (&MpamGenerator.Header); > > + DEBUG ((DEBUG_INFO, "MPAM: Register Generator. Status =3D %r\n", > > +Status)); > > + ASSERT_EFI_ERROR (Status); > > + return Status; > > +} > > + > > +/** > > + Deregister the Generator from the ACPI Table Factory. > > + > > + @param [in] ImageHandle The handle to the image. > > + @param [in] SystemTable Pointer to the System Table. > > + > > + @retval EFI_SUCCESS The Generator is deregistered. > > + @retval EFI_INVALID_PARAMETER A parameter is invalid. > > + @retval EFI_NOT_FOUND The Generator is not registered. > > +**/ > > +EFI_STATUS > > +EFIAPI > > +AcpiMpamLibDestructor ( > > + IN EFI_HANDLE ImageHandle, > > + IN EFI_SYSTEM_TABLE *SystemTable > > + ) > > +{ > > + EFI_STATUS Status; > > + > > + Status =3D DeregisterAcpiTableGenerator (&MpamGenerator.Header); > > + DEBUG ((DEBUG_INFO, "MPAM: Deregister Generator. Status =3D %r\n", > > +Status)); > > + ASSERT_EFI_ERROR (Status); > > + return Status; > > +} > > diff --git > > > a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/MpamGenerator. > > h > > > b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/MpamGenerator. > > h > > new file mode 100644 > > index 0000000000..1075bd8c6c > > --- /dev/null > > +++ > > > b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/MpamGenerator. > > h > > @@ -0,0 +1,47 @@ > > +/** @file > > + Header file for the dynamic MPAM generator > > + > > + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. > > + Copyright (c) 2022, ARM Limited. All rights reserved. > > + SPDX-License-Identifier: BSD-2-Clause-Patent > > + > > + @par Reference(s): > > + - ACPI 6.4 Specification, January 2021 > > + - ARM Architecture Reference Manual ARMv8 > > + > > + @par Glossary: > > + - Cm or CM - Configuration Manager > > + - Obj or OBJ - Object > > +**/ > > + > > +#ifndef MPAM_GENERATOR_H_ > > +#define MPAM_GENERATOR_H_ > > + > > +#pragma pack(1) > > + > > +/** A structure that describes the Node indexer > > + used for indexing the MPAM MSC nodes. > > +*/ > > +typedef struct MpamNodeIndexer { > > + /// Index token for the Node > > + CM_OBJECT_TOKEN Token; > > + /// Pointer to the node > > + VOID *Object; > > + /// Node offset from the start of the MPAM table > > + UINT32 Offset; > > +} MPAM_NODE_INDEXER; > > + > > +typedef struct AcpiMpamGenerator { > > + /// ACPI Table generator header > > + ACPI_TABLE_GENERATOR Header; > > + /// MPAM structure count > > + UINT32 MpamNodeCount; > > + /// Count of Msc Nodes > > + UINT32 MscNodeCount; > > + /// List of indexed CM objects for MPAM generation > > + MPAM_NODE_INDEXER *NodeIndexer; > > +} ACPI_MPAM_GENERATOR; > > + > > +#pragma pack() > > + > > +#endif // MPAM_GENERATOR_H_ > > -- > > 2.17.1 > > > > > > > >=20 > > >=20 > Regards, > Rohit