[edk2,08/10] StandaloneMmPkg/Core: drop support for dispatching FVs into MM

Message ID 20190305133248.4828-9-ard.biesheuvel@linaro.org
State New
Headers show
Series
  • StandaloneMmPkg, ArmPkg: cleanups and improvements
Related show

Commit Message

Ard Biesheuvel March 5, 2019, 1:32 p.m.
Remove the support that permits calls into the MM context to dispatch
firmware volumes that are not part of the initial standalone MM firmware
volume.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 StandaloneMmPkg/Core/StandaloneMmCore.h | 22 ----------
 StandaloneMmPkg/Core/Dispatcher.c       | 46 --------------------
 StandaloneMmPkg/Core/StandaloneMmCore.c |  1 -
 3 files changed, 69 deletions(-)

-- 
2.20.1

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Yao, Jiewen March 5, 2019, 3:51 p.m. | #1
Reviewed-by: jiewen.yao@intel.com


> -----Original Message-----

> From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org]

> Sent: Tuesday, March 5, 2019 5:33 AM

> To: edk2-devel@lists.01.org

> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>; Achin Gupta

> <achin.gupta@arm.com>; Supreeth Venkatesh

> <supreeth.venkatesh@arm.com>; Yao, Jiewen <jiewen.yao@intel.com>;

> Leif Lindholm <leif.lindholm@linaro.org>; Jagadeesh Ujja

> <jagadeesh.ujja@arm.com>

> Subject: [PATCH 08/10] StandaloneMmPkg/Core: drop support for

> dispatching FVs into MM

> 

> Remove the support that permits calls into the MM context to dispatch

> firmware volumes that are not part of the initial standalone MM firmware

> volume.

> 

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  StandaloneMmPkg/Core/StandaloneMmCore.h | 22 ----------

>  StandaloneMmPkg/Core/Dispatcher.c       | 46 --------------------

>  StandaloneMmPkg/Core/StandaloneMmCore.c |  1 -

>  3 files changed, 69 deletions(-)

> 

> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h

> b/StandaloneMmPkg/Core/StandaloneMmCore.h

> index 0d20bcaa6be5..74338dc9da0d 100644

> --- a/StandaloneMmPkg/Core/StandaloneMmCore.h

> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.h

> @@ -635,28 +635,6 @@ MmDriverDispatchHandler (

> 

>    @return Status Code

> 

> -**/

> -EFI_STATUS

> -EFIAPI

> -MmFvDispatchHandler (

> -  IN     EFI_HANDLE               DispatchHandle,

> -  IN     CONST VOID               *Context,        OPTIONAL

> -  IN OUT VOID                     *CommBuffer,     OPTIONAL

> -  IN OUT UINTN                    *CommBufferSize  OPTIONAL

> -  );

> -

> -/**

> -  This function is the main entry point for an MM handler dispatch

> -  or communicate-based callback.

> -

> -  @param  DispatchHandle  The unique handle assigned to this handler

> by MmiHandlerRegister().

> -  @param  Context         Points to an optional handler context

> which was specified when the handler was registered.

> -  @param  CommBuffer      A pointer to a collection of data in

> memory that will

> -                          be conveyed from a non-MM environment

> into an MM environment.

> -  @param  CommBufferSize  The size of the CommBuffer.

> -

> -  @return Status Code

> -

>  **/

>  EFI_STATUS

>  EFIAPI

> diff --git a/StandaloneMmPkg/Core/Dispatcher.c

> b/StandaloneMmPkg/Core/Dispatcher.c

> index bede4832cfb7..4b2f38f700a0 100644

> --- a/StandaloneMmPkg/Core/Dispatcher.c

> +++ b/StandaloneMmPkg/Core/Dispatcher.c

> @@ -883,52 +883,6 @@ MmAddToDriverList (

>    return EFI_SUCCESS;

>  }

> 

> -/**

> -  This function is the main entry point for an MM handler dispatch

> -  or communicate-based callback.

> -

> -  @param  DispatchHandle  The unique handle assigned to this handler

> by SmiHandlerRegister().

> -  @param  Context         Points to an optional handler context

> which was specified when the handler was registered.

> -  @param  CommBuffer      A pointer to a collection of data in

> memory that will

> -                          be conveyed from a non-MM environment

> into an MM environment.

> -  @param  CommBufferSize  The size of the CommBuffer.

> -

> -  @return Status Code

> -

> -**/

> -EFI_STATUS

> -EFIAPI

> -MmFvDispatchHandler (

> -  IN     EFI_HANDLE               DispatchHandle,

> -  IN     CONST VOID               *Context,        OPTIONAL

> -  IN OUT VOID                     *CommBuffer,     OPTIONAL

> -  IN OUT UINTN                    *CommBufferSize  OPTIONAL

> -  )

> -{

> -  EFI_STATUS                            Status;

> -  EFI_MM_COMMUNICATE_FV_DISPATCH_DATA

> *CommunicationFvDispatchData;

> -  EFI_FIRMWARE_VOLUME_HEADER            *FwVolHeader;

> -

> -  DEBUG ((DEBUG_INFO, "MmFvDispatchHandler\n"));

> -

> -  CommunicationFvDispatchData = CommBuffer;

> -

> -  DEBUG ((DEBUG_INFO, "  Dispatch - 0x%016lx - 0x%016lx\n",

> CommunicationFvDispatchData->Address,

> -          CommunicationFvDispatchData->Size));

> -

> -  FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER

> *)(UINTN)CommunicationFvDispatchData->Address;

> -

> -  MmCoreFfsFindMmDriver (FwVolHeader);

> -

> -  //

> -  // Execute the MM Dispatcher on any newly discovered FVs and

> previously

> -  // discovered MM drivers that have been discovered but not dispatched.

> -  //

> -  Status = MmDispatcher ();

> -

> -  return Status;

> -}

