From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (EUR04-HE1-obe.outbound.protection.outlook.com [40.107.7.53]) by mx.groups.io with SMTP id smtpd.web10.20440.1684757819659864839 for ; Mon, 22 May 2023 05:17:00 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=Ax+wJoY9; spf=pass (domain: arm.com, ip: 40.107.7.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=y4o3J+8cM3cpAZGBEwp+P8m7Mc5snqE33R+CEOjkANM=; b=Ax+wJoY9DTpZ7V7LAY++eUqpg320/6ncUeqFIhxBC88QDn/xBxiy+dqnXgsMUXHuavrb/0fonJ3CfHC9HEp7lePtSpH/qDiXQ43GOct9HVhi/Hkd3DXhOHkeqOIlcjXpQHEqYz5uf17WjwYK4yONkPATxL0fE090KXqiLEVaJg0= Received: from AS4P191CA0048.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:657::17) by AS8PR08MB10291.eurprd08.prod.outlook.com (2603:10a6:20b:629::15) 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:16:55 +0000 Received: from AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:657:cafe::55) by AS4P191CA0048.outlook.office365.com (2603:10a6:20b:657::17) 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:16:55 +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 AM7EUR03FT009.mail.protection.outlook.com (100.127.140.130) 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:16:55 +0000 Received: ("Tessian outbound 5bb4c51d5a1f:v136"); Mon, 22 May 2023 12:16:55 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ff4312fd93ec7e39 X-CR-MTA-TID: 64aa7808 Received: from 733f6a0e5dd0.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 80B76204-C878-4E24-9995-0C8085DED2AF.1; Mon, 22 May 2023 12:16:43 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 733f6a0e5dd0.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 22 May 2023 12:16:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WZE3pYvZ4jChlbC217I96Uzx05kUipIyqmGh9ItO97gChqXDqrDjhJhVo5qrxoCxLV3eb0/YOkylv6q+MioqUTvhv14qi7lC1HIUiLUfG/9DMAiP061/QsWrXKOfIkMpfdNROJz2CGSbgpYODnOn/TGjHRlQX2jpHpoREGgaZVwsLWZo1K1nuqBhjMM6/cwlc8R0qmJVTOTiMmv9pT/3Nl24R1kcvphUSUX96mWESYoveZPTVrJFy5iakZgZfOVS3RbZ77qoQnYJ/kaeFzti1WT99e7Vvvks0EmouJYvSo9wwD2rQn95CoZ68Cp/aYC5bhw3bu7ujYTxRqAyDk9jrQ== 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=y4o3J+8cM3cpAZGBEwp+P8m7Mc5snqE33R+CEOjkANM=; b=cEZ8sAYD0I0Ie3/ECRIQTSr+CqkjSdNPbFI07Q6Xd978dxY6QvCMO0MSAovHjwvmKwZFaEUp9036QjAtn9A+75AvjXDPafxn4xPTJ+vOcrAaWSUZDEyy9xCAPNb9sU9NafDAA7Cx23AtkCD69+0jC3LO9JSsKgmAdU4P5yrsN+Ip/ZLyE40NRueKuoZIUYTV99K/kI+LyWnb2ul8GjprqReUZzOgHoQ2nksFEOM8BNS4JLwDz1IQLRj90v78LNxqj5cvCBPNLiY0dS3sIdVnqRcZLJguRNpdBMR984ZDl1SGL06Cr6WS0jiFrlXLszjDILX6ZCsdgNImrH5LV57vmg== 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=y4o3J+8cM3cpAZGBEwp+P8m7Mc5snqE33R+CEOjkANM=; b=Ax+wJoY9DTpZ7V7LAY++eUqpg320/6ncUeqFIhxBC88QDn/xBxiy+dqnXgsMUXHuavrb/0fonJ3CfHC9HEp7lePtSpH/qDiXQ43GOct9HVhi/Hkd3DXhOHkeqOIlcjXpQHEqYz5uf17WjwYK4yONkPATxL0fE090KXqiLEVaJg0= 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 DB4PR08MB8173.eurprd08.prod.outlook.com (2603:10a6:10:383::11) 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:16:39 +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:16:39 +0000 Message-ID: Date: Mon, 22 May 2023 13:16:37 +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 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> From: "Sami Mujawar" In-Reply-To: <20230518150619.2491567-1-Rohit.Mathew@arm.com> X-ClientProxiedBy: LO6P265CA0023.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2ff::9) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AS8PR08MB6806:EE_|DB4PR08MB8173:EE_|AM7EUR03FT009:EE_|AS8PR08MB10291:EE_ X-MS-Office365-Filtering-Correlation-Id: 2687c295-c4ad-4d9d-e794-08db5abe6f0c 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: Ttc195vgWw3Po+fEtIHgDCnJ4b49mKZmuibLy8pBcaYMaY/0zF5ubfebe/gp6HGDTBbQohbfIviB7AMMpuFmWbXk1TT+BTDrlZX9rT/YMjUcRTEHwgWbSOK9fXCm4Fdlc8Ui9a5qy3vOOu7eR6fkUu82ABCgbNZstibTG9kNnl7UF6qCghhK1nUjKjEf0fJMJXHoBbTduoyHMjBFD6ZbuIT+0TZ8tOnlOUemdVWQBP8Tsvt74WuH9iLuLx3gH61DjcTyzGTpl06syNwenTKOmAXGXg+wE5djD0afv22EjFqp5XQUvwZ7xvKNgtmVZibIhESYBF5FcRaSIgaffs6OjBlimxa1qNWlC+/5qQHFPX/+PygD0IS03PUyfuszPrebTK4S+O1gMc3FtVyecCHXVTeLlK9YEpcCldKGfSbtVWvNgY4yHxsfMZZ8c7Wf/aj500Y1Z7KKh9BRcz1RLxQgw4K35myevd/cO5wFApKtPUM7vfa2oo3usmA2pka6QEb0tBBeogc16gQq7fU/nEDUZmgWen56Z9wHyk+ljFQGzmQp6eFL+F530VxcY+ml9/0gMEBL7Xdl3Nli1kboxGmo0zfOEt8rO1hYRC2Cf4SAny5ME3N7UHw59jFv9Xp2X3RyaetZbr2GW/ho1BcWJa3k8w== 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)(396003)(366004)(376002)(346002)(136003)(39850400004)(451199021)(6486002)(86362001)(36756003)(54906003)(31686004)(478600001)(31696002)(83380400001)(33964004)(19627235002)(66476007)(66946007)(66556008)(38100700002)(316002)(4326008)(6506007)(41300700001)(2906002)(26005)(186003)(30864003)(8676002)(8936002)(6512007)(166002)(53546011)(5660300002)(2616005)(44832011)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR08MB8173 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: AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 12690053-49c4-4d25-5ca1-08db5abe6523 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6xiW9Ppw+7kklVILxFE9U0Lsmd3rTpXhuwZVtdPOgjUrchLiGup9Qt+fkJuRyKcs+tQeMPbIvxmdw0AYBv398XybLhG8pntqz4es009k87jqVxoXtkDhZ2XqKRMOaVkpH6dh8ykmqSDXQBT4WB9DqkMMbVl7iRV882jR3thOihZfaP5aTyFV5F96F7ej5pTwFCdLlkZXpW8QtqLkTDl4tlQzbwboc9FpjXfgonSVFz7H1PdOHHDmc8HE9Wi+YRsCQ9CI0BZ1BDQcZWIf5FrXjrjhP3BckkqhyJcl4Z0ykG7PJexhmeJ6fDr3wky1m1mLCsTqg0ey/5ydYDk4YEpLpM3p4ja6ev4cp1aUFOmTUA/y86qDO6Ssi/EwufO+D1/RNgXBxyjCOgeuYzBr9yCZPG3ykiyXKdxvtN1A4q8IA1Ru3DvW468kKlgpGFYW8m+KFxu0U2dbpSn8nf3GSgpkWNibf4EBaADDt8MwWBYfhZ+jeoN4ybJI+Vr9ZZn3ClBqURL0SK9vEUqovJvyH+6TqVwtdMZNblJl4sCEIh+70KzbXxURB3Uy6OVFY3c6Jo13yBH6aCPzObCSI9scmiuTPrcSDzVoKMvMd3rR1xYxtscMPjaO9IKUQpQRLWYucnnqeEylUsUZdgi4zjE/0TYLkG2aI3O30xTM2/Aaq3UjNL5WzQiXxGN5PZ6Ns3Zbo9+wA2qn3OmXeaClwa7+F/uKvQhnclhnl3S7eIRS8851NNFUWXTg8oltWpgk3Q/j+T/u 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)(396003)(346002)(39860400002)(136003)(376002)(451199021)(40470700004)(36840700001)(46966006)(478600001)(31686004)(19627235002)(6512007)(6506007)(26005)(53546011)(4326008)(316002)(41300700001)(70586007)(70206006)(54906003)(6486002)(33964004)(40460700003)(8676002)(8936002)(5660300002)(82310400005)(31696002)(86362001)(40480700001)(44832011)(47076005)(2906002)(30864003)(83380400001)(36860700001)(82740400003)(81166007)(356005)(166002)(2616005)(186003)(36756003)(336012)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 May 2023 12:16:55.5678 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2687c295-c4ad-4d9d-e794-08db5abe6f0c 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: AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB10291 Content-Type: multipart/alternative; boundary="------------dUEAg5woKndxgfAtznUFN5Kz" --------------dUEAg5woKndxgfAtznUFN5Kz Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------dUEAg5woKndxgfAtznUFN5Kz Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit

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
--------------dUEAg5woKndxgfAtznUFN5Kz--