From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9AAD274003E for ; Mon, 8 Jul 2024 21:38:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=3ybyHHszNRffO8lKY3mg/ySBS/6+DARnWDTB+8X0Yfc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1720474738; v=1; b=susRcSe9P9JbFaSb/RU6nAIhSoJpzHiOijFv59XE6e9mumzrezH6SmbdH/CSgMD8abjJCtFH rJFyMiVkqf3wHXxJY8UafClsUNi86xnY3FPPNlfcVIrkp9cBvK2YuurKvIFxmuvRqhD443aFyEt lrd/8iUyCmb6GwmNDXZOSO9a6r8t2GBQbxuG+RQ4B+cJb+akiW/TFadaAUlnnSyPCkcybFZUWri HVlgng25qZ99cfHITkSw2KvlYD8zbz2bDsHxe0MoXqW7ADVkNE9E6Xc/8DgYckcmkus94iYNXbF NircT3Kh+0y1oS4VUVPw4I5daUEVVL6AoK6yYIGtQn9dg== X-Received: by 127.0.0.2 with SMTP id 1kW6YY7687511xyUWlzv7kN8; Mon, 08 Jul 2024 14:38:57 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.5627.1720474736435081515 for ; Mon, 08 Jul 2024 14:38:56 -0700 X-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 44C41139F; Mon, 8 Jul 2024 14:39:21 -0700 (PDT) X-Received: from usa.arm.com (iss-desktop03.cambridge.arm.com [10.1.196.33]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id C73F03F641; Mon, 8 Jul 2024 14:38:54 -0700 (PDT) From: "Rohit Mathew" To: devel@edk2.groups.io Cc: James Morse , Liming Gao , Michael D Kinney , Sami Mujawar , Thomas Abraham , Zhiguang Liu , Pierre Gondois Subject: [edk2-devel] [PATCH V6 1/6] MdePkg/IndustryStandard: Add definitions for MPAM ACPI specification Date: Mon, 8 Jul 2024 22:38:49 +0100 Message-Id: <20240708213849.41427-1-rohit.mathew@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Mon, 08 Jul 2024 14:38:56 -0700 Resent-From: rohit.mathew@arm.com Reply-To: devel@edk2.groups.io,rohit.mathew@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: oyfVFHUgk0gTxQLUR2kTYCs6x7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=susRcSe9; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Add definitions, macros and types for elements associated with MPAM ACPI 2.0 specification. Signed-off-by: Rohit Mathew Cc: James Morse Cc: Liming Gao Cc: Michael D Kinney Cc: Sami Mujawar Cc: Thomas Abraham Cc: Zhiguang Liu Acked-by: Liming Gao Reviewed-by: Pierre Gondois Reviewed-by: Sami Mujawar --- MdePkg/Include/IndustryStandard/Acpi65.h | 7 +- MdePkg/Include/IndustryStandard/Mpam.h | 246 ++++++++++++++++++++ 2 files changed, 252 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/IndustryStandard/Acpi65.h b/MdePkg/Include/In= dustryStandard/Acpi65.h index b9616a3e29..4b8c5120be 100644 --- a/MdePkg/Include/IndustryStandard/Acpi65.h +++ b/MdePkg/Include/IndustryStandard/Acpi65.h @@ -2,7 +2,7 @@ ACPI 6.5 definitions from the ACPI Specification Revision 6.5 Aug, 202= 2. =20 Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.
- Copyright (c) 2019 - 2023, ARM Ltd. All rights reserved.
+ Copyright (c) 2019 - 2024, ARM Ltd. All rights reserved.
Copyright (c) 2023, Loongson Technology Corporation Limited. All right= s reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -3264,6 +3264,11 @@ typedef struct { /// #define EFI_ACPI_6_5_XEN_PROJECT_TABLE_SIGNATURE SIGNATURE_32('X', 'E',= 'N', 'V') =20 +/// +/// "MPAM" Memory System Resource Partitioning and Monitoring Table +/// +#define EFI_ACPI_MEMORY_SYSTEM_RESOURCE_PARTITIONING_AND_MONITORING_TABL= E_SIGNATURE SIGNATURE_32('M', 'P', 'A', 'M') + #pragma pack() =20 #endif diff --git a/MdePkg/Include/IndustryStandard/Mpam.h b/MdePkg/Include/Indu= stryStandard/Mpam.h new file mode 100644 index 0000000000..8358b35d81 --- /dev/null +++ b/MdePkg/Include/IndustryStandard/Mpam.h @@ -0,0 +1,246 @@ +/** @file + ACPI for Memory System Resource Partitioning and Monitoring 2.0 (MPAM)= as + specified in ARM spec DEN0065 + + Copyright (c) 2024, Arm Limited. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Specification Reference: + - [1] ACPI for Memory System Resource Partitioning and Monitoring 2.0 + (https://developer.arm.com/documentation/den0065/latest) + + @par Glossary: + - MPAM - Memory System Resource Partitioning And Monitoring + - MSC - Memory System Component + - PCC - Platform Communication Channel + - RIS - Resource Instance Selection + - SMMU - Arm System Memory Management Unit + **/ + +#ifndef MPAM_H_ +#define MPAM_H_ + +#include + +/// +/// MPAM Revision +/// +#define EFI_ACPI_MEMORY_SYSTEM_RESOURCE_PARTITIONING_AND_MONITORING_TABL= E_REVISION (0x01) + +/// +/// MPAM Interrupt mode +/// +#define EFI_ACPI_MPAM_INTERRUPT_LEVEL_TRIGGERED (0x0) +#define EFI_ACPI_MPAM_INTERRUPT_EDGE_TRIGGERED (0x1) + +/// +/// MPAM Interrupt type +/// +#define EFI_ACPI_MPAM_INTERRUPT_WIRED (0x0) + +/// +/// MPAM Interrupt affinity type +/// +#define EFI_ACPI_MPAM_INTERRUPT_PROCESSOR_AFFINITY (0x0) +#define EFI_ACPI_MPAM_INTERRUPT_PROCESSOR_CONTAINER_AFFINITY (0x1) + +/// +/// MPAM MSC affinity valid +/// +#define EFI_ACPI_MPAM_INTERRUPT_AFFINITY_NOT_VALID (0x0) +#define EFI_ACPI_MPAM_INTERRUPT_AFFINITY_VALID (0x1) + +/// +/// MPAM Interrupt flag - bit positions +/// +#define EFI_ACPI_MPAM_INTERRUPT_MODE_SHIFT (0) +#define EFI_ACPI_MPAM_INTERRUPT_TYPE_SHIFT (1) +#define EFI_ACPI_MPAM_INTERRUPT_AFFINITY_TYPE_SHIFT (3) +#define EFI_ACPI_MPAM_INTERRUPT_AFFINITY_VALID_SHIFT (4) +#define EFI_ACPI_MPAM_INTERRUPT_RESERVED_SHIFT (5) + +/// +/// MPAM Interrupt flag - bit masks +/// +#define EFI_ACPI_MPAM_INTERRUPT_MODE_MASK (0x1) +#define EFI_ACPI_MPAM_INTERRUPT_TYPE_MASK (0x3) +#define EFI_ACPI_MPAM_INTERRUPT_AFFINITY_TYPE_MASK (0x8) +#define EFI_ACPI_MPAM_INTERRUPT_AFFINITY_VALID_MASK (0x10) +#define EFI_ACPI_MPAM_INTERRUPT_RESERVED_MASK (0xFFFFFFE0) + +/// +/// MPAM Location types +/// as described in document [1], table 11. +/// +#define EFI_ACPI_MPAM_LOCATION_PROCESSOR_CACHE (0x0) +#define EFI_ACPI_MPAM_LOCATION_MEMORY (0x1) +#define EFI_ACPI_MPAM_LOCATION_SMMU (0x2) +#define EFI_ACPI_MPAM_LOCATION_MEMORY_CACHE (0x3) +#define EFI_ACPI_MPAM_LOCATION_ACPI_DEVICE (0x4) +#define EFI_ACPI_MPAM_LOCATION_INTERCONNECT (0x5) +#define EFI_ACPI_MPAM_LOCATION_UNKNOWN (0xFF) + +/// +/// MPAM Interface types +/// as desscribed in document[1], table 4. +/// +#define EFI_ACPI_MPAM_INTERFACE_MMIO (0x00) +#define EFI_ACPI_MPAM_INTERFACE_PCC (0x0A) + +/// +/// MPAM Link types +/// as described in document [1], table 19. +/// +#define EFI_ACPI_MPAM_LINK_TYPE_NUMA (0x00) +#define EFI_ACPI_MPAM_LINK_TYPE_PROC (0x01) + +#pragma pack(1) + +/// +/// MPAM MSC generic locator descriptor +/// as described in document [1], table 12. +/// +typedef struct { + UINT64 Descriptor1; + UINT32 Descriptor2; +} EFI_ACPI_MPAM_GENERIC_LOCATOR; + +/// +/// MPAM processor cache locator descriptor +/// as described in document [1], table 13. +/// +typedef struct { + UINT64 CacheReference; + UINT32 Reserved; +} EFI_ACPI_MPAM_CACHE_LOCATOR; + +/// +/// MPAM memory locator descriptor +/// as described in document [1], table 14. +/// +typedef struct { + UINT64 ProximityDomain; + UINT32 Reserved; +} EFI_ACPI_MPAM_MEMORY_LOCATOR; + +/// +/// MPAM SMMU locator descriptor +/// as described in document [1], table 15. +/// +typedef struct { + UINT64 SmmuInterface; + UINT32 Reserved; +} EFI_ACPI_MPAM_SMMU_LOCATOR; + +/// +/// MPAM memory-side cache locator descriptor +/// as described in Document [1], table 16. +/// +typedef struct { + UINT8 Reserved[7]; + UINT8 Level; + UINT32 Reference; +} EFI_ACPI_MPAM_MEMORY_CACHE_LOCATOR; + +/// +/// MPAM ACPI device locator descriptor +/// as described in document [1], table 17. +/// +typedef struct { + UINT64 AcpiHardwareId; + UINT32 AcpiUniqueId; +} EFI_ACPI_MPAM_ACPI_LOCATOR; + +/// +/// MPAM interconnect locator descriptor +/// as described in document [1], table 18. +/// +typedef struct { + UINT64 InterconnectDescTblOff; + UINT32 Reserved; +} EFI_ACPI_MPAM_INTERCONNECT_LOCATOR; + +/// +/// MPAM interconnect descriptor +/// as described in document [1], table 19. +/// +typedef struct { + UINT32 SourceId; + UINT32 DestinationId; + UINT8 LinkType; + UINT8 Reserved[3]; +} EFI_ACPI_MPAM_INTERCONNECT_DESCRIPTOR; + +/// +/// MPAM interconnect descriptor table +/// as described in document [1], table 20. +/// +typedef struct { + UINT8 Signature[16]; + UINT32 NumDescriptors; +} EFI_ACPI_MPAM_INTERCONNECT_DESCRIPTOR_TABLE; + +/// +/// MPAM resource locator +/// +typedef union { + EFI_ACPI_MPAM_CACHE_LOCATOR CacheLocator; + EFI_ACPI_MPAM_MEMORY_LOCATOR MemoryLocator; + EFI_ACPI_MPAM_SMMU_LOCATOR SmmuLocator; + EFI_ACPI_MPAM_MEMORY_CACHE_LOCATOR MemCacheLocator; + EFI_ACPI_MPAM_ACPI_LOCATOR AcpiLocator; + EFI_ACPI_MPAM_INTERCONNECT_LOCATOR InterconnectIfcLocator; + EFI_ACPI_MPAM_GENERIC_LOCATOR GenericLocator; +} EFI_ACPI_MPAM_LOCATOR; + +/// +/// MPAM MSC node body +/// as described document [1], table 4. +/// +typedef struct { + UINT16 Length; + UINT8 InterfaceType; + UINT8 Reserved; + UINT32 Identifier; + UINT64 BaseAddress; + UINT32 MmioSize; + UINT32 OverflowInterrupt; + UINT32 OverflowInterruptFlags; + UINT32 Reserved1; + UINT32 OverflowInterruptAffinity; + UINT32 ErrorInterrupt; + UINT32 ErrorInterruptFlags; + UINT32 Reserved2; + UINT32 ErrorInterruptAffinity; + UINT32 MaxNrdyUsec; + UINT64 HardwareIdLinkedDevice; + UINT32 InstanceIdLinkedDevice; + UINT32 NumResources; +} EFI_ACPI_MPAM_MSC_NODE; + +/// +/// MPAM MSC resource +/// as described in document [1], table 9. +/// +typedef struct { + UINT32 Identifier; + UINT8 RisIndex; + UINT16 Reserved1; + UINT8 LocatorType; + EFI_ACPI_MPAM_LOCATOR Locator; + UINT32 NumFunctionalDependencies; +} EFI_ACPI_MPAM_MSC_RESOURCE; + +/// +/// MPAM Function dependency descriptor +/// as described in document [1], table 10. +/// +typedef struct { + UINT32 Producer; + UINT32 Reserved; +} EFI_ACPI_MPAM_FUNCTIONAL_DEPENDENCY_DESCRIPTOR; + +#pragma pack() + +#endif --=20 2.34.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119817): https://edk2.groups.io/g/devel/message/119817 Mute This Topic: https://groups.io/mt/107112176/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-