From nobody Tue Apr 30 04:47:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+78885+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78885+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=posteo.de ARC-Seal: i=1; a=rsa-sha256; t=1628451638; cv=none; d=zohomail.com; s=zohoarc; b=MIjVwZgo5LwcBIBNd9qslr/PDpWEwsPsDL11X4SaKjxKWEOXg1/HpbKUJ7XG/lAiGz/t07avw+8psNXfdhGEBxtnqT4U3k7DYydPF4fpzyJMt+NXpDpquypqG1WkymKlHWO5MXP9L9ctryN0Sm//HhY5JSklwa6V6hUY3OKnimY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628451638; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=uDRU1dRJYyr9Drcdkm2CcM156lSzqy86f4iyd+6w6ds=; b=eZWXpPuTWdobyyr11Mi6j9SQpngznOfaTDFqKiY/j0oOjOyOdqkjgPWRm3BwXYhUYoMi+0pCiOeeWZtLkwSxAtrR+F3j9ZGHHYvWeljTBN781RqLE4j05jhejh3x8T0SMrNLSYKRrjphHRy2xUGdTN1cxqLL8opFlOJZKJobQ/U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+78885+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1628451638890165.6990183633875; Sun, 8 Aug 2021 12:40:38 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id XgbtYY1788612x2kUuYY316N; Sun, 08 Aug 2021 12:40:38 -0700 X-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 X-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) X-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: [edk2-devel] [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 Precedence: Bulk List-Unsubscribe: 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,mhaeuser@posteo.de X-Gm-Message-State: j92xKfBtz8A7No2UsqetLp1bx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628451638; bh=TEsakoVDp8/oyHr/+u4To8QwAUsvEAt1yT2IIekjLkA=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=nyyPAKKcfK9gLOulzbsfLoUeMWh5BPsWcpt05oDIAM27VHoFoSWphHR1MvOE8hwOqxu /LVNY3PvKaNBHOCKSW9K0WCHkvZSyuDCH7cfTgJPKTfX3kEB1mst8nbStiZajOjJy2wG4 AnYPZYJXnuZmwsIKrKXfghkFepBzjZZyRbA= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628451639641100039 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Ray Ni --- 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; } =20 -/** - SMRAM profile handler to register SMM image. - - @param SmramProfileParameterRegisterImage The parameter of SMM profile r= egister image. - -**/ -VOID -SmramProfileHandlerRegisterImage ( - IN SMRAM_PROFILE_PARAMETER_REGISTER_IMAGE *SmramProfileParameterRegister= Image - ) -{ - EFI_STATUS Status; - EFI_SMM_DRIVER_ENTRY DriverEntry; - VOID *EntryPointInImage; - - ZeroMem (&DriverEntry, sizeof (DriverEntry)); - CopyMem (&DriverEntry.FileName, &SmramProfileParameterRegisterImage->Fil= eName, sizeof(EFI_GUID)); - DriverEntry.ImageBuffer =3D SmramProfileParameterRegisterImage->ImageBuf= fer; - DriverEntry.NumberOfPage =3D (UINTN) SmramProfileParameterRegisterImage-= >NumberOfPage; - Status =3D InternalPeCoffGetEntryPoint ((VOID *) (UINTN) DriverEntry.Ima= geBuffer, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); - DriverEntry.ImageEntryPoint =3D (PHYSICAL_ADDRESS) (UINTN) EntryPointInI= mage; - - Status =3D RegisterSmramProfileImage (&DriverEntry, FALSE); - if (!EFI_ERROR (Status)) { - SmramProfileParameterRegisterImage->Header.ReturnStatus =3D 0; - } -} - -/** - SMRAM profile handler to unregister SMM image. - - @param SmramProfileParameterUnregisterImage The parameter of SMM profile= unregister image. - -**/ -VOID -SmramProfileHandlerUnregisterImage ( - IN SMRAM_PROFILE_PARAMETER_UNREGISTER_IMAGE *SmramProfileParameterUnregi= sterImage - ) -{ - EFI_STATUS Status; - EFI_SMM_DRIVER_ENTRY DriverEntry; - VOID *EntryPointInImage; - - ZeroMem (&DriverEntry, sizeof (DriverEntry)); - CopyMem (&DriverEntry.FileName, &SmramProfileParameterUnregisterImage->F= ileName, sizeof (EFI_GUID)); - DriverEntry.ImageBuffer =3D SmramProfileParameterUnregisterImage->ImageB= uffer; - DriverEntry.NumberOfPage =3D (UINTN) SmramProfileParameterUnregisterImag= e->NumberOfPage; - Status =3D InternalPeCoffGetEntryPoint ((VOID *) (UINTN) DriverEntry.Ima= geBuffer, &EntryPointInImage); - ASSERT_EFI_ERROR (Status); - DriverEntry.ImageEntryPoint =3D (PHYSICAL_ADDRESS) (UINTN) EntryPointInI= mage; - - Status =3D UnregisterSmramProfileImage (&DriverEntry, FALSE); - if (!EFI_ERROR (Status)) { - SmramProfileParameterUnregisterImage->Header.ReturnStatus =3D 0; - } -} - /** Dispatch function for a Software SMI handler. =20 @@ -2374,28 +2316,6 @@ SmramProfileHandler ( } SmramProfileHandlerGetDataByOffset ((SMRAM_PROFILE_PARAMETER_GET_PROFI= LE_DATA_BY_OFFSET *) (UINTN) CommBuffer); break; - case SMRAM_PROFILE_COMMAND_REGISTER_IMAGE: - DEBUG ((EFI_D_ERROR, "SmramProfileHandlerRegisterImage\n")); - if (TempCommBufferSize !=3D sizeof (SMRAM_PROFILE_PARAMETER_REGISTER_I= MAGE)) { - DEBUG ((EFI_D_ERROR, "SmramProfileHandler: SMM communication buffer = size invalid!\n")); - return EFI_SUCCESS; - } - if (mSmramReadyToLock) { - return EFI_SUCCESS; - } - SmramProfileHandlerRegisterImage ((SMRAM_PROFILE_PARAMETER_REGISTER_IM= AGE *) (UINTN) CommBuffer); - break; - case SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE: - DEBUG ((EFI_D_ERROR, "SmramProfileHandlerUnregisterImage\n")); - if (TempCommBufferSize !=3D sizeof (SMRAM_PROFILE_PARAMETER_UNREGISTER= _IMAGE)) { - DEBUG ((EFI_D_ERROR, "SmramProfileHandler: SMM communication buffer = size invalid!\n")); - return EFI_SUCCESS; - } - if (mSmramReadyToLock) { - return EFI_SUCCESS; - } - SmramProfileHandlerUnregisterImage ((SMRAM_PROFILE_PARAMETER_UNREGISTE= R_IMAGE *) (UINTN) CommBuffer); - break; case SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE: DEBUG ((EFI_D_ERROR, "SmramProfileHandlerGetRecordingState\n")); if (TempCommBufferSize !=3D sizeof (SMRAM_PROFILE_PARAMETER_RECORDING_= STATE)) { 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 { // #define SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO 0x1 #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA 0x2 -// -// Below 2 commands are now used by ECP only and only valid before SmmRead= yToLock -// -#define SMRAM_PROFILE_COMMAND_REGISTER_IMAGE 0x3 -#define SMRAM_PROFILE_COMMAND_UNREGISTER_IMAGE 0x4 =20 #define SMRAM_PROFILE_COMMAND_GET_PROFILE_DATA_BY_OFFSET 0x5 #define SMRAM_PROFILE_COMMAND_GET_RECORDING_STATE 0x6 --=20 2.31.1 -=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 (#78885): https://edk2.groups.io/g/devel/message/78885 Mute This Topic: https://groups.io/mt/84754058/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-