> -

>  /**

>    Traverse the discovered list for any drivers that were discovered but not

> loaded

>    because the dependency experessions evaluated to false.

> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c

> b/StandaloneMmPkg/Core/StandaloneMmCore.c

> index ec53b8d8bec4..766cdb5c848c 100644

> --- a/StandaloneMmPkg/Core/StandaloneMmCore.c

> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c

> @@ -99,7 +99,6 @@ BOOLEAN  mInLegacyBoot = FALSE;

>  // Table of MMI Handlers that are registered by the MM Core when it is

> initialized

>  //

>  MM_CORE_MMI_HANDLERS  mMmCoreMmiHandlers[] = {

> -  { MmFvDispatchHandler,     &gMmFvDispatchGuid,

> NULL, TRUE  },

>    { MmReadyToLockHandler,    &gEfiDxeMmReadyToLockProtocolGuid,

> NULL, TRUE  },

>    { MmEndOfDxeHandler,       &gEfiEndOfDxeEventGroupGuid,

> NULL, FALSE },

>    { MmLegacyBootHandler,     &gEfiEventLegacyBootGuid,

> NULL, FALSE },

> --

> 2.20.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Achin Gupta March 6, 2019, 4:58 p.m. | #2
Reviewed-by: achin.gupta@arm.com


On Tue, Mar 05, 2019 at 02:32:46PM +0100, Ard Biesheuvel wrote:
> Remove the support that permits calls into the MM context to dispatch

> firmware volumes that are not part of the initial standalone MM firmware

> volume.

>

> Contributed-under: TianoCore Contribution Agreement 1.1

> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---

>  StandaloneMmPkg/Core/StandaloneMmCore.h | 22 ----------

>  StandaloneMmPkg/Core/Dispatcher.c       | 46 --------------------

>  StandaloneMmPkg/Core/StandaloneMmCore.c |  1 -

>  3 files changed, 69 deletions(-)

>

> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPkg/Core/StandaloneMmCore.h

> index 0d20bcaa6be5..74338dc9da0d 100644

> --- a/StandaloneMmPkg/Core/StandaloneMmCore.h

> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.h

> @@ -635,28 +635,6 @@ MmDriverDispatchHandler (

>

>    @return Status Code

>

> -**/

> -EFI_STATUS

> -EFIAPI

> -MmFvDispatchHandler (

> -  IN     EFI_HANDLE               DispatchHandle,

> -  IN     CONST VOID               *Context,        OPTIONAL

> -  IN OUT VOID                     *CommBuffer,     OPTIONAL

> -  IN OUT UINTN                    *CommBufferSize  OPTIONAL

> -  );

> -

