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 E8323740038 for ; Wed, 18 Oct 2023 21:25:17 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=u0FtMxyLLaTscASdgYNniZ9ys+bi6oEyyvl3//+Gtw0=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20140610; t=1697664316; v=1; b=Gylrl8Zm3oL4c8HHJkmnvf60wHU66irBZ0OudNe2GkwzpYCz51mUC25cA58D6aVsQzuQhVni UnbRKjn8+rQUcSEdeZIo8CbAYNZCbTynlqQUJC7OLSxlroKo+Pw5e+qpCC5Ymw1yoMQuMu1v5Pu EldsEEQaPoxynnKFeiNiJy9k= X-Received: by 127.0.0.2 with SMTP id YkdGYY7687511xeHSBLv1Y1G; Wed, 18 Oct 2023 14:25:16 -0700 X-Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) by mx.groups.io with SMTP id smtpd.web10.13237.1697664315850560870 for ; Wed, 18 Oct 2023 14:25:16 -0700 X-Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6cd0a8590cdso502276a34.2 for ; Wed, 18 Oct 2023 14:25:15 -0700 (PDT) X-Gm-Message-State: cktIyTAcZWI7BdgGWx8GS6lax7686176AA= X-Google-Smtp-Source: AGHT+IEM74BLayMrHXZSONtMTtvgRUEJN7Sj5lPdpK5gIUwnqNpg5jiMv7HpWNvi74fqEt+kAyMxKg== X-Received: by 2002:a05:6870:3d89:b0:1e9:d830:160b with SMTP id lm9-20020a0568703d8900b001e9d830160bmr662299oab.10.1697664314970; Wed, 18 Oct 2023 14:25:14 -0700 (PDT) X-Received: from PH7PR10MB6335.namprd10.prod.outlook.com ([2603:1036:30c:842::5]) by smtp.gmail.com with ESMTPSA id b9-20020a655789000000b0058901200bbbsm1896448pgr.40.2023.10.18.14.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 14:25:14 -0700 (PDT) From: "Tuan Phan" To: Sami Mujawar , "devel@edk2.groups.io" CC: "ardb+tianocore@kernel.org" , "ray.ni@intel.com" , "huangming@linux.alibaba.com" , "sunilvl@ventanamicro.com" , "yong.li@intel.com" , "yeoreum.yun@arm.com" , "nd@arm.com" Subject: Re: [edk2-devel] [PATCH v3 2/2] StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver Thread-Topic: [PATCH v3 2/2] StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver Thread-Index: AQHZ8lC+f26KamV+UUCyN7B9cHUDCbA7FNwAgBUZg9I= X-MS-Exchange-MessageSentRepresentingType: 1 Date: Wed, 18 Oct 2023 21:25:13 +0000 Message-ID: References: <20230928211404.27533-1-tphan@ventanamicro.com> <20230928211404.27533-3-tphan@ventanamicro.com> <8d8857ee-5a0e-6a1d-3ede-564e3c49092c@arm.com> In-Reply-To: <8d8857ee-5a0e-6a1d-3ede-564e3c49092c@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-Exchange-Organization-SCL: -1 X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 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 Reply-To: devel@edk2.groups.io,tphan@ventanamicro.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_PH7PR10MB63358508AB8FC50C1C4785EAA7D5APH7PR10MB6335namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Gylrl8Zm; dmarc=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 --_000_PH7PR10MB63358508AB8FC50C1C4785EAA7D5APH7PR10MB6335namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Sami, Not sure if you can merge this series or let me know who can do it. Thanks, From: Sami Mujawar Date: Thursday, October 5, 2023 at 4:12 AM To: Tuan Phan , devel@edk2.groups.io Cc: ardb+tianocore@kernel.org , ray.ni@intel.com= , huangming@linux.alibaba.com , sunilvl@ventanamicro.com , yong.li@intel.com= , yeoreum.yun@arm.com , nd@arm.com= Subject: Re: [PATCH v3 2/2] StandaloneMmPkg: Arm: Update to use the new Sta= ndaloneMmCpu driver Hi Tuan, Thank you for this patch. These changes look good to me. Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 28/09/2023 10:14 pm, Tuan Phan wrote: > Update entry point library for Arm to use the new architecture independen= t > StandaloneMmCpu driver. > > Signed-off-by: Tuan Phan > Reviewed-by: levi.yun > --- > .../Library/Arm/StandaloneMmCoreEntryPoint.h | 17 +---- > .../Arm/CreateHobList.c | 43 ++++++------ > .../Arm/StandaloneMmCoreEntryPoint.c | 69 +++++++++++-------- > .../StandaloneMmCoreEntryPoint.inf | 2 +- > 4 files changed, 67 insertions(+), 64 deletions(-) > > diff --git a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoi= nt.h b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h > index 41bf0f132b4f..dbb81610ff8e 100644 > --- a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h > +++ b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h > @@ -10,6 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #ifndef __STANDALONEMMCORE_ENTRY_POINT_H__ > > #define __STANDALONEMMCORE_ENTRY_POINT_H__ > > > > +#include > > #include > > #include > > > > @@ -47,18 +48,6 @@ typedef struct { > EFI_SECURE_PARTITION_CPU_INFO *CpuInfo; > > } EFI_SECURE_PARTITION_BOOT_INFO; > > > > -typedef > > -EFI_STATUS > > -(*PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT) ( > > - IN UINTN EventId, > > - IN UINTN CpuNumber, > > - IN UINTN NsCommBufferAddr > > - ); > > - > > -typedef struct { > > - PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT *ArmTfCpuDriverEpPtr; > > -} ARM_TF_CPU_DRIVER_EP_DESCRIPTOR; > > - > > typedef RETURN_STATUS (*REGION_PERMISSION_UPDATE_FUNC) ( > > IN EFI_PHYSICAL_ADDRESS BaseAddress, > > IN UINT64 Length > > @@ -145,8 +134,8 @@ LocateStandaloneMmCorePeCoffData ( > VOID * > > EFIAPI > > CreateHobListFromBootInfo ( > > - IN OUT PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT *CpuDriverEntryPoint, > > - IN EFI_SECURE_PARTITION_BOOT_INFO *PayloadBootInfo > > + IN OUT PI_MM_CPU_DRIVER_ENTRYPOINT *CpuDriverEntryPoint, > > + IN EFI_SECURE_PARTITION_BOOT_INFO *PayloadBootInfo > > ); > > > > /** > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Creat= eHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateH= obList.c > index 2ac2d354f06a..80ed532352af 100644 > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobLis= t.c > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobLis= t.c > @@ -13,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include > > #include > > > > +#include > > #include > > #include > > #include > > @@ -39,7 +40,7 @@ extern EFI_GUID gEfiStandaloneMmNonSecureBufferGuid; > // GUID to identify HOB where the entry point of the CPU driver will be > > // populated to allow this entry point driver to invoke it upon receipt= of an > > // event > > -extern EFI_GUID gEfiArmTfCpuDriverEpDescriptorGuid; > > +extern EFI_GUID gEfiMmCpuDriverEpDescriptorGuid; > > > > /** > > Use the boot information passed by privileged firmware to populate a = HOB list > > @@ -52,22 +53,22 @@ extern EFI_GUID gEfiArmTfCpuDriverEpDescriptorGuid; > **/ > > VOID * > > CreateHobListFromBootInfo ( > > - IN OUT PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT *CpuDriverEntryPoint, > > - IN EFI_SECURE_PARTITION_BOOT_INFO *PayloadBootInfo > > + IN OUT PI_MM_CPU_DRIVER_ENTRYPOINT *CpuDriverEntryPoint, > > + IN EFI_SECURE_PARTITION_BOOT_INFO *PayloadBootInfo > > ) > > { > > - EFI_HOB_HANDOFF_INFO_TABLE *HobStart; > > - EFI_RESOURCE_ATTRIBUTE_TYPE Attributes; > > - UINT32 Index; > > - UINT32 BufferSize; > > - UINT32 Flags; > > - EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHob; > > - EFI_MMRAM_DESCRIPTOR *MmramRanges; > > - EFI_MMRAM_DESCRIPTOR *NsCommBufMmramRange; > > - MP_INFORMATION_HOB_DATA *MpInformationHobData; > > - EFI_PROCESSOR_INFORMATION *ProcInfoBuffer; > > - EFI_SECURE_PARTITION_CPU_INFO *CpuInfo; > > - ARM_TF_CPU_DRIVER_EP_DESCRIPTOR *CpuDriverEntryPointDesc; > > + EFI_HOB_HANDOFF_INFO_TABLE *HobStart; > > + EFI_RESOURCE_ATTRIBUTE_TYPE Attributes; > > + UINT32 Index; > > + UINT32 BufferSize; > > + UINT32 Flags; > > + EFI_MMRAM_HOB_DESCRIPTOR_BLOCK *MmramRangesHob; > > + EFI_MMRAM_DESCRIPTOR *MmramRanges; > > + EFI_MMRAM_DESCRIPTOR *NsCommBufMmramRange; > > + MP_INFORMATION_HOB_DATA *MpInformationHobData; > > + EFI_PROCESSOR_INFORMATION *ProcInfoBuffer; > > + EFI_SECURE_PARTITION_CPU_INFO *CpuInfo; > > + MM_CPU_DRIVER_EP_DESCRIPTOR *CpuDriverEntryPointDesc; > > > > // Create a hoblist with a PHIT and EOH > > HobStart =3D HobConstructor ( > > @@ -144,13 +145,13 @@ CreateHobListFromBootInfo ( > > > // Create a Guided HOB to enable the ARM TF CPU driver to share its e= ntry > > // point and populate it with the address of the shared buffer > > - CpuDriverEntryPointDesc =3D (ARM_TF_CPU_DRIVER_EP_DESCRIPTOR *)BuildGu= idHob ( > > - &gEfiAr= mTfCpuDriverEpDescriptorGuid, > > - sizeof = (ARM_TF_CPU_DRIVER_EP_DESCRIPTOR) > > - ); > > + CpuDriverEntryPointDesc =3D (MM_CPU_DRIVER_EP_DESCRIPTOR *)BuildGuidHo= b ( > > + &gEfiMmCpuD= riverEpDescriptorGuid, > > + sizeof (MM_= CPU_DRIVER_EP_DESCRIPTOR) > > + ); > > > > - *CpuDriverEntryPoint =3D NULL; > > - CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr =3D CpuDriverEntryPoint; > > + *CpuDriverEntryPoint =3D NULL; > > + CpuDriverEntryPointDesc->MmCpuDriverEpPtr =3D CpuDriverEntryPoint; > > > > // Find the size of the GUIDed HOB with SRAM ranges > > BufferSize =3D sizeof (EFI_MMRAM_HOB_DESCRIPTOR_BLOCK); > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Stand= aloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoin= t/Arm/StandaloneMmCoreEntryPoint.c > index 96de10405af8..70306be2495e 100644 > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMm= CoreEntryPoint.c > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMm= CoreEntryPoint.c > @@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #include > > #include > > > > +#include > > #include > > #include > > #include > > @@ -41,7 +42,7 @@ STATIC CONST UINT32 mSpmMinorVerFfa =3D SPM_MINOR_VERS= ION_FFA; > > > #define BOOT_PAYLOAD_VERSION 1 > > > > -PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT CpuDriverEntryPoint =3D NULL; > > +PI_MM_CPU_DRIVER_ENTRYPOINT CpuDriverEntryPoint =3D NULL; > > > > /** > > Retrieve a pointer to and print the boot information passed by privil= eged > > @@ -140,34 +141,46 @@ DelegatedEventLoop ( > DEBUG ((DEBUG_INFO, "X6 : 0x%x\n", (UINT32)EventCompleteSvcArgs->A= rg6)); > > DEBUG ((DEBUG_INFO, "X7 : 0x%x\n", (UINT32)EventCompleteSvcArgs->A= rg7)); > > > > - FfaEnabled =3D FeaturePcdGet (PcdFfaEnable); > > - if (FfaEnabled) { > > - Status =3D CpuDriverEntryPoint ( > > - EventCompleteSvcArgs->Arg0, > > - EventCompleteSvcArgs->Arg6, > > - EventCompleteSvcArgs->Arg3 > > - ); > > - if (EFI_ERROR (Status)) { > > - DEBUG (( > > - DEBUG_ERROR, > > - "Failed delegated event 0x%x, Status 0x%x\n", > > - EventCompleteSvcArgs->Arg3, > > - Status > > - )); > > - } > > + // > > + // ARM TF passes SMC FID of the MM_COMMUNICATE interface as the Even= t ID upon > > + // receipt of a synchronous MM request. Use the Event ID to distingu= ish > > + // between synchronous and asynchronous events. > > + // > > + if ((ARM_SMC_ID_MM_COMMUNICATE !=3D (UINT32)EventCompleteSvcArgs->Ar= g0) && > > + (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ !=3D (UINT32)EventCompleteSv= cArgs->Arg0)) > > + { > > + DEBUG ((DEBUG_ERROR, "UnRecognized Event - 0x%x\n", (UINT32)EventC= ompleteSvcArgs->Arg0)); > > + Status =3D EFI_INVALID_PARAMETER; > > } else { > > - Status =3D CpuDriverEntryPoint ( > > - EventCompleteSvcArgs->Arg0, > > - EventCompleteSvcArgs->Arg3, > > - EventCompleteSvcArgs->Arg1 > > - ); > > - if (EFI_ERROR (Status)) { > > - DEBUG (( > > - DEBUG_ERROR, > > - "Failed delegated event 0x%x, Status 0x%x\n", > > - EventCompleteSvcArgs->Arg0, > > - Status > > - )); > > + FfaEnabled =3D FeaturePcdGet (PcdFfaEnable); > > + if (FfaEnabled) { > > + Status =3D CpuDriverEntryPoint ( > > + EventCompleteSvcArgs->Arg0, > > + EventCompleteSvcArgs->Arg6, > > + EventCompleteSvcArgs->Arg3 > > + ); > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "Failed delegated event 0x%x, Status 0x%x\n", > > + EventCompleteSvcArgs->Arg3, > > + Status > > + )); > > + } > > + } else { > > + Status =3D CpuDriverEntryPoint ( > > + EventCompleteSvcArgs->Arg0, > > + EventCompleteSvcArgs->Arg3, > > + EventCompleteSvcArgs->Arg1 > > + ); > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "Failed delegated event 0x%x, Status 0x%x\n", > > + EventCompleteSvcArgs->Arg0, > > + Status > > + )); > > + } > > } > > } > > > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Standalon= eMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/= StandaloneMmCoreEntryPoint.inf > index 75cfb98c0e75..d41d7630b614 100644 > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCore= EntryPoint.inf > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCore= EntryPoint.inf > @@ -49,7 +49,7 @@ > gMpInformationHobGuid > > gEfiMmPeiMmramMemoryReserveGuid > > gEfiStandaloneMmNonSecureBufferGuid > > - gEfiArmTfCpuDriverEpDescriptorGuid > > + gEfiMmCpuDriverEpDescriptorGuid > > > > [FeaturePcd.ARM, FeaturePcd.AARCH64] > > gArmTokenSpaceGuid.PcdFfaEnable > -=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 (#109769): https://edk2.groups.io/g/devel/message/109769 Mute This Topic: https://groups.io/mt/101646679/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- --_000_PH7PR10MB63358508AB8FC50C1C4785EAA7D5APH7PR10MB6335namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi Sami,
Not sure if you can merge this series or let me know who can do it.

