From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp02.apple.com (ma1-aaemail-dr-lapp02.apple.com [17.171.2.68]) by mx.groups.io with SMTP id smtpd.web10.2837.1661285464186104598 for ; Tue, 23 Aug 2022 13:11:04 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=Z/QWtwCa; spf=pass (domain: apple.com, ip: 17.171.2.68, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp02.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp02.apple.com (8.16.0.42/8.16.0.42) with SMTP id 27NK8SaI027615; Tue, 23 Aug 2022 13:10:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=CnMMoMqfhT7+VdarVpiDS+bwIK5NvtcAXVaPKeURC28=; b=Z/QWtwCaX6GnpwgM3CJVrXVes34m1Z6l2d76zK5Isli9ERBKEsd4ArkeTw0WI0mththZ iXHGNZz6qQVi0VDEsgjLaYLrBVddc9jn823eiRXWzzL3BIu0kmbjCcnXEW96XaerRH4C mp6l0YMw7JwNg9R5FSS90vcINO8iP1CeJvwSkGMn5dxJJ6F0d/nH9ns1JzaahhTJ95iS +P/CPAf/I18kZh8q3jPALwZkyR1w42kdDZ0yJRO/uzIJmFvohatVkRf2K3dzNrY5JcAP 1HzlQ8wDmxMP9f8siyRc84djmXg2mB+/B29+n63GJ8qEYohPCdgx8pTpVsnh+gZZDZcZ rg== Received: from rn-mailsvcp-mta-lapp03.rno.apple.com (rn-mailsvcp-mta-lapp03.rno.apple.com [10.225.203.151]) by ma1-aaemail-dr-lapp02.apple.com with ESMTP id 3j2v9thnxq-24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 23 Aug 2022 13:10:53 -0700 Received: from rn-mailsvcp-mmp-lapp01.rno.apple.com (rn-mailsvcp-mmp-lapp01.rno.apple.com [17.179.253.14]) by rn-mailsvcp-mta-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) with ESMTPS id <0RH300YO5424CFO0@rn-mailsvcp-mta-lapp03.rno.apple.com>; Tue, 23 Aug 2022 13:10:52 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp01.rno.apple.com by rn-mailsvcp-mmp-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) id <0RH300P0041SE600@rn-mailsvcp-mmp-lapp01.rno.apple.com>; Tue, 23 Aug 2022 13:10:52 -0700 (PDT) X-Va-A: X-Va-T-CD: a785bc0fc80ea142555c80cc980b3089 X-Va-E-CD: 900853de0c88d92a1a32a4de9c3fb6e3 X-Va-R-CD: 602562af33d08252d28a548f6df4870d X-Va-CD: 0 X-Va-ID: 46190daa-0a50-4186-8939-6824ddd36385 X-V-A: X-V-T-CD: a785bc0fc80ea142555c80cc980b3089 X-V-E-CD: 900853de0c88d92a1a32a4de9c3fb6e3 X-V-R-CD: 602562af33d08252d28a548f6df4870d X-V-CD: 0 X-V-ID: 2b60474b-ccb0-4f1b-91fe-01473a058b63 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.895 definitions=2022-08-23_07:2022-08-22,2022-08-23 signatures=0 Received: from smtpclient.apple (unknown [17.235.47.162]) by rn-mailsvcp-mmp-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) with ESMTPSA id <0RH300JKX41Z2Q00@rn-mailsvcp-mmp-lapp01.rno.apple.com>; Tue, 23 Aug 2022 13:10:51 -0700 (PDT) From: "Andrew Fish" Message-id: MIME-version: 1.0 (Mac OS X Mail 16.0 \(3731.0.8.1.1\)) Subject: Re: [edk2-devel] [PATCH 1/2] Mde Pkg: Support for MPAM ACPI Table Date: Tue, 23 Aug 2022 13:10:35 -0700 In-reply-to: Cc: "username@nvidia.com" , Sami Mujawar , Alexei Fedorov , Mike Kinney , "gaoliming@byosoft.com.cn" , "zhiguang.liu@intel.com" , Swatisri Kantamsetti , Thomas Abraham , Thanu Rangarajan , nd To: devel@edk2.groups.io, rohit.mathew@arm.com References: <7f8a5c9bbdf1a1f01c6fc822fa298067d280079a.1660667637.git.swatisrik@nvidia.com> X-Mailer: Apple Mail (2.3731.0.8.1.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.895 definitions=2022-08-23_07:2022-08-22,2022-08-23 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_85DB0D77-A5FF-4A5B-96EF-22A203C177CF" --Apple-Mail=_85DB0D77-A5FF-4A5B-96EF-22A203C177CF Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 19, 2022, at 1:26 AM, Rohit Mathew wrote: >=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 1/2] Mde Pkg: Support for MPAM ACPI Table >>=20 >> From: Swatisri Kantamsetti >>=20 >> Added MPAM table header, MSC and Resource Node info structures >>=20 >> Signed-off-by: Swatisri Kantamsetti >> --- >> MdePkg/Include/IndustryStandard/Acpi64.h | 5 ++ >> MdePkg/Include/IndustryStandard/Mpam.h | 69 >> ++++++++++++++++++++++++ >> 2 files changed, 74 insertions(+) >> create mode 100644 MdePkg/Include/IndustryStandard/Mpam.h >>=20 >> diff --git a/MdePkg/Include/IndustryStandard/Acpi64.h >> b/MdePkg/Include/IndustryStandard/Acpi64.h >> index fe5ebfac2b..e54f631186 100644 >> --- a/MdePkg/Include/IndustryStandard/Acpi64.h >> +++ b/MdePkg/Include/IndustryStandard/Acpi64.h >> @@ -2952,6 +2952,11 @@ typedef struct { >> /// >> #define >> EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SI >> GNATURE SIGNATURE_32('P', 'P', 'T', 'T') >>=20 >> +/// >> +/// "MPAM" Memory System Resource Partitioning And Monitoring Table >> /// >> +#define >> +EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORI >> NG_TABLE_STRUC >> +TURE_SIGNATURE SIGNATURE_32('M', 'P', 'A', 'M') >> + >> /// >> /// "PSDT" Persistent System Description Table /// diff --git >> a/MdePkg/Include/IndustryStandard/Mpam.h >> b/MdePkg/Include/IndustryStandard/Mpam.h >> new file mode 100644 >> index 0000000000..e0f75f0114 >> --- /dev/null >> +++ b/MdePkg/Include/IndustryStandard/Mpam.h >> @@ -0,0 +1,69 @@ >> +/** @file >> + ACPI Memory System Resource Partitioning And Monitoring (MPAM) >> + as specified in ARM spec DEN0065 >> + >> + Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. >> + Copyright (c) 2022, ARM Limited. All rights reserved. >> + SPDX-License-Identifier: BSD-2-Clause-Patent **/ >> + >> +#ifndef _MPAM_H_ >> +#define _MPAM_H_ >> + >> +#pragma pack(1) >> + >> +/// >> +/// Memory System Resource Partitioning and Monitoring Table (MPAM) >> /// >> +typedef struct { >> + EFI_ACPI_DESCRIPTION_HEADER Header; >> + UINT32 NumNodes; >> + UINT32 NodeOffset; >> + UINT32 Reserved; >> +} >> +EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORI >> NG_TABLE_HEADE >> +R; >=20 > [Rohit] Shouldn't the header be followed by MSC node body type as defined= in MPAM ACPI 1.0, section 2, table 3 - The MPAM table and section 2.1, tab= le 4 - MSC Node body? >=20 >> + >> +/// >> +/// MPAM Revision (as defined in ACPI 6.4 spec.) /// #define >> +EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORI >> NG_TABLE_REVIS >> +ION 0x01 >> + >> +/// >> +/// Memory System Controller Node Structure /// >> + >> +typedef struct { >> + UINT16 Length; >> + UINT16 Reserved; >> + UINT32 Identifier; >> + UINT64 BaseAddress; >> + UINT32 MmioSize; >> + UINT32 OverflowInterrupt; >> + UINT32 OverflowInterruptFlags; >=20 > [Rohit] Would it be better to have a type (possibly bitfield struct) inst= ead of a plain UINT32 for Flags? (MPAM ACPI 1.0, section 2.1.1, table 5 - I= nterrupt flags) >=20 Probably better NOT to use bitfields in APIs that are produced and consumed= by different worlds. While the the UEFI does speak to the bit order of or = a bitfield the rules around packing of bitfields is compiler defined. I just saw a bug last week with bitfield compatibility that was introduced = by clang fixing its -mms-bitfields implementation. The GCC rules for packin= g bitfields is different than VC++ so that is why the compiler flag -mms-bi= tfields exists in the 1st place . A clang -mms-bitfields bug got fixed and= it broke the code as the extra padding required by VC++ got added to the b= itfield.=20 Thanks, Andrew Fish >> + UINT32 Reserved1; >> + UINT32 OverflowInterruptAff; >> + UINT32 ErrorInterrupt; >> + UINT32 ErrorInterruptFlags; >=20 > [Rohit ] Same comment as before above. >=20 >> + UINT32 Reserved2; >> + UINT32 ErrorInterruptAff; >> + UINT32 MaxNRdyUsec; >> + UINT64 LinkedDeviceHwId; >> + UINT32 LinkedDeviceInstanceHwId; >> + UINT32 NumResourceNodes; >> +} EFI_ACPI_6_4_MPAM_MSC_NODE; >> + >> +/// >> +/// Resource Node Structure >> +/// >> + >> +typedef struct { >> + UINT32 Identifier; >> + UINT8 RisIndex; >> + UINT16 Reserved1; >> + UINT8 LocatorType; >> + UINT64 Locator; >=20 > [Rohit ] Shouldn't " Locator " field be 12 bytes in size, possibly a sepa= rate type? (MPAM ACPI 1.0, section 2.2, table 7 - Resource node and section= 2.3.2 table 10 - locator descriptor) >=20 >> + UINT32 NumFuncDep; >> +} EFI_ACPI_6_4_MPAM_RESOURCE_NODE; >=20 > [Rohit] Since "NumFuncDep" field is part of EFI_ACPI_6_4_MPAM_RESOURCE_NO= DE type and this could be non-zero, should we also need the type for functi= onal dependency descriptors? (MPAM ACPI 1.0, section 2.2.1, table 8 - Funct= ional dependency descriptor) >=20 > [Rohit] Also, could some of the commonly used macros be added to this hea= der, please? (location types, MPAM interrupt mode, interrupt types, affinit= y type, etc) >=20 >> + >> +#pragma pack() >> + >> +#endif >> -- >> 2.17.1 >>=20 >>=20 >>=20 >>=20 >>=20 >=20 > Regards, > Rohit >=20 >=20 >=20 >=20 --Apple-Mail=_85DB0D77-A5FF-4A5B-96EF-22A203C177CF Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii

On Aug 19, 2022, at 1:26 AM, Rohit Mathew <rohit.mathew@a= rm.com> wrote:

Hi Swatisri,

Tha= nks for the patch. Please find my comments inline marked [Rohit] -
-----Original Message= -----
From: devel@edk2.groups.io <d= evel@edk2.groups.io> On Behalf Of Name
via groups.io
= Sent: 16 August 2022 21:18
To:&nbs= p;devel@edk2.groups.io; = Sami Mujawar <Sami.Mujawar@arm.c= om>;
Alexei Fedorov <Alexei.Fedorov@arm.com>; = ;michael.d.kinney@inte= l.com;
gaoliming@byosoft= .com.cn; zhiguang.liu@intel.com
Cc: Swatisri Ka= ntamsetti <swatisrik@nvidia.com<= /a>>
Subject: [edk2-devel] [PATCH 1/2] Mde Pkg: Support for MPAM ACPI= Table

From: Swatisri Kantamsetti <swatisrik@nvidia.com>
Added MPAM table header, MSC and Resource Node info structures

Sig= ned-off-by: Swatisri Kantamsetti <swatisrik@nvidia.com>
---
Mde= Pkg/Include/IndustryStandard/Acpi64.h |  5 ++
MdePkg/Include/Indust= ryStandard/Mpam.h   | 69
++++++++++++++++++++++++
2 files c= hanged, 74 insertions(+)
create mode 100644 MdePkg/Include/IndustryStand= ard/Mpam.h

diff --git a/MdePkg/Include/IndustryStandard/Acpi64.h
= b/MdePkg/Include/IndustryStandard/Acpi64.h
index fe5ebfac2b..e54f631186 = 100644
--- a/MdePkg/Include/IndustryStandard/Acpi64.h
+++ b/MdePkg/In= clude/IndustryStandard/Acpi64.h
@@ -2952,6 +2952,11 @@ typedef struct {<= br>///
#define
EFI_ACPI_6_4_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUC= TURE_SI
GNATURE  SIGNATURE_32('P', 'P', 'T', 'T')

+///
+/= // "MPAM" Memory System Resource Partitioning And Monitoring Table
///+#define
+EFI_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORING_TABLE_STRUC
+TURE_SIGNATURE  SIGNATURE_32('M', 'P', 'A', 'M')+
///
/// "PSDT" Persistent System Description Table  /// diff= --git
a/MdePkg/Include/IndustryStandard/Mpam.h
b/MdePkg/Include/Indu= stryStandard/Mpam.h
new file mode 100644
index 0000000000..e0f75f0114=
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Mpam.h
@@ -0,= 0 +1,69 @@
+/** @file
+  ACPI Memory System Resource Partitionin= g And Monitoring (MPAM)
+  as specified in ARM spec DEN0065
++  Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
+ =  Copyright (c) 2022, ARM Limited. All rights reserved.
+  SPDX= -License-Identifier: BSD-2-Clause-Patent **/
+
+#ifndef _MPAM_H_
+= #define _MPAM_H_
+
+#pragma pack(1)
+
+///
+/// Memory Syste= m Resource Partitioning and Monitoring Table (MPAM)
///
+typedef stru= ct {
+  EFI_ACPI_DESCRIPTION_HEADER    Header;
+ =  UINT32           &n= bsp;            = ; NumNodes;
+  UINT32       &nbs= p;            &= nbsp;    NodeOffset;
+  UINT32   &nbs= p;            &= nbsp;        Reserved;
+}
+EF= I_ACPI_6_4_MEMORY_SYSTEM_RESOURCE_PARTITIONING_MONITORI
NG_TABLE_HEADE+R;

[Rohit] Shouldn't the header be fol= lowed by MSC node body type as defined in MPAM ACPI 1.0, section 2, table 3= - The MPAM table and section 2.1, table 4 - MSC Node body?

+
+///
+/// MPAM Revis= ion (as defined in ACPI 6.4 spec.) /// #define
+EFI_ACPI_6_4_MEMORY_SYST= EM_RESOURCE_PARTITIONING_MONITORI
NG_TABLE_REVIS
+ION  0x01
+=
+///
+/// Memory System Controller Node Structure ///
+
+typed= ef struct {
+  UINT16    Length;
+  UINT16 &= nbsp;  Reserved;
+  UINT32    Identifier;<= br>+  UINT64    BaseAddress;
+  UINT32  &n= bsp; MmioSize;
+  UINT32    OverflowInterrupt;<= br>+  UINT32    OverflowInterruptFlags;

[Rohit] Would it be better to have a type (possibly bitf= ield struct) instead of a plain UINT32 for Flags? (MPAM ACPI 1.0, section 2= .1.1, table 5 - Interrupt flags)





Andrew Fish

+  U= INT32    Reserved1;
+  UINT32    Over= flowInterruptAff;
+  UINT32    ErrorInterrupt;
+ =  UINT32    ErrorInterruptFlags;

[Rohit ] Same comment as before above.

+  UINT32    Reser= ved2;
+  UINT32    ErrorInterruptAff;
+  UIN= T32    MaxNRdyUsec;
+  UINT64    Link= edDeviceHwId;
+  UINT32    LinkedDeviceInstanceHwId;=
+  UINT32    NumResourceNodes;
+} EFI_ACPI_6_4_M= PAM_MSC_NODE;
+
+///
+/// Resource Node Structure
+///
+
= +typedef struct {
+  UINT32    Identifier;
+ &nbs= p;UINT8     RisIndex;
+  UINT16   &nb= sp;Reserved1;
+  UINT8     LocatorType;
+ &n= bsp;UINT64    Locator;

[Ro= hit ] Shouldn't " Locator " field be 12 bytes in size, possibly a separate = type? (MPAM ACPI 1.0, section 2.2, table 7 - Resource node and section 2.3.= 2 table 10 - locator descriptor)

+  UINT32    NumFuncDep;
+} EF= I_ACPI_6_4_MPAM_RESOURCE_NODE;

[Rohit] Si= nce "NumFuncDep" field is part of EFI_ACPI_6_4_MPAM_RESOURCE_NODE type and = this could be non-zero, should we also need the type for functional depende= ncy descriptors? (MPAM ACPI 1.0, section 2.2.1, table 8 - Functional depend= ency descriptor)

[Rohit] A= lso, could some of the commonly used macros be added to this header, please= ? (location types, MPAM interrupt mode, interrupt types, affinity type, etc= )

+
+#pra= gma pack()
+
+#endif
--
2.17.1






Regards,
Rohit




--Apple-Mail=_85DB0D77-A5FF-4A5B-96EF-22A203C177CF--