> -/**

> -  This function is the main entry point for an MM handler dispatch

> -  or communicate-based callback.

> -

> -  @param  DispatchHandle  The unique handle assigned to this handler by MmiHandlerRegister().

> -  @param  Context         Points to an optional handler context which was specified when the handler was registered.

> -  @param  CommBuffer      A pointer to a collection of data in memory that will

> -                          be conveyed from a non-MM environment into an MM environment.

> -  @param  CommBufferSize  The size of the CommBuffer.

> -

> -  @return Status Code

> -

>  **/

>  EFI_STATUS

>  EFIAPI

> diff --git a/StandaloneMmPkg/Core/Dispatcher.c b/StandaloneMmPkg/Core/Dispatcher.c

> index bede4832cfb7..4b2f38f700a0 100644

> --- a/StandaloneMmPkg/Core/Dispatcher.c

> +++ b/StandaloneMmPkg/Core/Dispatcher.c

> @@ -883,52 +883,6 @@ MmAddToDriverList (

>    return EFI_SUCCESS;

>  }

>

> -/**

> -  This function is the main entry point for an MM handler dispatch

> -  or communicate-based callback.

> -

> -  @param  DispatchHandle  The unique handle assigned to this handler by SmiHandlerRegister().

> -  @param  Context         Points to an optional handler context which was specified when the handler was registered.

> -  @param  CommBuffer      A pointer to a collection of data in memory that will

> -                          be conveyed from a non-MM environment into an MM environment.

> -  @param  CommBufferSize  The size of the CommBuffer.

> -

> -  @return Status Code

> -

> -**/

> -EFI_STATUS

> -EFIAPI

> -MmFvDispatchHandler (

> -  IN     EFI_HANDLE               DispatchHandle,

> -  IN     CONST VOID               *Context,        OPTIONAL

> -  IN OUT VOID                     *CommBuffer,     OPTIONAL

> -  IN OUT UINTN                    *CommBufferSize  OPTIONAL

> -  )

> -{

> -  EFI_STATUS                            Status;

> -  EFI_MM_COMMUNICATE_FV_DISPATCH_DATA  *CommunicationFvDispatchData;

> -  EFI_FIRMWARE_VOLUME_HEADER            *FwVolHeader;

> -

> -  DEBUG ((DEBUG_INFO, "MmFvDispatchHandler\n"));

> -

> -  CommunicationFvDispatchData = CommBuffer;

> -

> -  DEBUG ((DEBUG_INFO, "  Dispatch - 0x%016lx - 0x%016lx\n", CommunicationFvDispatchData->Address,

> -          CommunicationFvDispatchData->Size));

> -

> -  FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)CommunicationFvDispatchData->Address;

> -

> -  MmCoreFfsFindMmDriver (FwVolHeader);

> -

> -  //

> -  // Execute the MM Dispatcher on any newly discovered FVs and previously

> -  // discovered MM drivers that have been discovered but not dispatched.

> -  //

> -  Status = MmDispatcher ();

> -

> -  return Status;

> -}

> -

>  /**

>    Traverse the discovered list for any drivers that were discovered but not loaded

>    because the dependency experessions evaluated to false.

> diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c b/StandaloneMmPkg/Core/StandaloneMmCore.c

> index ec53b8d8bec4..766cdb5c848c 100644

> --- a/StandaloneMmPkg/Core/StandaloneMmCore.c

> +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c

> @@ -99,7 +99,6 @@ BOOLEAN  mInLegacyBoot = FALSE;

>  // Table of MMI Handlers that are registered by the MM Core when it is initialized

>  //

>  MM_CORE_MMI_HANDLERS  mMmCoreMmiHandlers[] = {

> -  { MmFvDispatchHandler,     &gMmFvDispatchGuid,                 NULL, TRUE  },

>    { MmReadyToLockHandler,    &gEfiDxeMmReadyToLockProtocolGuid,  NULL, TRUE  },

>    { MmEndOfDxeHandler,       &gEfiEndOfDxeEventGroupGuid,        NULL, FALSE },

>    { MmLegacyBootHandler,     &gEfiEventLegacyBootGuid,           NULL, FALSE },

> --

> 2.20.1

>

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Patch

diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPkg/Core/StandaloneMmCore.h
index 0d20bcaa6be5..74338dc9da0d 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.h
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.h
@@ -635,28 +635,6 @@  MmDriverDispatchHandler (
 
   @return Status Code
 
-**/
-EFI_STATUS
-EFIAPI
-MmFvDispatchHandler (
-  IN     EFI_HANDLE               DispatchHandle,
-  IN     CONST VOID               *Context,        OPTIONAL
-  IN OUT VOID                     *CommBuffer,     OPTIONAL
-  IN OUT UINTN                    *CommBufferSize  OPTIONAL
-  );
-
-/**
-  This function is the main entry point for an MM handler dispatch
-  or communicate-based callback.
-
-  @param  DispatchHandle  The unique handle assigned to this handler by MmiHandlerRegister().
-  @param  Context         Points to an optional handler context which was specified when the handler was registered.
-  @param  CommBuffer      A pointer to a collection of data in memory that will
-                          be conveyed from a non-MM environment into an MM environment.
-  @param  CommBufferSize  The size of the CommBuffer.
-
-  @return Status Code
-
 **/
 EFI_STATUS
 EFIAPI
