From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web09.5198.1613553252374934114 for ; Wed, 17 Feb 2021 01:14:12 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: vijayenthiran.subramaniam@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C25A8139F for ; Wed, 17 Feb 2021 01:14:10 -0800 (PST) Received: from mail-wm1-f43.google.com (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 634E53FA45 for ; Wed, 17 Feb 2021 01:14:10 -0800 (PST) Received: by mail-wm1-f43.google.com with SMTP id n10so2714853wmq.0 for ; Wed, 17 Feb 2021 01:14:10 -0800 (PST) X-Gm-Message-State: AOAM532qVO0RZYEAUvC0bSmv2dC7+yP8XnJX+PLuGFgeZ7i4eyIp/yBl gruqfUtV7uaG/EWuKiZUZ3VWNT1rFwU0uOTzXAg= X-Google-Smtp-Source: ABdhPJwyjagYyhWfP3cr1PD1cJFOM60Iq9y6Cd31RfiR1U1ZjomfYBQbbJfsWD4QethQXiSe9+XG6d1NdOYcn7rc3aI= X-Received: by 2002:a7b:ce17:: with SMTP id m23mr6294066wmc.80.1613553241242; Wed, 17 Feb 2021 01:14:01 -0800 (PST) MIME-Version: 1.0 References: <1612343237-27310-1-git-send-email-vijayenthiran.subramaniam@arm.com> <1612343237-27310-2-git-send-email-vijayenthiran.subramaniam@arm.com> In-Reply-To: From: "Vijayenthiran Subramaniam" Date: Wed, 17 Feb 2021 09:13:48 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [edk2-platforms] [PATCH v2 1/3] Platform/ARM/SgiPkg: Add helper macros for HMAT table To: devel@edk2.groups.io, Sami Mujawar Cc: Vijayenthiran Subramaniam , "Jonathan.Cameron@Huawei.com" , "leif@nuviainc.com" , "ardb+tianocore@kernel.org" , Thomas Abraham Content-Type: text/plain; charset="UTF-8" Hi Sami, On Fri, Feb 12, 2021 at 5:28 PM Sami Mujawar wrote: > > Hi Vijay, > > Please find my response inline marked [SAMI]. > > Regards, > > Sami Mujawar > > -----Original Message----- > From: Vijayenthiran Subramaniam > Sent: 03 February 2021 09:07 AM > To: devel@edk2.groups.io; Jonathan.Cameron@Huawei.com; leif@nuviainc.com; ardb+tianocore@kernel.org; Sami Mujawar > Cc: Thomas Abraham > Subject: [edk2-platforms] [PATCH v2 1/3] Platform/ARM/SgiPkg: Add helper macros for HMAT table > > Add helper macros to create Memory Proximity Domain, System Locality > Latency and Bandwidth Information, Memory Side Cache Information > structures in the HMAT table. > > Signed-off-by: Vijayenthiran Subramaniam > --- > Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h | 110 ++++++++++++++++++++ > 1 file changed, 110 insertions(+) > > diff --git a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h > index 8d715de173c9..181d9d771d1e 100644 > --- a/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h > +++ b/Platform/ARM/SgiPkg/Include/SgiAcpiHeader.h > @@ -119,4 +119,114 @@ > ACPIProcessorUID, Flags, ClockDomain \ > } > > +// > +// HMAT related structures > +// > +// Memory Proximity Domain Attributes Structure > +// Refer Section 5.2.27.3 in ACPI Specification, Version 6.3 > +#define EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_PROXIMITY_DOMAIN_ATTRIBUTES_INIT( \ > + Flags, ProximityDomainForAttachedIntiator, ProximityDomainForMemory) \ > + { \ > + 0, \ > [SAMI] EFI_ACPI_6_3_HMAT_TYPE_MEMORY_PROXIMITY_DOMAIN_ATTRIBUTES ? > [/SAMI] EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_PROXIMITY_DOMAIN_ATTRIBUTES is already a typedef and EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_PROXIMITY_DOMAIN_ATTRIBUTES_INIT follows the same naming as used in the Acpi63.h file: https://github.com/tianocore/edk2/blob/4f4d862c1c7232a18347616d94c343c929657fdb/MdePkg/Include/IndustryStandard/Acpi63.h#L2057 > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + }, \ > + sizeof (EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_PROXIMITY_DOMAIN_ATTRIBUTES), \ > + { \ > + Flags, \ > + 0 \ > + }, \ > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + }, \ > + ProximityDomainForAttachedIntiator, \ > + ProximityDomainForMemory, \ > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + } \ > + } > + > +// System Locality Latency and Bandwidth Information Structure > +// Refer Section 5.2.27.4 in ACPI Specification, Version 6.3 > +#define EFI_ACPI_6_3_HMAT_STRUCTURE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO_INIT( \ > + Flags, DataType, NumInitiatorProximityDomains, \ > + NumTargetProximityDomains, EntryBaseUnit) \ > + { \ > + 1, \ > [SAMI] EFI_ACPI_6_3_HMAT_TYPE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO ? > [/SAMI] Same as above. > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + }, \ > + sizeof (EFI_ACPI_6_3_HMAT_STRUCTURE_SYSTEM_LOCALITY_LATENCY_AND_BANDWIDTH_INFO) + \ > + (4 * NumInitiatorProximityDomains) + (4 * NumTargetProximityDomains) + \ > + (2 * NumInitiatorProximityDomains * NumTargetProximityDomains), \ > + { \ > + Flags, 0 \ > [SAMI] 0 on new line for consistency ? > [/SAMI] Ack, will fix in the next version. > + }, \ > + DataType, \ > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + }, \ > + NumInitiatorProximityDomains, \ > + NumTargetProximityDomains, \ > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + }, \ > + EntryBaseUnit \ > + } > + > +// Memory Side Cache Information Structure > +// Refer Section 5.2.27.5 in ACPI Specification, Version 6.3 > +#define EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO_INIT( \ > + MemoryProximityDomain, MemorySideCacheSize, CacheAttributes, \ > + NumberOfSmbiosHandles) \ > + { \ > + 2, \ > [SAMI] EFI_ACPI_6_3_HMAT_TYPE_MEMORY_SIDE_CACHE_INFO ? > [/SAMI] Same as above. > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + }, \ > + sizeof (EFI_ACPI_6_3_HMAT_STRUCTURE_MEMORY_SIDE_CACHE_INFO) + \ > + (NumberOfSmbiosHandles * 2), \ > + MemoryProximityDomain, \ > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + }, \ > + MemorySideCacheSize, \ > + CacheAttributes, \ > + { \ > + EFI_ACPI_RESERVED_BYTE, \ > + EFI_ACPI_RESERVED_BYTE \ > + }, \ > + NumberOfSmbiosHandles \ > + } > + > #endif /* __SGI_ACPI_HEADER__ */ > -- > 2.17.1 > > BR, Vijayenthiran