From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.77]) by mx.groups.io with SMTP id smtpd.web11.762.1660897593385691111 for ; Fri, 19 Aug 2022 01:26:34 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=sUHC/6Z7; spf=pass (domain: arm.com, ip: 40.107.13.77, mailfrom: rohit.mathew@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=JDPyV2P3EhGhSe+1ZDj691oW0iL982gLUC/pv6Phsj6peH47dLHQN8RY31Q7g7rbf7me6EQBfcFBwPQ7Xux52rVawS6TCf2+brboJWCKw6GTjxJFMbVbHiDX+A2do46jo5HjIhopAmxZXZTZTdMmGqvhp+zBXKa8pUKYhfcAuSr5D2clEhFn8jqpZMgbAbLGMua+wNfVwG/AUns0o79TkVliMkl6Y32buDvMKYTRWVVZUmMlxgoagCcj2ud7Du4Ax1TZNzL+jv8y19Y+ftZ0qvqe5sUABDWv8z5smSOlPMFaHMM8Nob9GeuRZHaPgMdjz5TuFV1MGwFHtzD4Nw3WNg== 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=m0Rp1YnkwfpjY4pzxolTYuR7PgexZewfYZM4w1Y2qZY=; b=SoO8n0+AlANLq7OeWq/m/20yvC5543WGL7+NLQA19GVvBPzS2zPWy2Z7/t95fxOr1kU3Pajddu5oo8Hz6yB11PN5YOrJuPNncFfg0oclyBldWUxGx9aeOu92k5IWVMi3yNMn36BlxUYEYKtvKtN/gzRyPG7Mren/MIbYwBUUKbwgDaoXDSv/7tWgFcmrtHQZVdRD2sSWuMVFJ1hCHgZA3eCwtMTXQ/9g1pxzXGq1AjBapLNdl9hdPNjYbIENLI4g6hVYy9jgGaPCjflhavYe0q8OmSD7zb3TSsxl1WGlVMOTodPNTzuqOUbEzayQY0LabYZilaydXKonAk1CT4/Alw== 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=m0Rp1YnkwfpjY4pzxolTYuR7PgexZewfYZM4w1Y2qZY=; b=sUHC/6Z7L//F3m9mTqK6Mpp8OcX0w6qoioheaaLOMKDYbV2xt2eS3z0JEWaVP75Fhn8zUqQV2XRTiEgWowFXgjVUeFFrgifIOBpWHefCqA7fmtxoqrBNdq3Jc+u7sQgWkPm3QAacyhCIVAINnTv4XaIt/Sq3/NJTjzmWhzUQgAw= Received: from AS9PR06CA0468.eurprd06.prod.outlook.com (2603:10a6:20b:49a::23) by AS8PR08MB7176.eurprd08.prod.outlook.com (2603:10a6:20b:407::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.17; Fri, 19 Aug 2022 08:26:28 +0000 Received: from VE1EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:49a:cafe::b4) by AS9PR06CA0468.outlook.office365.com (2603:10a6:20b:49a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.17 via Frontend Transport; Fri, 19 Aug 2022 08:26:28 +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 VE1EUR03FT041.mail.protection.outlook.com (10.152.19.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.15 via Frontend Transport; Fri, 19 Aug 2022 08:26:28 +0000 Received: ("Tessian outbound fa99bf31ee7d:v123"); Fri, 19 Aug 2022 08:26:27 +0000 X-CR-MTA-TID: 64aa7808 Received: from 0df8038721cb.6 by 64aa7808-outbound-1.mta.getcheckrecipient.com id F3EC676D-CE13-4BBB-80F5-31954DDCE42A.1; Fri, 19 Aug 2022 08:26:18 +0000 Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 0df8038721cb.6 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 Aug 2022 08:26:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ezQU9/1C2/1b9nmwnxl7QVd1gDPo8AGqFaQF96t9v7NxymxREnEUZZbJzvbNwob04Z2KgNndfEJy1wvY43Ni7zDZeeMSEY2l5AgAg5QFjCHY0xLLtopITvp8n2j6EoPpj0N+8wY9Rv5P24M2l8y4aAGB0q3KiKo2FsP+XSP7jy10MdthFy5GlKQjhAW+Hiw96LQ4hOBvUsAdrq8r5Tsjz2kptZTrUU9oxYAmemA8zUs7npD41j2CTOEvVwo1o6DoVoP1pLtno1B02ljENurfzOSeFJ5gQzJnFS3vGUB3Zgc/iT9/MczNFuEgDvyM7D2JUYRzFsMJZzdjlTYAKZw3NQ== 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=m0Rp1YnkwfpjY4pzxolTYuR7PgexZewfYZM4w1Y2qZY=; b=QYePRIsFWXsEPP2DfcuVWQVlx4lebvbhDNfom64ntyNtnt5/6ZJowr8vAeWCZ8vu9dJvAYL2GoPuYkRvhuIo09PeL6q3QfHzBQdKc80rX7Y2WdWXVbl72uGxlhlz7HMNPbhywp4g4urktwmLjxxQF9f1H0WD3Hg1bXqKS7Jh+eIm4ZexQKHDqkfGvzTE3/MVxAMJRWX/iX17J3hFMho5rx0RVfTga5DGMbGQE4wgma122D6wHq+slO2dsjpJqGlRUBlXJ3KuFtW0Ap3/40r/xpClx3gMI3cLP4IreRi4CqXvUlZCrAfUqcH31Ys9AQ9Pwegc8vr4KvFZJvCIDIwNPA== 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=m0Rp1YnkwfpjY4pzxolTYuR7PgexZewfYZM4w1Y2qZY=; b=sUHC/6Z7L//F3m9mTqK6Mpp8OcX0w6qoioheaaLOMKDYbV2xt2eS3z0JEWaVP75Fhn8zUqQV2XRTiEgWowFXgjVUeFFrgifIOBpWHefCqA7fmtxoqrBNdq3Jc+u7sQgWkPm3QAacyhCIVAINnTv4XaIt/Sq3/NJTjzmWhzUQgAw= Received: from AM6PR08MB3783.eurprd08.prod.outlook.com (2603:10a6:20b:8a::13) by PR3PR08MB5819.eurprd08.prod.outlook.com (2603:10a6:102:92::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.18; Fri, 19 Aug 2022 08:26:14 +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.016; Fri, 19 Aug 2022 08:26:14 +0000 From: "Rohit Mathew" 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 Thread-Topic: [edk2-devel] [PATCH 2/2] Dynamic Tbl Mgr: MPAM: MPAM Generator and supporting files Thread-Index: AQHYsb2AG22NGPQPJk6CwfZk+a3M1K21Kmvw Date: Fri, 19 Aug 2022 08:26:14 +0000 Message-ID: References: <7f8a5c9bbdf1a1f01c6fc822fa298067d280079a.1660667637.git.swatisrik@nvidia.com> <6fcb277bec0d58c11a6af6b2cbbea57177f3722e.1660667637.git.swatisrik@nvidia.com> In-Reply-To: <6fcb277bec0d58c11a6af6b2cbbea57177f3722e.1660667637.git.swatisrik@nvidia.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 31EBF36DAB95884DB1797BFBC501EF57.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: c1bfcb2c-4156-42f9-b02b-08da81bc8350 x-ms-traffictypediagnostic: PR3PR08MB5819:EE_|VE1EUR03FT041:EE_|AS8PR08MB7176: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: TCLdQgwHC0+B0Jm2jcjHoGYkEC+R+tqsls9hhmicGRoSYKOO70KMT8weJqufo1eBzBcU/hOVqjKfN1myjqZmDj0Pts6ZkKOPLpOTGRqtG2QC8zu4aEdtD5c0CZoxB7sVZae9BpFjQk1yhem1QivuOyiyFVPo9ZNp4PBd8Ydiqkut7ZnuersnNn2tROOae27GcKDRKmi+7ln/9Pt1F461E1WIEA6NOWAMC8gGvrd9tMIdQioY8rWJMnJ18yTShh3dDBACulgZ5JWwJzD3oO6bhsnczBQo+aH+TbCM1zf+Jnwvn3UF2/zc7UOB+4Zc0UOoowe1+sklDyTm3mV5OYYZ6+7/i7wGSs4oDWswHt8MIgf4jq5d/S2t1QkjnejnJSrP/Bu8MFePCPYDNyAZ3t9iiqW91jBI02YI3mK0vbJQIvh5AFNqIihfRqOZYq0/uYBFLgTN9lXuVf0GmR/OTjV152stlxRpRPecPaojrLTLraM4vaVfKiF2R830bBaGB2CfhV6D+WrqzE8wk75wzDh6vQobBpfPKKYPUxfnEisz6PFlE59ubCoUnBSAYnUsuG3rG2GSUiidHhLUVDN8AMxVgCpoEdN/aD8o3WXZ9LKddMW1/ZDiOBfmFHbI72GNWxpXpSX41jySKvCqb8nkJT+TK+IvwXY+W/fYa+AChg31JMIS6rwwzNexkWq/SJ1C5Qvf0NJ327w2AuRbFalGfUI11KvTyzq8wQZkqdGVNCSlXw0CVuocmZuIz76h3m+vyUX2XA5WLWteU0OaGcrek3FHjaXoCX6RN/Aiy3kF4zRz1DYBP6QKtuodCdI6hu2prMtClggnFZ2FvVTr3GvLnL7vtA== 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)(396003)(346002)(366004)(136003)(376002)(5660300002)(54906003)(38100700002)(38070700005)(122000001)(8936002)(186003)(83380400001)(4326008)(55016003)(316002)(71200400001)(66476007)(66446008)(64756008)(52536014)(76116006)(110136005)(8676002)(66556008)(66946007)(478600001)(33656002)(966005)(2906002)(6506007)(7696005)(86362001)(9686003)(53546011)(30864003)(41300700001)(579004)(559001);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5819 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: VE1EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: f001f58f-5693-4531-8830-08da81bc7b44 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: D7aDb9RWGzHGze+U574VQn7ybU3DvN1M1qY9tzkFhpSFGFQTRGG6O5z0mLbP3KDXqjpNnlwr/094R35F14JgiMjZdAXKtBfwH9H176RMqwqpcyWHZruIb8ZAUiylkXe/Ybj9BPdbOfiXydrl6CQ/Dj2VCR5Qmw6wYPeER5UDH9x85yS7wZhD/BOZnJevO3Q/Ci4mS5CvhFaqj398qAJjCpy7SCjxASaQX3Wo4cbytp6af0Ya5u9yWin+H1AjbSwsu9iBUnpeGv2ofbzd74sef1ZMXyF/kC1IEdFe2GdTZbPEQuGkIJLqcOR9OL5TBcrAXYhTW/peazuDuXnur9DuKnmwmESXRS2KwIRDqtRIBhbW78ivlfwSHqogyp2KLUDvbh7l0E3aE8UFN9KVubVSPJ41kuM2iY+mj3lHs8SXLbKOuPd2bnJxHv5msAaXs6DNuIdTR5hwX/4qUFVa/lGbDDoWI0m+KRs65x7GkxOHD3I1SEw6BQySXBVq3KJQK/2q45S4CIDcUj0P+zIGokt4ikl62xlP76aGMSuyK4DUfQglf3qaRGUQwHjJQGWeyV6tCaMZuqGiB3IcKixjwdyiT6iQYu1zm+WOB8I58tU4jn+FHoOH8QCIpUgOMdZukr40fxHgOZ3L0Jo6PST0KT8SeFBvOmdBR6Ylav0U/neV9pZUNtVAQVV4lS2V5z19RE97qSAvUlOeK5aQBNeRbZWyH440chS4wrALi4TrGvrgQcPXOBhm7iUAzLc5NSMDr4wFYSYrWuSTWnHxMk6c71Yqotejsr0gBgi4BqVsCVCYFayAVWWh4QXXzEIiYon1oQFg8RUckaLTCZSucYd0rFkS/w== 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)(396003)(136003)(376002)(346002)(39860400002)(40470700004)(36840700001)(46966006)(316002)(54906003)(41300700001)(966005)(478600001)(110136005)(40480700001)(55016003)(82310400005)(40460700003)(70586007)(70206006)(8676002)(30864003)(2906002)(5660300002)(8936002)(4326008)(52536014)(186003)(82740400003)(36860700001)(33656002)(86362001)(9686003)(356005)(81166007)(336012)(7696005)(6506007)(83380400001)(47076005)(26005)(53546011);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Aug 2022 08:26:28.1782 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1bfcb2c-4156-42f9-b02b-08da81bc8350 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: VE1EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7176 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Swatisri, 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 >=20 > From: Swatisri Kantamsetti >=20 > ACPI header, MSC and Resource Nodes are populated in the MPAM Table >=20 > 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 >=20 > 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 @@ >=20 > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/AcpiMadtLibAr > m.inf >=20 > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/AcpiMcfgLibAr > m.inf >=20 > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/AcpiPpttLibArm. > inf > + > + > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiMpamLibArm/AcpiMpamLib > Arm.i > + nf >=20 > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/AcpiRawLibArm. > inf >=20 > NULL|DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/AcpiSpcrLibArm. > inf >=20 > 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 Ge= nerator > EStdAcpiTableIdSsdtCmn600, ///< SSDT Cmn-600 Genera= tor > 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 Info > EArmObjRmr, ///< 40 - Reserved Memory Range N= ode > EArmObjMemoryRangeDescriptor, ///< 41 - Memory Range Descriptor > + EArmObjMscNodeInfo, ///< 40 - Msc Memory System Contr= oller > Node Info > + EArmObjResNodeInfo, ///< 41 - Res Resource Node Info > EArmObjMax > } EARM_OBJECT_ID; >=20 > @@ -1070,6 +1072,72 @@ typedef struct CmArmRmrDescriptor { > UINT64 Length; > } CM_ARM_MEMORY_RANGE_DESCRIPTOR; >=20 > +/** 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; [Rohit] I have added a comment on Flag's type in [PATCH 1/2]. Same comment = here. > + /// 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; [Rohit] I have added a comment on Locator's type and size in [PATCH 1/2]. S= ame comment here. > + /// Num functional dependencies > + UINT32 NumFuncDep; > + /// Reference token for the list of resource nodes > + CM_OBJECT_TOKEN FuncDepListToken; > + > +} CM_ARM_RESOURCE_NODE_INFO; > + > #pragma pack() >=20 > #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)); [Rohit] Shouldn't the node size include the size of functional dependency d= escriptor * number of functional dependency descriptor? > +} > + > +/** 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 starts. [Rohit] Should it be "start of the MPAM table where .."? > + @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, Offse= t =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 Manage= r > + Protocol Interface. > + @param [in] Mpam Pointer to MPAM table structure. > + @param [in] NodesStartOffset Offset for the start of the Msc Gro= up > + Nodes. > + @param [in] NodeList Pointer to an array of Msc Group No= de > + 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; [Rohit] MPAM ACPI 1.0, section 2.1, table 4 - MSC node body, defines identi= fier as a unique value. For systems with multiple MSCs, the OS could expect= identifiers to be unique. Could this be addressed, please? > + MscNode->BaseAddress =3D NodeList->BaseAddress; > + MscNode->MmioSize =3D NodeList->MmioSize; > + MscNode->OverflowInterrupt =3D NodeList->OverflowInterrupt; > + MscNode->OverflowInterruptFlags =3D NodeList->OverflowInterruptFla= gs; > + MscNode->Reserved1 =3D EFI_ACPI_RESERVED_DWORD; > + MscNode->OverflowInterruptAff =3D NodeList->OverflowInterruptAff= ; > + MscNode->ErrorInterrupt =3D NodeList->ErrorInterrupt; > + MscNode->ErrorInterruptFlags =3D NodeList->ErrorInterruptFlags; > + 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->Identifier; > + 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; [Rohit] If NumFuncDep > 0, shouldn't we need an additional loop to populate= functional dependency list? > + > + 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 generator = to be > used. > + @param [in] CfgMgrProtocol Pointer to the Configuration Manager > + Protocol Interface. > + @param [out] Table Pointer to the constructed ACPI Tabl= e. > + > + @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 Configurati= on > + Manager is less than the Object size= 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 > + ); [Rohit] MscNodeOffset is sizeof (EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTIT= IONING_MONITORING_TABLE_HEADER), which moves past EFI_ACPI_DESCRIPTION_HEAD= ER by 12 bytes. Should we be having these fields in the table type? UINT32 NumNodes; UINT32 NodeOffset; UINT32 Reserved; I had added a similar comment on [PATCH 1/2]. [/Rohit] > + 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 > + ); [Rohit] Same comment as above > + 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 [Rohit] Should this be "constructing the MPAM table"? > + > + @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 >=20 >=20 >=20 Regards, Rohit