From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.53]) by mx.groups.io with SMTP id smtpd.web10.20471.1684757947654282259 for ; Mon, 22 May 2023 05:19:08 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=tiXh8Jcv; spf=pass (domain: arm.com, ip: 40.107.22.53, mailfrom: sami.mujawar@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=T76CVMFlKkySfao0PCg62erkWSjojNAMXgLozPHDriY=; b=tiXh8JcveSUqAkmC2/114SFVOHpvDWK1K420Q1ZZUL+TT7w46JfH3voxb6EBDJSw6X8FHSZkKB+wzOF7OJqSfi+7li97pM3jB7ASr1K3PnSX4RzKLreKu1KocD/XKiwkoemkUIul32jTiZ8zlsGwUPoLFl7wkG2p83Ar3brQoZk= Received: from DUZPR01CA0168.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::24) by DU0PR08MB8091.eurprd08.prod.outlook.com (2603:10a6:10:3ea::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Mon, 22 May 2023 12:19:00 +0000 Received: from DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b3:cafe::88) by DUZPR01CA0168.outlook.office365.com (2603:10a6:10:4b3::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28 via Frontend Transport; Mon, 22 May 2023 12:19:00 +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 DBAEUR03FT041.mail.protection.outlook.com (100.127.142.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.13 via Frontend Transport; Mon, 22 May 2023 12:19:00 +0000 Received: ("Tessian outbound e13c2446394c:v136"); Mon, 22 May 2023 12:19:00 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: fbf625c14dc5a429 X-CR-MTA-TID: 64aa7808 Received: from e1066929150e.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C912AF25-8953-40F3-B450-FCD05AD78302.1; Mon, 22 May 2023 12:18:49 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id e1066929150e.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 22 May 2023 12:18:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=avv0u/PCIZT0pSnoRndgOEO04iXPTz092hitw0mQRBPPT8sO8xKYocuGxjTP5dxOfub1wASWAIEMZxvwU8/b5gBdAY6dYFBw51BQsYVdw4sKOIWcJu93Z29BlbkF4TNLP6tHa/joEEfmC3NvvSUDBOgm74Q5IPsGtP8ZrdzQYnktYakirR3iPGFH5qFCTUT/rgdO0IGOLJPOG3cg6W8f+awTPh5MeaVpOh1GvjfllCp8YJY2OGXo0CzUrIhLAtomwPv+C1jsUAKCvkCvgn4c81UuhlN2GyS5vS3b3WLU9zVC/Cci8tx3UeQFHnzvKVv1T4VwkVyP2VdZoi3nYRdcFg== 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=T76CVMFlKkySfao0PCg62erkWSjojNAMXgLozPHDriY=; b=PAOdQP2DLxjTJDNJkZ2bUYckIuIzmUqLGq/CJ0U63X5JoQtNxtlFaCyY9ZVwP1inpYS5GnvSsS/tqmZwaVnB6+SH14JRJSVeeBxJd1sf4CEraLrI8dkxJ4aujdV/yMu043f6prlUpns4W0LQ5iT3Hl5GLBim0aXUclfQW2l6jGBNIWaqf9g1VDcgZHMvrTF+k9miMCoYYuPtE167SR1OSesBzkdxNq+CCXZArNdyS4O9zWqefpE0RjXve6u1A+3wnXqEiMS/TQUOSXut6vQflSL9dolfvx7RHqVWpaLIOLdej2f5Wnz+jT/VHOxgP4ve7vVBIioRoBCc68ACQn84Ig== 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=T76CVMFlKkySfao0PCg62erkWSjojNAMXgLozPHDriY=; b=tiXh8JcveSUqAkmC2/114SFVOHpvDWK1K420Q1ZZUL+TT7w46JfH3voxb6EBDJSw6X8FHSZkKB+wzOF7OJqSfi+7li97pM3jB7ASr1K3PnSX4RzKLreKu1KocD/XKiwkoemkUIul32jTiZ8zlsGwUPoLFl7wkG2p83Ar3brQoZk= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by VI1PR08MB5470.eurprd08.prod.outlook.com (2603:10a6:803:136::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.28; Mon, 22 May 2023 12:18:46 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::7afd:553d:71b8:4c8c]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::7afd:553d:71b8:4c8c%6]) with mapi id 15.20.6411.028; Mon, 22 May 2023 12:18:46 +0000 Message-ID: Date: Mon, 22 May 2023 13:18:45 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH V2 1/3] MdePkg/IndustryStandard: add definitions for MPAM ACPI specification From: "Sami Mujawar" To: Rohit Mathew , devel@edk2.groups.io Cc: Michael D Kinney , Liming Gao , Thomas Abraham , James Morse , "nd@arm.com" References: <20230518150619.2491567-1-Rohit.Mathew@arm.com> In-Reply-To: X-ClientProxiedBy: LO4P123CA0504.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1ab::23) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|VI1PR08MB5470:EE_|DBAEUR03FT041:EE_|DU0PR08MB8091:EE_ X-MS-Office365-Filtering-Correlation-Id: d7dca80f-ffcd-402c-9e12-08db5abeb94f 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: M3FnWpFu/6GoAORYuRbaRyNrXoNg5e0RW3nUZlkuJjC710JtsF8YNEJ83cBhU1HHPQKYM/znbq+fQVjujygA0hyk40s64KwXapbUVr/bPQ11XcWc8HYjafZFEAq0Mo9eDhEg2RopHtB+VCLiiozEeeTb8A4IYJFw3UUBlq7TTsLGXrKPVFJKL0yRg9ss+4qZdkorEyW0JN8AeD6G6kmNLCyJD1KlCzUgeZ1dWxTl4bu+DIKbNoCtQhm06AFamIx0lxbZUsW9Mc4A4N1RoEOFFFa27t+OIQgPl3Dc/pGfe2woKdj+VccP89gyJOu+lLs8tAz7zyFl4A2HB1AGoTkhi+GrWGocwjfEUGUkDWjR9dp6efcBGmeQ/tKtQEQJF4CNERpwLzhbAOfIVYmQ8/Lh9N5uckUl18lmnntyHjE5VEjzqkNxWYFLozeGQrVFa1R5WdtQM2tRoSEO71kLtiKb3ZASBXSXWM53Hc6FwryuETNGt8tjWW57gZ4eMM4iKQ7+AlC1m+1/xnfCW/ti7fA1jUoPc2NjNooHjeqROoNBjPYa9y9Lfe+7ynWOL61uzwd7se3DjCBELiQxAdbq+Q7byro1LNSWIoUTUbengMMcNoFPqAH3pmuFMipK0XQ8g4FYWUW05IJTBMAMdxN5rwUyHDCJE4SQMApcRx5/Kg7sFOI= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(396003)(136003)(376002)(39850400004)(451199021)(31686004)(30864003)(2906002)(19627235002)(5660300002)(83380400001)(44832011)(8676002)(8936002)(41300700001)(66946007)(66476007)(4326008)(66556008)(54906003)(316002)(36756003)(33964004)(6486002)(478600001)(966005)(2616005)(6512007)(6506007)(26005)(31696002)(86362001)(186003)(53546011)(38100700002)(166002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB5470 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: b6e5136d-f363-4e28-62f0-08db5abeb0ef X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eeybPwd6pE35PrWdu6f1SLmL8dqfLPf85+IjQL5LC+v9/IUprKMdWvUq7LZrL4lVXD89A7vJIf7LG6VT1XgBUmMlMbd5q+AFmZ8vpAEMK6yNlWDVW4jo4VRklYmoRhPvKopDn/kdllHlQqaMgLdOqRuw4lUocVYkBU7d2Q8np0zyAgDms6IH3V2L5ACt+VpLv3eY9jHNg+Mh0wICWjbkaSmbC547vMedzTWBGZ9nH4yPJK9vnnpYRZavtztVd9qNv43IFev5AMxvmwn2tDIvuJEQ3yk3jhppOVFJPSJnuwkvdGVnj55Zflei8Eh1rpBH4JDzbOP2LfHahJbU1ZlZfOQEMaqLGVu4wXhx8/spLbtjHua0LNgXoSLH6s3+rm7wJtMjCFtjA/Tgd6m1JTp9vYn7BFjwJQJnh/msKPxRJ5asllYKLqy/s1Gx/dKtexJa+pNLNnD5Q5kSX7lpQidTJ9QJs3Az47o2eXI3uiYEMbm6/gupxMLeEV6v1w9x3JJDltt3g8vItJmM0aY9ByeASHvx0ieOdoZoaTnW3oVdHeeZB3YaRkMvLzyzeQcCkihWdkZ+ccIuIg4s/5NbxbcbKFdUzbT4cItYOcg7S+0iDfh9bYFgfwmmQrmiL8DL3Q0Y4SWbUM0CBmfR+Rf62GX7oSRjChfDnY8n+gs3x/Bu7iU/ieP3AKfUmM8Qm7fw8gsK67JhLoISpAzOlSZkihZBeqEitLeYeZYjpfxHI5Mt7RwQMCWgxhblRMtn7PzdoSZ/wIQJ7APOxot3Mu/DJWB11t2hJo3snnDUiU0T0vtetQQ= 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:(13230028)(4636009)(346002)(136003)(39860400002)(396003)(376002)(451199021)(46966006)(36840700001)(40470700004)(4326008)(5660300002)(44832011)(54906003)(31686004)(41300700001)(316002)(19627235002)(30864003)(478600001)(8936002)(2906002)(70586007)(8676002)(70206006)(186003)(966005)(6512007)(6486002)(6506007)(40460700003)(33964004)(26005)(53546011)(356005)(2616005)(83380400001)(81166007)(336012)(47076005)(36756003)(36860700001)(40480700001)(82740400003)(86362001)(82310400005)(31696002)(166002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 12:19:00.2189 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7dca80f-ffcd-402c-9e12-08db5abeb94f 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: DBAEUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8091 Content-Type: multipart/alternative; boundary="------------5r8l5iX4FmnDfxudwE02e50E" --------------5r8l5iX4FmnDfxudwE02e50E Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Rohit, Just to be clear, I am looking at the following spec https://documentation-service.arm.com/static/638757e5e1ed1c2162fc75b2?token= Regards, Sami Mujawar On 22/05/2023 01:16 pm, Sami Mujawar wrote: > > Hi Rohit, > > Please find my response inline marked [SAMI]. > > Regards, > > Sami Mujawar > > On 18/05/2023 04:06 pm, Rohit Mathew wrote: >> From: Rohit Mathew >> >> add definitions, macros and types for elements associated with MPAM >> ACPI 2.0 specification. >> >> Signed-off-by: Rohit Mathew >> --- >> MdePkg/Include/IndustryStandard/Acpi65.h | 7 +- >> MdePkg/Include/IndustryStandard/Mpam.h | 258 ++++++++++++++++++++ >> 2 files changed, 264 insertions(+), 1 deletion(-) >> >> diff --git a/MdePkg/Include/IndustryStandard/Acpi65.h b/MdePkg/Include/IndustryStandard/Acpi65.h >> index 1e41ae9a27..8a1d3d125a 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, 2022. >> >> Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.
>> - Copyright (c) 2019 - 2021, ARM Ltd. All rights reserved.
>> + Copyright (c) 2019 - 2023, ARM Ltd. All rights reserved.
>> Copyright (c) 2023, Loongson Technology Corporation Limited. All rights reserved.
>> >> SPDX-License-Identifier: BSD-2-Clause-Patent >> @@ -3251,6 +3251,11 @@ typedef struct { >> /// >> #define EFI_ACPI_6_5_XEN_PROJECT_TABLE_SIGNATURE SIGNATURE_32('X', 'E', 'N', 'V') >> >> +/// >> +/// "MPAM" Memory System Resource Partitioning and Monitoring Table >> +/// >> +#define EFI_ACPI_MEMORY_SYSTEM_RESOURCE_PARTITIONING_AND_MONITORING_TABLE_SIGNATURE SIGNATURE_32('M', 'P', 'A', 'M') >> + >> #pragma pack() >> >> #endif >> diff --git a/MdePkg/Include/IndustryStandard/Mpam.h b/MdePkg/Include/IndustryStandard/Mpam.h >> new file mode 100644 >> index 0000000000..5d4c466abb >> --- /dev/null >> +++ b/MdePkg/Include/IndustryStandard/Mpam.h >> @@ -0,0 +1,258 @@ >> +/** @file >> + ACPI for Memory System Resource Partitioning and Monitoring 2.0 (MPAM) as >> + specified in ARM spec DEN0065 >> + >> + Copyright (c) 2023, 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_TABLE_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_MEMORY_LOCATOR_RESERVED_MASK should be used along with an 8 byte object >> +/// starting at the base of the locator field. >> +/// >> +#define EFI_ACPI_MPAM_MEM_LOCATOR_RESERVED_FIELD_MASK (0x00FFFFFFFFFFFFFFULL) >> +#define EFI_ACPI_MPAM_MEM_LOCATOR_RESERVED_FIELD_SHIFT (0) >> + >> +/// >> +/// MPAM_MEMORY_LOCATOR_LEVEL_MASK should be used along with an 8 byte object >> +/// starting at the base of the locator field. >> +/// >> +#define EFI_ACPI_MPAM_MEM_LOCATOR_LEVEL_FIELD_MASK (0xFF00000000000000ULL) >> +#define EFI_ACPI_MPAM_MEM_LOCATOR_LEVEL_FIELD_SHIFT (56) >> + > [SAMI] Can you point me to the section in the spec where I can find > this information, please? Are these definitions for Memory-side cache > locator descriptor by any chance? >> +/// >> +/// 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 >> +/// >> +#define EFI_ACPI_MPAM_INTERFACE_MMIO (0x0) >> +#define EFI_ACPI_MPAM_INTERFACE_PCC (0x1) >> + >> +/// >> +/// MPAM Link types >> +/// >> +#define EFI_ACPI_MPAM_LINK_TYPE_NUMA (0x0) >> +#define EFI_ACPI_MPAM_LINK_TYPE_PROC (0x0A) > > [SAMI] Is the EFI_ACPI_MPAM_LINK_TYPE_PROC values and > EFI_ACPI_MPAM_INTERFACE_PCC value swapped by any chance? Or I am > looking at a completely wrong spec. > > Can you point me to the correct spec, please? > > [/SAMI] > >> + >> +#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 --------------5r8l5iX4FmnDfxudwE02e50E Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

Hi Rohit,

Just to be clear, I am looking at the following spec https://documentation-service.arm.com/static/638757e5e1ed1c2162fc75b2?token=

Regards,

Sami Mujawar

On 22/05/2023 01:16 pm, Sami Mujawar wrote:

Hi Rohit,

Please find my response inline marked [SAMI].

Regards,

Sami Mujawar

On 18/05/2023 04:06 pm, Rohit Mathew wrote:
From: Rohit Mathew <rohit.mathew@arm.com>

add definitions, macros and types for elements associated with MPAM
ACPI 2.0 specification.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
---
 MdePkg/Include/IndustryStandard/Acpi65.h |   7 +-
 MdePkg/Include/IndustryStandard/Mpam.h   | 258 ++++++++++++++++++++
 2 files changed, 264 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/IndustryStandard/Acpi65.h b/MdePkg/Include/IndustryStandard/Acpi65.h
index 1e41ae9a27..8a1d3d125a 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, 2022.
 
   Copyright (c) 2017 - 2022, Intel Corporation. All rights reserved.<BR>
-  Copyright (c) 2019 - 2021, ARM Ltd. All rights reserved.<BR>
+  Copyright (c) 2019 - 2023, ARM Ltd. All rights reserved.<BR>
   Copyright (c) 2023, Loongson Technology Corporation Limited. All rights reserved.<BR>
 
   SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -3251,6 +3251,11 @@ typedef struct {
 ///
 #define EFI_ACPI_6_5_XEN_PROJECT_TABLE_SIGNATURE  SIGNATURE_32('X', 'E', 'N', 'V')
 
+///
+/// "MPAM" Memory System Resource Partitioning and Monitoring Table
+///
+#define EFI_ACPI_MEMORY_SYSTEM_RESOURCE_PARTITIONING_AND_MONITORING_TABLE_SIGNATURE  SIGNATURE_32('M', 'P', 'A', 'M')
+
 #pragma pack()
 
 #endif
diff --git a/MdePkg/Include/IndustryStandard/Mpam.h b/MdePkg/Include/IndustryStandard/Mpam.h
new file mode 100644
index 0000000000..5d4c466abb
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/Mpam.h
@@ -0,0 +1,258 @@
+/** @file
+  ACPI for Memory System Resource Partitioning and Monitoring 2.0 (MPAM) as
+  specified in ARM spec DEN0065
+
+  Copyright (c) 2023, 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 <IndustryStandard/Acpi.h>
+
+///
+/// MPAM Revision
+///
+#define EFI_ACPI_MEMORY_SYSTEM_RESOURCE_PARTITIONING_AND_MONITORING_TABLE_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_MEMORY_LOCATOR_RESERVED_MASK should be used along with an 8 byte object
+/// starting at the base of the locator field.
+///
+#define EFI_ACPI_MPAM_MEM_LOCATOR_RESERVED_FIELD_MASK   (0x00FFFFFFFFFFFFFFULL)
+#define EFI_ACPI_MPAM_MEM_LOCATOR_RESERVED_FIELD_SHIFT  (0)
+
+///
+/// MPAM_MEMORY_LOCATOR_LEVEL_MASK should be used along with an 8 byte object
+///  starting at the base of the locator field.
+///
+#define EFI_ACPI_MPAM_MEM_LOCATOR_LEVEL_FIELD_MASK   (0xFF00000000000000ULL)
+#define EFI_ACPI_MPAM_MEM_LOCATOR_LEVEL_FIELD_SHIFT  (56)
+
[SAMI] Can you point me to the section in the spec where I can find this information, please? Are these definitions for Memory-side cache locator descriptor by any chance?
+///
+/// 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
+///
+#define EFI_ACPI_MPAM_INTERFACE_MMIO  (0x0)
+#define EFI_ACPI_MPAM_INTERFACE_PCC   (0x1)
+
+///
+/// MPAM Link types
+///
+#define EFI_ACPI_MPAM_LINK_TYPE_NUMA  (0x0)
+#define EFI_ACPI_MPAM_LINK_TYPE_PROC  (0x0A)

[SAMI] Is the EFI_ACPI_MPAM_LINK_TYPE_PROC values and EFI_ACPI_MPAM_INTERFACE_PCC value swapped by any chance? Or I am looking at a completely wrong spec.

Can you point me to the correct spec, please?

[/SAMI]

+
+#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
--------------5r8l5iX4FmnDfxudwE02e50E--