Thanks,

From: Sami Mujawar <sami.mujawar= @arm.com>
Date: Thursday, October 5, 2023 at = 4:12 AM
To: Tuan Phan <tphan@ventanamicr= o.com>, devel@edk2.groups.io <devel@edk2.groups.io>
Cc: ardb+tianocore@kernel.org <a= rdb+tianocore@kernel.org>, ray.ni@intel.com <ray.ni@intel.com>, hu= angming@linux.alibaba.com <huangming@linux.alibaba.com>, sunilvl@vent= anamicro.com <sunilvl@ventanamicro.com>, yong.li@intel.com <yong.li@intel.com>, yeoreum.yun@arm.com <yeoreum.yun@arm.com>= , nd@arm.com <nd@arm.com>
Subject: Re: [PATCH v3 2/2] Standal= oneMmPkg: Arm: Update to use the new StandaloneMmCpu driver

Hi Tuan,

Thank you for this patch.

These changes look good to me.

Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>

Regards,

Sami Mujawar

On 28/09/2023 10:14 pm, Tuan Phan wrote:
> Update entry point library for Arm to use the new architecture indepen= dent
> StandaloneMmCpu driver.
>
> Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
> Reviewed-by: levi.yun <yeoreum.yun@arm.com>
> ---
>   .../Library/Arm/StandaloneMmCoreEntryPoint.h  | 17 +-= ---
>   .../Arm/CreateHobList.c      = ;            &n= bsp;    | 43 ++++++------
>   .../Arm/StandaloneMmCoreEntryPoint.c   &nbs= p;      | 69 +++++++++++--------
>   .../StandaloneMmCoreEntryPoint.inf    =         |  2 +-
>   4 files changed, 67 insertions(+), 64 deletions(-)
>
> diff --git a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntry= Point.h b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h<= br> > index 41bf0f132b4f..dbb81610ff8e 100644
> --- a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h=
> +++ b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h=
> @@ -10,6 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>   #ifndef __STANDALONEMMCORE_ENTRY_POINT_H__
>
>   #define __STANDALONEMMCORE_ENTRY_POINT_H__
>
>  
>
> +#include <StandaloneMmCpu.h>
>
>   #include <Library/PeCoffLib.h>
>
>   #include <Library/FvLib.h>
>
>  
>
> @@ -47,18 +48,6 @@ typedef struct {
>     EFI_SECURE_PARTITION_CPU_INFO   = ; *CpuInfo;
>
>   } EFI_SECURE_PARTITION_BOOT_INFO;
>
>  
>
> -typedef
>
> -EFI_STATUS
>
> -(*PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT) (
>
> -  IN UINTN  EventId,
>
> -  IN UINTN  CpuNumber,
>
> -  IN UINTN  NsCommBufferAddr
>
> -  );
>
> -
>
> -typedef struct {
>
> -  PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT    *ArmTfCpu= DriverEpPtr;
>
> -} ARM_TF_CPU_DRIVER_EP_DESCRIPTOR;
>
> -
>
>   typedef RETURN_STATUS (*REGION_PERMISSION_UPDATE_FUNC) ( >
>     IN  EFI_PHYSICAL_ADDRESS  BaseAddres= s,
>
>     IN  UINT64     &= nbsp;          Length
>
> @@ -145,8 +134,8 @@ LocateStandaloneMmCorePeCoffData (
>   VOID *
>
>   EFIAPI
>
>   CreateHobListFromBootInfo (
>
> -  IN  OUT  PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT  *C= puDriverEntryPoint,
>
> -  IN       EFI_SECURE_PARTITION_BO= OT_INFO      *PayloadBootInfo
>
> +  IN  OUT  PI_MM_CPU_DRIVER_ENTRYPOINT  &nbs= p;  *CpuDriverEntryPoint,
>
> +  IN       EFI_SECURE_PARTITION_BO= OT_INFO  *PayloadBootInfo
>
>     );
>
>  
>
>   /**
>
> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Cr= eateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Crea= teHobList.c
> index 2ac2d354f06a..80ed532352af 100644
> --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHob= List.c
> +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHob= List.c
> @@ -13,6 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>   #include <Guid/MmramMemoryReserve.h>
>
>   #include <Guid/MpInformation.h>
>
>  
>
> +#include <StandaloneMmCpu.h>
>
>   #include <Library/Arm/StandaloneMmCoreEntryPoint.h><= br> >
>   #include <Library/ArmMmuLib.h>
>
>   #include <Library/ArmSvcLib.h>
>
> @@ -39,7 +40,7 @@ extern EFI_GUID  gEfiStandaloneMmNonSecureBuffe= rGuid;
>   // GUID to identify HOB where the entry point of the CPU d= river will be
>
>   // populated to allow this entry point driver to invoke it= upon receipt of an
>
>   // event
>
> -extern EFI_GUID  gEfiArmTfCpuDriverEpDescriptorGuid;
>
> +extern EFI_GUID  gEfiMmCpuDriverEpDescriptorGuid;
>
>  
>
>   /**
>
>     Use the boot information passed by privileged = firmware to populate a HOB list
>
> @@ -52,22 +53,22 @@ extern EFI_GUID  gEfiArmTfCpuDriverEpDescript= orGuid;
>   **/
>
>   VOID *
>
>   CreateHobListFromBootInfo (
>
> -  IN  OUT  PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT  *C= puDriverEntryPoint,
>
> -  IN       EFI_SECURE_PARTITION_BO= OT_INFO      *PayloadBootInfo
>
> +  IN  OUT  PI_MM_CPU_DRIVER_ENTRYPOINT  &nbs= p;  *CpuDriverEntryPoint,
>
> +  IN       EFI_SECURE_PARTITION_BO= OT_INFO  *PayloadBootInfo
>
>     )
>
>   {
>
> -  EFI_HOB_HANDOFF_INFO_TABLE      = *HobStart;
>
> -  EFI_RESOURCE_ATTRIBUTE_TYPE      Attr= ibutes;
>
> -  UINT32         &n= bsp;            = ;     Index;
>
> -  UINT32         &n= bsp;            = ;     BufferSize;
>
> -  UINT32         &n= bsp;            = ;     Flags;
>
> -  EFI_MMRAM_HOB_DESCRIPTOR_BLOCK   *MmramRangesHob; >
> -  EFI_MMRAM_DESCRIPTOR       =       *MmramRanges;
>
> -  EFI_MMRAM_DESCRIPTOR       =       *NsCommBufMmramRange;
>
> -  MP_INFORMATION_HOB_DATA      &nb= sp;   *MpInformationHobData;
>
> -  EFI_PROCESSOR_INFORMATION      &= nbsp; *ProcInfoBuffer;
>
> -  EFI_SECURE_PARTITION_CPU_INFO    *CpuInfo;
>
> -  ARM_TF_CPU_DRIVER_EP_DESCRIPTOR  *CpuDriverEntryPointDesc= ;
>
> +  EFI_HOB_HANDOFF_INFO_TABLE      *HobS= tart;
>
> +  EFI_RESOURCE_ATTRIBUTE_TYPE     Attributes= ;
>
> +  UINT32         &n= bsp;            = ;    Index;
>
> +  UINT32         &n= bsp;            = ;    BufferSize;
>
> +  UINT32         &n= bsp;            = ;    Flags;
>
> +  EFI_MMRAM_HOB_DESCRIPTOR_BLOCK  *MmramRangesHob;
>
> +  EFI_MMRAM_DESCRIPTOR       =      *MmramRanges;
>
> +  EFI_MMRAM_DESCRIPTOR       =      *NsCommBufMmramRange;
>
> +  MP_INFORMATION_HOB_DATA      &nb= sp;  *MpInformationHobData;
>
> +  EFI_PROCESSOR_INFORMATION       = *ProcInfoBuffer;
>
> +  EFI_SECURE_PARTITION_CPU_INFO   *CpuInfo;
>
> +  MM_CPU_DRIVER_EP_DESCRIPTOR     *CpuDriver= EntryPointDesc;
>
>  
>
>     // Create a hoblist with a PHIT and EOH
>
>     HobStart =3D HobConstructor (
>
> @@ -144,13 +145,13 @@ CreateHobListFromBootInfo (
>  
>
>     // Create a Guided HOB to enable the ARM TF CP= U driver to share its entry
>
>     // point and populate it with the address of t= he shared buffer
>
> -  CpuDriverEntryPointDesc =3D (ARM_TF_CPU_DRIVER_EP_DESCRIPTOR *= )BuildGuidHob (
>
> -           &nb= sp;            =             &nb= sp;            =             &nb= sp;   &gEfiArmTfCpuDriverEpDescriptorGuid,
>
> -           &nb= sp;            =             &nb= sp;            =             &nb= sp;   sizeof (ARM_TF_CPU_DRIVER_EP_DESCRIPTOR)
>
> -           &nb= sp;            =             &nb= sp;            =             &nb= sp;   );
>
> +  CpuDriverEntryPointDesc =3D (MM_CPU_DRIVER_EP_DESCRIPTOR *)Bui= ldGuidHob (
>
> +           &nb= sp;            =             &nb= sp;            =             &gEf= iMmCpuDriverEpDescriptorGuid,
>
> +           &nb= sp;            =             &nb= sp;            =             sizeof (= MM_CPU_DRIVER_EP_DESCRIPTOR)
>
> +           &nb= sp;            =             &nb= sp;            =             );
>
>  
>
> -  *CpuDriverEntryPoint       =             &nb= sp;     =3D NULL;
>
> -  CpuDriverEntryPointDesc->ArmTfCpuDriverEpPtr =3D CpuDriverE= ntryPoint;
>
> +  *CpuDriverEntryPoint       =             &nb= sp;  =3D NULL;
>
> +  CpuDriverEntryPointDesc->MmCpuDriverEpPtr =3D CpuDriverEntr= yPoint;
>
>  
>
>     // Find the size of the GUIDed HOB with SRAM r= anges
>
>     BufferSize  =3D sizeof (EFI_MMRAM_HOB_DES= CRIPTOR_BLOCK);
>
> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/St= andaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryP= oint/Arm/StandaloneMmCoreEntryPoint.c
> index 96de10405af8..70306be2495e 100644
> --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Standalon= eMmCoreEntryPoint.c
> +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Standalon= eMmCoreEntryPoint.c
> @@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
>   #include <Guid/MmramMemoryReserve.h>
>
>   #include <Guid/MpInformation.h>
>
>  
>
> +#include <StandaloneMmCpu.h>
>
>   #include <Library/ArmSvcLib.h>
>
>   #include <Library/DebugLib.h>
>
>   #include <Library/HobLib.h>
>
> @@ -41,7 +42,7 @@ STATIC CONST UINT32  mSpmMinorVerFfa =3D SPM_MI= NOR_VERSION_FFA;
>  
>
>   #define BOOT_PAYLOAD_VERSION  1
>
>  
>
> -PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT  CpuDriverEntryPoint =3D NULL= ;
>
> +PI_MM_CPU_DRIVER_ENTRYPOINT  CpuDriverEntryPoint =3D NULL;
>
>  
>
>   /**
>
>     Retrieve a pointer to and print the boot infor= mation passed by privileged
>
> @@ -140,34 +141,46 @@ DelegatedEventLoop (
>       DEBUG ((DEBUG_INFO, "X6 :&nbs= p; 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg6));
>
>       DEBUG ((DEBUG_INFO, "X7 :&nbs= p; 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg7));
>
>  
>
> -    FfaEnabled =3D FeaturePcdGet (PcdFfaEnable);
>
> -    if (FfaEnabled) {
>
> -      Status =3D CpuDriverEntryPoint (
>
> -           &nb= sp;     EventCompleteSvcArgs->Arg0,
>
> -           &nb= sp;     EventCompleteSvcArgs->Arg6,
>
> -           &nb= sp;     EventCompleteSvcArgs->Arg3
>
> -           &nb= sp;     );
>
> -      if (EFI_ERROR (Status)) {
>
> -        DEBUG ((
>
> -          DEBUG_ERROR, >
> -          "Failed d= elegated event 0x%x, Status 0x%x\n",
>
> -          EventCompleteS= vcArgs->Arg3,
>
> -          Status
>
> -          ));
>
> -      }
>
> +    //
>
> +    // ARM TF passes SMC FID of the MM_COMMUNICATE int= erface as the Event ID upon
>
> +    // receipt of a synchronous MM request. Use the Ev= ent ID to distinguish
>
> +    // between synchronous and asynchronous events. >
> +    //
>
> +    if ((ARM_SMC_ID_MM_COMMUNICATE !=3D (UINT32)EventC= ompleteSvcArgs->Arg0) &&
>
> +        (ARM_SVC_ID_FFA_MSG_SEND_D= IRECT_REQ !=3D (UINT32)EventCompleteSvcArgs->Arg0))
>
> +    {
>
> +      DEBUG ((DEBUG_ERROR, "UnRecognize= d Event - 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg0));
>
> +      Status =3D EFI_INVALID_PARAMETER;
>
>       } else {
>
> -      Status =3D CpuDriverEntryPoint (
>
> -           &nb= sp;     EventCompleteSvcArgs->Arg0,
>
> -           &nb= sp;     EventCompleteSvcArgs->Arg3,
>
> -           &nb= sp;     EventCompleteSvcArgs->Arg1
>
> -           &nb= sp;     );
>
> -      if (EFI_ERROR (Status)) {
>
> -        DEBUG ((
>
> -          DEBUG_ERROR, >
> -          "Failed d= elegated event 0x%x, Status 0x%x\n",
>
> -          EventCompleteS= vcArgs->Arg0,
>
> -          Status
>
> -          ));
>
> +      FfaEnabled =3D FeaturePcdGet (PcdFfaEn= able);
>
> +      if (FfaEnabled) {
>
> +        Status =3D CpuDriverEntryP= oint (
>
> +           &nb= sp;       EventCompleteSvcArgs->Arg0,
>
> +           &nb= sp;       EventCompleteSvcArgs->Arg6,
>
> +           &nb= sp;       EventCompleteSvcArgs->Arg3
>
> +           &nb= sp;       );
>
> +        if (EFI_ERROR (Status)) {<= br> >
> +          DEBUG ((
>
> +            DE= BUG_ERROR,
>
> +            &q= uot;Failed delegated event 0x%x, Status 0x%x\n",
>
> +            Ev= entCompleteSvcArgs->Arg3,
>
> +            St= atus
>
> +            ))= ;
>
> +        }
>
> +      } else {
>
> +        Status =3D CpuDriverEntryP= oint (
>
> +           &nb= sp;       EventCompleteSvcArgs->Arg0,
>
> +           &nb= sp;       EventCompleteSvcArgs->Arg3,
>
> +           &nb= sp;       EventCompleteSvcArgs->Arg1
>
> +           &nb= sp;       );
>
> +        if (EFI_ERROR (Status)) {<= br> >
> +          DEBUG ((
>
> +            DE= BUG_ERROR,
>
> +            &q= uot;Failed delegated event 0x%x, Status 0x%x\n",
>
> +            Ev= entCompleteSvcArgs->Arg0,
>
> +            St= atus
>
> +            ))= ;
>
> +        }
>
>         }
>
>       }
>
>  
>
> diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Standa= loneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoi= nt/StandaloneMmCoreEntryPoint.inf
> index 75cfb98c0e75..d41d7630b614 100644
> --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmC= oreEntryPoint.inf
> +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmC= oreEntryPoint.inf
> @@ -49,7 +49,7 @@
>     gMpInformationHobGuid
>
>     gEfiMmPeiMmramMemoryReserveGuid
>
>     gEfiStandaloneMmNonSecureBufferGuid
>
> -  gEfiArmTfCpuDriverEpDescriptorGuid
>
> +  gEfiMmCpuDriverEpDescriptorGuid
>
>  
>
>   [FeaturePcd.ARM, FeaturePcd.AARCH64]
>
>     gArmTokenSpaceGuid.PcdFfaEnable
>
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#109769) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_PH7PR10MB63358508AB8FC50C1C4785EAA7D5APH7PR10MB6335namp_--