diff --git a/StandaloneMmPkg/Core/Dispatcher.c b/StandaloneMmPkg/Core/Dispatcher.c
index bede4832cfb7..4b2f38f700a0 100644
--- a/StandaloneMmPkg/Core/Dispatcher.c
+++ b/StandaloneMmPkg/Core/Dispatcher.c
@@ -883,52 +883,6 @@  MmAddToDriverList (
   return EFI_SUCCESS;
 }
 
-/**
-  This function is the main entry point for an MM handler dispatch
-  or communicate-based callback.
-
-  @param  DispatchHandle  The unique handle assigned to this handler by SmiHandlerRegister().
-  @param  Context         Points to an optional handler context which was specified when the handler was registered.
-  @param  CommBuffer      A pointer to a collection of data in memory that will
-                          be conveyed from a non-MM environment into an MM environment.
-  @param  CommBufferSize  The size of the CommBuffer.
-
-  @return Status Code
-
-**/
-EFI_STATUS
-EFIAPI
-MmFvDispatchHandler (
-  IN     EFI_HANDLE               DispatchHandle,
-  IN     CONST VOID               *Context,        OPTIONAL
-  IN OUT VOID                     *CommBuffer,     OPTIONAL
-  IN OUT UINTN                    *CommBufferSize  OPTIONAL
-  )
-{
-  EFI_STATUS                            Status;
-  EFI_MM_COMMUNICATE_FV_DISPATCH_DATA  *CommunicationFvDispatchData;
-  EFI_FIRMWARE_VOLUME_HEADER            *FwVolHeader;
-
-  DEBUG ((DEBUG_INFO, "MmFvDispatchHandler\n"));
-
-  CommunicationFvDispatchData = CommBuffer;
-
-  DEBUG ((DEBUG_INFO, "  Dispatch - 0x%016lx - 0x%016lx\n", CommunicationFvDispatchData->Address,
-          CommunicationFvDispatchData->Size));
-
-  FwVolHeader = (EFI_FIRMWARE_VOLUME_HEADER *)(UINTN)CommunicationFvDispatchData->Address;
-
-  MmCoreFfsFindMmDriver (FwVolHeader);
-
-  //
-  // Execute the MM Dispatcher on any newly discovered FVs and previously
-  // discovered MM drivers that have been discovered but not dispatched.
-  //
-  Status = MmDispatcher ();
-
-  return Status;
-}
-
 /**
   Traverse the discovered list for any drivers that were discovered but not loaded
   because the dependency experessions evaluated to false.
diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c b/StandaloneMmPkg/Core/StandaloneMmCore.c
index ec53b8d8bec4..766cdb5c848c 100644
--- a/StandaloneMmPkg/Core/StandaloneMmCore.c
+++ b/StandaloneMmPkg/Core/StandaloneMmCore.c
@@ -99,7 +99,6 @@  BOOLEAN  mInLegacyBoot = FALSE;
 // Table of MMI Handlers that are registered by the MM Core when it is initialized
 //
 MM_CORE_MMI_HANDLERS  mMmCoreMmiHandlers[] = {
-  { MmFvDispatchHandler,     &gMmFvDispatchGuid,                 NULL, TRUE  },
   { MmReadyToLockHandler,    &gEfiDxeMmReadyToLockProtocolGuid,  NULL, TRUE  },
   { MmEndOfDxeHandler,       &gEfiEndOfDxeEventGroupGuid,        NULL, FALSE },
   { MmLegacyBootHandler,     &gEfiEventLegacyBootGuid,           NULL, FALSE },