From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web09.13697.1628451637238227191 for ; Sun, 08 Aug 2021 12:40:37 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=sCOBei0B; spf=pass (domain: posteo.de, ip: 185.67.36.66, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 7360D240107 for ; Sun, 8 Aug 2021 21:40:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1628451635; bh=z558XeqESbv/2VDOJMBFop2Y75REYhRFT9FIj3BxDwI=; h=From:To:Cc:Subject:Date:From; b=sCOBei0BTKqSQBinZdhY1RqUXnAp6MACo5evLWxFa4Ff6w+FTDL1d/zG6d+inst9O o8tUZsOxRRHspMYrPVfczrRK+YCnt/Nc2sLdGB/Xd2MCBlb8li3GjeSnXUiO/VkvRH 0rtk7uq6FTdhAw7b7eMyT+pLKsXemyfifFNkOeketRa0BuGkff5MJxbgd8tYkvNobi +sY69dgd1yJj29E/BWISwLJxTvzWyX8cacIo6lJlSZyfDDqhUdnCZU+QV8+CiUWZu0 KbpyGc2WyVAB6ZWBOyPLaBs0BrFPxlsAJip6pYcjQiSRnBqaadEa7NdfbT2yYMysom Ksl8G9mxkMhvA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GjV1Z5nPTz6tmD; Sun, 8 Aug 2021 21:40:34 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu , Eric Dong , Ray Ni , Vitaly Cheptsov Subject: [PATCH] MdeModulePkg/PiSmmCore: Drop deprecated image profiling commands Date: Sun, 8 Aug 2021 19:39:43 +0000 Message-Id: In-Reply-To: <5df11a13422732b9c03c120775a2b4dd0a49182f.1628444003.git.mhaeuser@posteo.de> References: <5df11a13422732b9c03c120775a2b4dd0a49182f.1628444003.git.mhaeuser@posteo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The legacy codebase allowed SMM images to be registered for profiling from DXE. Support for this has been dropped entirely, so remove the remaining handlers. Cc: Jian J Wang Cc: Hao A Wu Cc: Eric Dong Cc: Ray Ni Cc: Vitaly Cheptsov Signed-off-by: Marvin H=C3=A4user --- MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c | 80 -------------------- MdeModulePkg/Include/Guid/MemoryProfile.h | 5 -- 2 files changed, 85 deletions(-) diff --git a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c b/MdeModulePk= g/Core/PiSmmCore/SmramProfileRecord.c index 1b302c810cc9..7316df7531fd 100644 --- a/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c +++ b/MdeModulePkg/Core/PiSmmCore/SmramProfileRecord.c @@ -2232,64 +2232,6 @@ Done: mSmramProfileGettingStatus =3D SmramProfileGettingStatus;=0D }=0D =0D -/**=0D - SMRAM profile handler to register SMM image.=0D -=0D - @param SmramProfileParameterRegisterImage The parameter of SMM profile r= egister image.=0D -=0D -**/=0D -VOID=0D -SmramProfileHandlerRegisterImage (=0D - IN SMRAM_PROFILE_PARAMETER_REGISTER_IMAGE *SmramProfileParameterRegister= Image=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_SMM_DRIVER_ENTRY DriverEntry;=0D - VOID *EntryPointInImage;=0D -=0D - ZeroMem (&DriverEntry, sizeof (DriverEntry));=0D - CopyMem (&DriverEntry.FileName, &SmramProfileParameterRegisterImage->Fil= eName, sizeof(EFI_GUID));=0D - DriverEntry.ImageBuffer =3D SmramProfileParameterRegisterImage->ImageBuf= fer;=0D - DriverEntry.NumberOfPage =3D (UINTN) SmramProfileParameterRegisterImage-= >NumberOfPage;=0D - Status =3D InternalPeCoffGetEntryPoint ((VOID *) (UINTN) DriverEntry.Ima= geBuffer, &EntryPointInImage);=0D - ASSERT_EFI_ERROR (Status);=0D - DriverEntry.ImageEntryPoint =3D (PHYSICAL_ADDRESS) (UINTN) EntryPointInI= mage;=0D -=0D - Status =3D RegisterSmramProfileImage (&DriverEntry, FALSE);=0D - if (!EFI_ERROR (Status)) {=0D - SmramProfileParameterRegisterImage->Header.ReturnStatus =3D 0;=0D - }=0D -}=0D -=0D -/**=0D - SMRAM profile handler to unregister SMM image.=0D -=0D - @param SmramProfileParameterUnregisterImage The parameter of SMM profile= unregister image.=0D -=0D -**/=0D -VOID=0D -SmramProfileHandlerUnregisterImage (=0D - IN SMRAM_PROFILE_PARAMETER_UNREGISTER_IMAGE *SmramProfileParameterUnregi= sterImage=0D - )=0D -{=0D - EFI_STATUS Status;=0D - EFI_SMM_DRIVER_ENTRY DriverEntry;=0D - VOID *EntryPointInImage;=0D -=0D - ZeroMem (&DriverEntry, sizeof (DriverEntry));=0D - CopyMem (&DriverEntry.FileName, &SmramProfileParameterUnregisterImage->F= ileName, sizeof (EFI_GUID));=0D - DriverEntry.ImageBuffer =3D SmramProfileParameterUnregisterImage->ImageB= uffer;=0D - DriverEntry.NumberOfPage =3D (UINTN) SmramProfileParameterUnregisterImag= e->NumberOfPage;=0D - Status =3D InternalPeCoffGetEntryPoint ((VOID *) (UINTN) DriverEntry.Ima= geBuffer, &EntryPointInImage);=0D - ASSERT_EFI_ERROR (Status);=0D - DriverEntry.ImageEntryPoint =3D (PHYSICAL_ADDRESS) (UINTN) EntryPointInI= mage;=0D -=0D - Status =3D UnregisterSmramProfileImage (&DriverEntry, FALSE);=0D - if (!EFI_ERROR (Status)) {=0D - SmramProfileParameterUnregisterImage->Header.ReturnStatus =3D 0;=0D - }=0D -}=0D -=0D /**=0D Dispatch function for a Software SMI handler.=0D =0D @@ -2374,28 +2316,6 @@ SmramProfileHandler ( }=0D SmramProfileHandlerGetDataByOffset ((SMRAM_PROFILE_PARAMETER_GET_PROFI= LE_DATA_BY_OFFSET *) (UINTN) CommBuffer);=0D break;=0D - case SMRAM_PROFILE_COMMAND_REGISTER_IMAGE:=0D - DEBUG ((EFI_D_ERROR, "SmramProfileHandlerRegisterImage\n"));=0D - if (TempCommBufferSize !=3D sizeof (SMRAM_PROFILE_PARAMETER_REGISTER_I= MAGE)) {=0D - DEBUG ((EFI_D_ERROR, "SmramProfileHandler: SMM communication buffer = size invalid!\n"));=0D - return EFI_SUCCESS;=0D - }=0D - if (mSmramReadyToLock) {=0D - return EFI_SUCCESS;=0D - }=0D - SmramProfileHandlerRegisterImage ((SMRAM_PROFILE_PARAMETER_REGISTER_IM= AGE *) (UINTN) CommBuffer);=0D - break;=0D - case SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE:=0D - DEBUG ((EFI_D_ERROR, "SmramProfileHandlerUnregisterImage\n"));=0D - if (TempCommBufferSize !=3D sizeof (SMRAM_PROFILE_PARAMETER_UNREGISTER= _IMAGE)) {=0D - DEBUG ((EFI_D_ERROR, "SmramProfileHandler: SMM communication buffer = size invalid!\n"));=0D - return EFI_SUCCESS;=0D - }=0D - if (mSmramReadyToLock) {=0D - return EFI_SUCCESS;=0D - }=0D - SmramProfileHandlerUnregisterImage ((SMRAM_PROFILE_PARAMETER_UNREGISTE= R_IMAGE *) (UINTN) CommBuffer);=0D - break;=0D case SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE:=0D DEBUG ((EFI_D_ERROR, "SmramProfileHandlerGetRecordingState\n"));=0D if (TempCommBufferSize !=3D sizeof (SMRAM_PROFILE_PARAMETER_RECORDING_= STATE)) {=0D diff --git a/MdeModulePkg/Include/Guid/MemoryProfile.h b/MdeModulePkg/Inclu= de/Guid/MemoryProfile.h index eee3b9125240..92cd1e7cf493 100644 --- a/MdeModulePkg/Include/Guid/MemoryProfile.h +++ b/MdeModulePkg/Include/Guid/MemoryProfile.h @@ -388,11 +388,6 @@ struct _EDKII_MEMORY_PROFILE_PROTOCOL { //=0D #define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO 0x1=0D #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA 0x2=0D -//=0D -// Below 2 commands are now used by ECP only and only valid before SmmRead= yToLock=0D -//=0D -#define SMRAM_PROFILE_COMMAND_REGISTER_IMAGE 0x3=0D -#define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE 0x4=0D =0D #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET 0x5=0D #define SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE 0x6=0D --=20 2.31.1