From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id D4E12941539 for ; Wed, 27 Sep 2023 10:10:58 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=rxX5DldP/p42DGmknxWA27Z5Pu2Yg+fgDXO+k0QkWCE=; c=relaxed/simple; d=groups.io; h=Received-SPF:ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:Authentication-Results-Original:nodisclaimer:MIME-Version:Original-Authentication-Results:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1695809457; v=1; b=GcDBFMjeovxrsLrwA+yCZXX2auKxGUDzqEqKewRFce6fEAd2BVgTzrTk947g5lAjaJOzk9c/ cYOsk/8FEKMh1o4x4wnS2/Ikii95JW4f8poWgukqQiBWAWHiB3MMPcqNpx0Lp6Alkfpk4pel6m7 h4tiwsGCTMmEOyLGKRhfCHFw= X-Received: by 127.0.0.2 with SMTP id oi5iYY7687511xH76SsA5QLb; Wed, 27 Sep 2023 03:10:57 -0700 X-Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.44]) by mx.groups.io with SMTP id smtpd.web11.14143.1695809455750121994 for ; Wed, 27 Sep 2023 03:10:56 -0700 X-Received: from DB9PR05CA0019.eurprd05.prod.outlook.com (2603:10a6:10:1da::24) by DB9PR08MB7606.eurprd08.prod.outlook.com (2603:10a6:10:309::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Wed, 27 Sep 2023 10:10:48 +0000 X-Received: from DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1da:cafe::77) by DB9PR05CA0019.outlook.office365.com (2603:10a6:10:1da::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 10:10:47 +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 X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT010.mail.protection.outlook.com (100.127.142.78) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.21 via Frontend Transport; Wed, 27 Sep 2023 10:10:47 +0000 X-Received: ("Tessian outbound d084e965c4eb:v175"); Wed, 27 Sep 2023 10:10:47 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e905ca1f19f933ef X-CR-MTA-TID: 64aa7808 X-Received: from ea518d6096e3.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 6E000EEE-7657-4CFA-8CBE-37C8C0E4FE28.1; Wed, 27 Sep 2023 10:10:37 +0000 X-Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ea518d6096e3.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 27 Sep 2023 10:10:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bUkU9bFFg3QPXC7DYczUUF0ezUnUzCptgO5jwNTZkPV+1FgWHzPRPIYOBdArMCfegTNaNciroqjt54MqMW5tOY3901+UKtfNq8bp2VLAYT8rGSi0htpTZb8blDQHWldE5xsCBIDeDv/quTnu1CDG2wMjaqjtItZ8ojIyTu/G/ixCsjeVBgpN0ZSGL6Ua4kU5aKEl7qr+6ens22qiWwAfnkRcWuqb3IoZX076naKVZwWwWYzySReZ7gUP7PPJSh8S2sQePdO+X7g8+L1vY59s3BJWgTA86WsXo4F2nM84ApT5Ecp6r3XKLmAWZOniACVi1Zg6i5SqcMhXQjKegM77eQ== 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=puA+RtAjGoJwmJ+nHD6eTIsrtbK6RctFaLgusMLqQUY=; b=Rp5druRpvVqGbsOUg+YykBPwPhSsJIALgyTu8rIoplAOiiqrVRD0D0NBp7ijCMbK/7zZfgLN1G5fYIB+ww9KuaicLqTZtFkyi5hojpkJmZPmmG+rXgHWgfkmbG9g1PjBAAmhk4NAdiQn5NIPnw1yEy0Ly3OAT5wD3oZZdTp+u9z5WVeuKwaK3KOhOrPNj/mpo0o8tBJKmL/GINp/VcGdf9swGUP8sZKJ39oMiiIiiPOCRJgPnovKMPZKbu+H4pFztRyQLCnYeb1RdzDZ1GYtnLQsVX5MlGZqrH3Ac8tDq9veiBKZgf+rDfRtYN9QPfRu7eUV7YGGvCv1h8QXK6yDqA== 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 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com (2603:10a6:208:148::12) by AS8PR08MB7864.eurprd08.prod.outlook.com (2603:10a6:20b:52f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.25; Wed, 27 Sep 2023 10:10:33 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::edbe:a5b0:5fb6:87b5]) by AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::edbe:a5b0:5fb6:87b5%4]) with mapi id 15.20.6838.016; Wed, 27 Sep 2023 10:10:33 +0000 From: "levi.yun" To: "devel@edk2.groups.io" , "tphan@ventanamicro.com" CC: "ardb+tianocore@kernel.org" , Sami Mujawar , "ray.ni@intel.com" , "huangming@linux.alibaba.com" , "sunilvl@ventanamicro.com" , "yong.li@intel.com" Subject: Re: [edk2-devel] [PATCH v2 1/2] StandaloneMmPkg: Make StandaloneMmCpu driver platform independent Thread-Topic: [edk2-devel] [PATCH v2 1/2] StandaloneMmPkg: Make StandaloneMmCpu driver platform independent Thread-Index: AQHZ52DbgBhYNUdi806ngS+onnhfQrAuhnjc Date: Wed, 27 Sep 2023 10:10:33 +0000 Message-ID: References: <20230914231037.23950-1-tphan@ventanamicro.com> <20230914231037.23950-2-tphan@ventanamicro.com> In-Reply-To: <20230914231037.23950-2-tphan@ventanamicro.com> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AM0PR08MB4289:EE_|AS8PR08MB7864:EE_|DBAEUR03FT010:EE_|DB9PR08MB7606:EE_ X-MS-Office365-Filtering-Correlation-Id: c206cfe7-3b22-4f34-ff9a-08dbbf42050e 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: NZEA7n7S48kj0JKmVy0kTgGb4g0+TdI3L0fiHc7trpcliYBw/6ffbPsPZ3Nsk4roNzkrDpzoFJMWzRKNkcXfd5iVX3dVwtbwKCuVtlIsB+abtBk+DfjR2uT+PUvRMxnkiFsFQZ/vXyxvVe9ixR10nCdYc/lWYRrDqpuorLrS80zLWl9H5X0gzqRUV22IaDc+B2/T50e4ds2JWciuJzC6O4VeUe8pT5kH3QSGS/t7gUtn5gZhLKs3k0b4A8Wv/p2jKopGghdAbDTHm+a7vYTuM8pdIkYjsB+5F6pg6u+d3zhj0+Y9Z8I1dQS8gHfQ6hDE5D5kr3pRDIk/VBM2xeoqc2m8Ea+rOiuNv3O12NT26hys6jFPHE8cQvytVXZK4FFRy1tCztHrZczfdQYcnZSx2KZ7ccoF/wv+W1Jrd7nd4BHeHlf4RBTackrTJLl0INpram+s6DVXOIsC4fknvDhMSzy2cYLR42OP+7Vx/eCQ/7Xgv4VGIaWWxw5vycm+OVAF6bJ4pVGULNzJ7fSPJX7YlNA+3FhoIJfyUzUe46Z6b6dpX2C4NmG/yLJEttzvQQ5E3shygXBUgW8/8kaswdiArRy/tGcF85Z1Km6q2OqioLQ= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB4289.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(6029001)(396003)(346002)(136003)(366004)(39860400002)(376002)(230922051799003)(451199024)(1800799009)(186009)(83380400001)(66899024)(5660300002)(41300700001)(55016003)(52536014)(86362001)(91956017)(66556008)(110136005)(76116006)(2906002)(66946007)(478600001)(4326008)(38070700005)(54906003)(38100700002)(30864003)(71200400001)(316002)(64756008)(66446008)(122000001)(8676002)(8936002)(53546011)(966005)(9686003)(33656002)(66476007)(7696005)(26005)(6506007);DIR:OUT;SFP:1101; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB7864 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6dca67d3-e119-4371-188b-08dbbf41fc55 X-Microsoft-Antispam-Message-Info: /SPAjt7xNcRB7KrjXWj25w3xxpd8IK0VTODVaQYI5upIPEc+N2mxWAQyzKtxEs3x0JJ733gsG/tC4i4ons2QeYA5FihL5/l3FLb//XAkdy4+qDUW+55XeTaDTuV7esV56PjOFDm4gdI7YoqbP4kKnsuEGDo8ntRsb4fp/5sPdIxoev6je+cOvq7qQJFvUTmjSFBPriJVdPlxCXBHrecL6jZNYHC9t5p2WOxcqsVzIZb/6p7pVg/02jo0Sg+uoqr4o2o+DHruFj1Qb1TyvHdW4k7QRYaiXrGwCYcLijZmdqXFO8fO4IN3SqVXjVC+4gAAgLoT9svY31+GiGuy1P3rzVBRJaKkj2k8qUhwBzx9UJmM+WXgf+WgW65edQSJ2dTdhhoz9xrc8sUuQZynsYzYITNUehlBaPc/YwGfvtIJ/XwXSjysT90mlTdM9423Cw3mRYJS6YcjcaZuHz0PHbIPdr1jYPw2rAyxaDyt7mjg5wPqnGcUM8jp0paWss72cks83TGn527qP1Z5cePsHB1CPwZ4e4qadO5EccGILXofU2i2l1Oz2RH3GWtOkDHxTRIlLBpiDjZqIlVydp7nhsDU4xVCvhNXur+HJq5hfUo2EWX6ieOQeItASsfsou8GHlRpDjsKlOSV2M2GFL6Rz6dxaYJL0XJlSdxtSDgqE775b9ldBn9FORoyEJ59E6DMLTgRUIxDm3TW3xHsjMK+PVgyNivyF8PmMmWDmNHGBRkcmQw= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 10:10:47.6204 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c206cfe7-3b22-4f34-ff9a-08dbbf42050e 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: DBAEUR03FT010.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7606 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 Reply-To: devel@edk2.groups.io,yeoreum.yun@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: JKqmGNrAyPZ7HXAVGCIaZKfAx7686176AA= Content-Language: en-GB Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=GcDBFMje; 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 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Look good to me. Thanks! Reviewed-by: levi.yun ________________________________________ From: devel@edk2.groups.io on behalf of Tuan Phan vi= a groups.io Sent: 15 September 2023 00:10 To: devel@edk2.groups.io Cc: ardb+tianocore@kernel.org; Sami Mujawar; ray.ni@intel.com; huangming@li= nux.alibaba.com; sunilvl@ventanamicro.com; yong.li@intel.com; Tuan Phan Subject: [edk2-devel] [PATCH v2 1/2] StandaloneMmPkg: Make StandaloneMmCpu = driver platform independent StandaloneMmCpu now can supports more platforms like RISC-V besides ARM/AARCH64. Signed-off-by: Tuan Phan --- .../Drivers/StandaloneMmCpu/EventHandle.c | 25 +++-------- .../Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 42 +++++++++---------- .../StandaloneMmCpu/StandaloneMmCpu.inf | 9 ++-- .../StandaloneMmCpu.h | 22 +++++++--- StandaloneMmPkg/StandaloneMmPkg.dec | 2 +- 5 files changed, 46 insertions(+), 54 deletions(-) rename StandaloneMmPkg/{Drivers/StandaloneMmCpu =3D> Include}/StandaloneMm= Cpu.h (82%) diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c b/Standa= loneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c index 818e147f874c..dc11d4375a02 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c @@ -3,6 +3,7 @@ Copyright (c) 2016 HP Development Company, L.P. Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. Copyright (c) 2021, Linaro Limited + Copyright (c) 2023, Ventana Micro System Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -11,8 +12,6 @@ #include #include -#include -#include #include #include #include @@ -22,10 +21,7 @@ #include #include -#include -#include - -#include "StandaloneMmCpu.h" +#include EFI_STATUS EFIAPI @@ -108,7 +104,7 @@ CheckBufferAddr ( } /** - The PI Standalone MM entry point for the TF-A CPU driver. + The PI Standalone MM entry point for the CPU driver. @param [in] EventId The event Id. @param [in] CpuNumber The CPU number. @@ -121,7 +117,7 @@ CheckBufferAddr ( @retval EFI_UNSUPPORTED Operation not supported. **/ EFI_STATUS -PiMmStandaloneArmTfCpuDriverEntry ( +PiMmStandaloneMmCpuDriverEntry ( IN UINTN EventId, IN UINTN CpuNumber, IN UINTN NsCommBufferAddr @@ -135,17 +131,6 @@ PiMmStandaloneArmTfCpuDriverEntry ( DEBUG ((DEBUG_INFO, "Received event - 0x%x on cpu %d\n", EventId, CpuNum= ber)); Status =3D EFI_SUCCESS; - // - // ARM TF passes SMC FID of the MM_COMMUNICATE interface as the Event ID= upon - // receipt of a synchronous MM request. Use the Event ID to distinguish - // between synchronous and asynchronous events. - // - if ((ARM_SMC_ID_MM_COMMUNICATE !=3D EventId) && - (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ !=3D EventId)) - { - DEBUG ((DEBUG_ERROR, "UnRecognized Event - 0x%x\n", EventId)); - return EFI_INVALID_PARAMETER; - } // Perform parameter validation of NsCommBufferAddr if (NsCommBufferAddr =3D=3D (UINTN)NULL) { @@ -177,7 +162,7 @@ PiMmStandaloneArmTfCpuDriverEntry ( } // X1 contains the VA of the normal world memory accessible from - // S-EL0 + // secure world. CopyMem (GuidedEventContext, (CONST VOID *)NsCommBufferAddr, NsCommBuffe= rSize); // Stash the pointer to the allocated Event Context for this CPU diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c b/St= andaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c index 3d1dc6181bd9..c5ec1a5a80c5 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c @@ -3,6 +3,7 @@ Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2016 HP Development Company, L.P. Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. + Copyright (c) 2023, Ventana Micro System Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -10,10 +11,7 @@ #include #include -#include #include -#include -#include #include #include @@ -22,7 +20,7 @@ #include #include -#include "StandaloneMmCpu.h" +#include // GUID to identify HOB with whereabouts of communication buffer with Norm= al // World @@ -31,7 +29,7 @@ extern EFI_GUID gEfiStandaloneMmNonSecureBufferGuid; // GUID to identify HOB where the entry point of this CPU driver will be // populated to allow the entry point driver to invoke it upon receipt of = an // event -extern EFI_GUID gEfiArmTfCpuDriverEpDescriptorGuid; +extern EFI_GUID gEfiMmCpuDriverEpDescriptorGuid; // // Private copy of the MM system table for future use @@ -96,17 +94,17 @@ StandaloneMmCpuInitialize ( IN EFI_MM_SYSTEM_TABLE *SystemTable // not actual systemtable ) { - ARM_TF_CPU_DRIVER_EP_DESCRIPTOR *CpuDriverEntryPointDesc; - EFI_CONFIGURATION_TABLE *ConfigurationTable; - MP_INFORMATION_HOB_DATA *MpInformationHobData; - EFI_MMRAM_DESCRIPTOR *NsCommBufMmramRange; - EFI_STATUS Status; - EFI_HANDLE DispatchHandle; - UINT32 MpInfoSize; - UINTN Index; - UINTN ArraySize; - VOID *HobStart; - EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHob; + MM_CPU_DRIVER_EP_DESCRIPTOR *CpuDriverEntryPointDesc; + EFI_CONFIGURATION_TABLE *ConfigurationTable; + MP_INFORMATION_HOB_DATA *MpInformationHobData; + EFI_MMRAM_DESCRIPTOR *NsCommBufMmramRange; + EFI_STATUS Status; + EFI_HANDLE DispatchHandle; + UINT32 MpInfoSize; + UINTN Index; + UINTN ArraySize; + VOID *HobStart; + EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHob; ASSERT (SystemTable !=3D NULL); mMmst =3D SystemTable; @@ -133,7 +131,7 @@ StandaloneMmCpuInitialize ( } // Retrieve the Hoblist from the MMST to extract the details of the NS - // communication buffer that has been reserved by S-EL1/EL3 + // communication buffer that has been reserved for StandaloneMmPkg ConfigurationTable =3D mMmst->MmConfigurationTable; for (Index =3D 0; Index < mMmst->NumberOfTableEntries; Index++) { if (CompareGuid (&gEfiHobListGuid, &(ConfigurationTable[Index].VendorG= uid))) { @@ -154,11 +152,11 @@ StandaloneMmCpuInitialize ( // Status =3D GetGuidedHobData ( HobStart, - &gEfiArmTfCpuDriverEpDescriptorGuid, + &gEfiMmCpuDriverEpDescriptorGuid, (VOID **)&CpuDriverEntryPointDesc ); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "ArmTfCpuDriverEpDesc HOB data extraction failed = - 0x%x\n", Status)); + DEBUG ((DEBUG_ERROR, "MmCpuDriverEpDesc HOB data extraction failed - 0= x%x\n", Status)); return Status; } @@ -166,10 +164,10 @@ StandaloneMmCpuInitialize ( DEBUG (( DEBUG_INFO, "Sharing Cpu Driver EP *0x%lx =3D 0x%lx\n", - (UINTN)CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr, - (UINTN)PiMmStandaloneArmTfCpuDriverEntry + (UINTN)CpuDriverEntryPointDesc->MmCpuDriverEpPtr, + (UINTN)PiMmStandaloneMmCpuDriverEntry )); - *(CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr) =3D PiMmStandaloneArmTfC= puDriverEntry; + *(CpuDriverEntryPointDesc->MmCpuDriverEpPtr) =3D PiMmStandaloneMmCpuDriv= erEntry; // Find the descriptor that contains the whereabouts of the buffer for // communication with the Normal world. diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf b/= StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf index 1fcb17d89d36..486ccbac1b7c 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf @@ -1,9 +1,10 @@ ## @file -# Standalone MM CPU driver for ARM Standard Platforms +# Standalone MM CPU driver # # Copyright (c) 2009, Apple Inc. All rights reserved.
# Copyright (c) 2016 HP Development Company, L.P. # Copyright (c) 2017 - 2021, Arm Limited. All rights reserved. +# Copyright (c) 2023, Ventana Micro System Inc. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent ## @@ -19,18 +20,14 @@ [Sources] StandaloneMmCpu.c - StandaloneMmCpu.h EventHandle.c [Packages] - ArmPkg/ArmPkg.dec MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec StandaloneMmPkg/StandaloneMmPkg.dec [LibraryClasses] - ArmLib - ArmSvcLib BaseMemoryLib DebugLib HobLib @@ -46,7 +43,7 @@ gZeroGuid gMpInformationHobGuid gEfiStandaloneMmNonSecureBufferGuid - gEfiArmTfCpuDriverEpDescriptorGuid + gEfiMmCpuDriverEpDescriptorGuid [Depex] TRUE diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h b/St= andaloneMmPkg/Include/StandaloneMmCpu.h similarity index 82% rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h rename to StandaloneMmPkg/Include/StandaloneMmCpu.h index 3d4698ec1957..1dce7c132ec2 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h +++ b/StandaloneMmPkg/Include/StandaloneMmCpu.h @@ -7,14 +7,26 @@ **/ -#ifndef _ARM_TF_CPU_DRIVER_H_ -#define _ARM_TF_CPU_DRIVER_H_ +#ifndef MM_CPU_DRIVER_H_ +#define MM_CPU_DRIVER_H_ #include #include #include #include +typedef +EFI_STATUS +(*PI_MM_CPU_DRIVER_ENTRYPOINT) ( + IN UINTN EventId, + IN UINTN CpuNumber, + IN UINTN NsCommBufferAddr + ); + +typedef struct { + PI_MM_CPU_DRIVER_ENTRYPOINT *MmCpuDriverEpPtr; +} MM_CPU_DRIVER_EP_DESCRIPTOR; + // // CPU driver initialization specific declarations // @@ -35,7 +47,7 @@ extern MP_INFORMATION_HOB_DATA *mMpInformationHobD= ata; extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig; /** - The PI Standalone MM entry point for the TF-A CPU driver. + The PI Standalone MM entry point for the CPU driver. @param [in] EventId The event Id. @param [in] CpuNumber The CPU number. @@ -48,7 +60,7 @@ extern EFI_MM_CONFIGURATION_PROTOCOL mMmConfig; @retval EFI_UNSUPPORTED Operation not supported. **/ EFI_STATUS -PiMmStandaloneArmTfCpuDriverEntry ( +PiMmStandaloneMmCpuDriverEntry ( IN UINTN EventId, IN UINTN CpuNumber, IN UINTN NsCommBufferAddr @@ -79,4 +91,4 @@ PiMmCpuTpFwRootMmiHandler ( IN OUT UINTN *CommBufferSize OPTIONAL ); -#endif +#endif /* MM_CPU_DRIVER_H_ */ diff --git a/StandaloneMmPkg/StandaloneMmPkg.dec b/StandaloneMmPkg/Standalo= neMmPkg.dec index 46784d94e421..f7cb9e8e2687 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dec +++ b/StandaloneMmPkg/StandaloneMmPkg.dec @@ -46,5 +46,5 @@ gEfiMmPeiMmramMemoryReserveGuid =3D { 0x0703f912, 0xbf8d, 0x4e2= a, { 0xbe, 0x07, 0xab, 0x27, 0x25, 0x25, 0xc5, 0x92 }} gEfiStandaloneMmNonSecureBufferGuid =3D { 0xf00497e3, 0xbfa2, 0x41a= 1, { 0x9d, 0x29, 0x54, 0xc2, 0xe9, 0x37, 0x21, 0xc5 }} - gEfiArmTfCpuDriverEpDescriptorGuid =3D { 0x6ecbd5a1, 0xc0f8, 0x470= 2, { 0x83, 0x01, 0x4f, 0xc2, 0xc5, 0x47, 0x0a, 0x51 }} + gEfiMmCpuDriverEpDescriptorGuid =3D { 0x6ecbd5a1, 0xc0f8, 0x470= 2, { 0x83, 0x01, 0x4f, 0xc2, 0xc5, 0x47, 0x0a, 0x51 }} -- 2.25.1 -=3D-=3D-=3D-=3D-=3D-=3D Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108661): https://edk2.groups.io/g/devel/message/108661 Mute This Topic: https://groups.io/mt/101369646/7717249 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [yeoreum.yun@arm.com] -=3D-=3D-=3D-=3D-=3D-=3D IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109116): https://edk2.groups.io/g/devel/message/109116 Mute This Topic: https://groups.io/mt/101369646/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-