From nobody Thu May 2 18:35:53 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+78892+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+78892+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=posteo.de ARC-Seal: i=1; a=rsa-sha256; t=1628451642; cv=none; d=zohomail.com; s=zohoarc; b=FRKVGP78NOi9CRciVx7pCN7EjHlw+hPAtbMj1M4oSipPaZrQuE/NLVHcW+uYaKSzndSZpr7tVAez5wcxJ5aK3yrO7hKajO9Kn57AkomIe8sXky23ih5a/ZAvHZEwAn1kQR5z2FRw8v6GDgB+WfKSf51oi9Tf6e3kth1LYZmgNng= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628451642; 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=0wh3e85Y2CVdH5lNRCrFzRGgBls/fY/PfyN2hVpUTcs=; b=Xuf+GnYfWl4KjhLlO+CgPWJhBZSCRMZFYqvkV1qhiJd3De+NtU2efZUFoUPFTfAeybBzskJv2D8XKoWs5WvzC1/o77aGc01lZgFAbfuyYrFYImGR4FBJ3DU6wdGZfsJqw+N+z0VMY+8GG5h7CMDjPGNepxsC65EiichO7rspuuo= 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+78892+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 1628451642499971.4363914952244; Sun, 8 Aug 2021 12:40:42 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id pfWrYY1788612x7jVZrE5Daq; Sun, 08 Aug 2021 12:40:42 -0700 X-Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by mx.groups.io with SMTP id smtpd.web08.13631.1628451640455223271 for ; Sun, 08 Aug 2021 12:40:40 -0700 X-Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 9F389240105 for ; Sun, 8 Aug 2021 21:40:38 +0200 (CEST) X-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4GjV1f0Tmmz6tm6; Sun, 8 Aug 2021 21:40:38 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh , Vitaly Cheptsov Subject: [edk2-devel] [PATCH] StandaloneMmPkg/StandaloneMmCore: Drop code for traditional drivers Date: Sun, 8 Aug 2021 19:39:50 +0000 Message-Id: <12a3f42d807dcdb6218a024dfe8247bfdd728605.1628359458.git.mhaeuser@posteo.de> 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: mZvg8sliebe3LhobbUcElcKrx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1628451642; bh=n9240YOqB8dbc9IQDpdMZCsXdo1yXURgEoXymUyEzgQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=Pcrzi7rnnMgkefdUu+kMua2NDpDV3dGN5YLJZzfkhanLU22V75iH3hUcJdFWgGXR85p YXzTNNuMpq5KOzpaTQt70bgSfK1hDccKsbJrL3/OMMR4N7lbDinKFNZtcsgfcQNKFkPpa 2tJmijWfa/XVCWT/I+ihCu+sMH9jV9wRke8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1628451643882100067 Content-Type: text/plain; charset="utf-8" StandaloneMmCore has code paths in place to support traditional MM drivers based on the availability of mEfiSystemTable. This variable is not populated anywhere however, rendering said paths unreachable. Remove the unreachable support code. Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Jiewen Yao Cc: Supreeth Venkatesh Cc: Vitaly Cheptsov Signed-off-by: Marvin H=C3=A4user --- StandaloneMmPkg/Core/Dependency.c | 6 --- StandaloneMmPkg/Core/Dispatcher.c | 51 +------------------- StandaloneMmPkg/Core/StandaloneMmCore.c | 1 - StandaloneMmPkg/Core/StandaloneMmCore.h | 1 - 4 files changed, 2 insertions(+), 57 deletions(-) diff --git a/StandaloneMmPkg/Core/Dependency.c b/StandaloneMmPkg/Core/Depen= dency.c index eb4baa4086f0..3ae0201eb647 100644 --- a/StandaloneMmPkg/Core/Dependency.c +++ b/StandaloneMmPkg/Core/Dependency.c @@ -242,12 +242,6 @@ MmIsSchedulable ( CopyMem (&DriverGuid, Iterator + 1, sizeof (EFI_GUID)); =20 Status =3D MmLocateProtocol (&DriverGuid, NULL, &Interface); - if (EFI_ERROR (Status) && (mEfiSystemTable !=3D NULL)) { - // - // For MM Driver, it may depend on uefi protocols - // - Status =3D mEfiSystemTable->BootServices->LocateProtocol (&DriverG= uid, NULL, &Interface); - } =20 if (EFI_ERROR (Status)) { DEBUG ((DEBUG_DISPATCH, " PUSH GUID(%g) =3D FALSE\n", &DriverGuid= )); diff --git a/StandaloneMmPkg/Core/Dispatcher.c b/StandaloneMmPkg/Core/Dispa= tcher.c index 7e4bf5e94025..76d33f81fef1 100644 --- a/StandaloneMmPkg/Core/Dispatcher.c +++ b/StandaloneMmPkg/Core/Dispatcher.c @@ -364,45 +364,6 @@ MmLoadImage ( DriverEntry->ImageBuffer =3D DstBuffer; DriverEntry->NumberOfPage =3D PageCount; =20 - if (mEfiSystemTable !=3D NULL) { - Status =3D mEfiSystemTable->BootServices->AllocatePool ( - EfiBootServicesData, - sizeof (EFI_LOADED_IMAGE_PRO= TOCOL), - (VOID **)&DriverEntry->Loade= dImage - ); - if (EFI_ERROR (Status)) { - MmFreePages (DstBuffer, PageCount); - return Status; - } - - ZeroMem (DriverEntry->LoadedImage, sizeof (EFI_LOADED_IMAGE_PROTOCOL)); - // - // Fill in the remaining fields of the Loaded Image Protocol instance. - // Note: ImageBase is an SMRAM address that can not be accessed outsid= e of SMRAM if SMRAM window is closed. - // - DriverEntry->LoadedImage->Revision =3D EFI_LOADED_IMAGE_PROTOCOL_= REVISION; - DriverEntry->LoadedImage->ParentHandle =3D NULL; - DriverEntry->LoadedImage->SystemTable =3D mEfiSystemTable; - DriverEntry->LoadedImage->DeviceHandle =3D NULL; - DriverEntry->LoadedImage->FilePath =3D NULL; - - DriverEntry->LoadedImage->ImageBase =3D (VOID *)(UINTN)DriverEntry= ->ImageBuffer; - DriverEntry->LoadedImage->ImageSize =3D ImageContext.ImageSize; - DriverEntry->LoadedImage->ImageCodeType =3D EfiRuntimeServicesCode; - DriverEntry->LoadedImage->ImageDataType =3D EfiRuntimeServicesData; - - // - // Create a new image handle in the UEFI handle database for the MM Dr= iver - // - DriverEntry->ImageHandle =3D NULL; - Status =3D mEfiSystemTable->BootServices->InstallMultipleProtocolInter= faces ( - &DriverEntry->ImageHandle, - &gEfiLoadedImageProtocolGuid, - DriverEntry->LoadedImage, - NULL - ); - } - // // Print the load address and the PDB file name if it is available // @@ -637,16 +598,8 @@ MmDispatcher ( // // For each MM driver, pass NULL as ImageHandle // - if (mEfiSystemTable =3D=3D NULL) { - DEBUG ((DEBUG_INFO, "StartImage - 0x%x (Standalone Mode)\n", Drive= rEntry->ImageEntryPoint)); - Status =3D ((MM_IMAGE_ENTRY_POINT)(UINTN)DriverEntry->ImageEntryPo= int) (DriverEntry->ImageHandle, &gMmCoreMmst); - } else { - DEBUG ((DEBUG_INFO, "StartImage - 0x%x (Tradition Mode)\n", Driver= Entry->ImageEntryPoint)); - Status =3D ((EFI_IMAGE_ENTRY_POINT)(UINTN)DriverEntry->ImageEntryP= oint) ( - DriverEntry= ->ImageHandle, - mEfiSystemT= able - ); - } + DEBUG ((DEBUG_INFO, "StartImage - 0x%x (Standalone Mode)\n", DriverE= ntry->ImageEntryPoint)); + Status =3D ((MM_IMAGE_ENTRY_POINT)(UINTN)DriverEntry->ImageEntryPoin= t) (DriverEntry->ImageHandle, &gMmCoreMmst); if (EFI_ERROR(Status)) { DEBUG ((DEBUG_INFO, "StartImage Status - %r\n", Status)); MmFreePages(DriverEntry->ImageBuffer, DriverEntry->NumberOfPage); diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.c b/StandaloneMmPkg/Core= /StandaloneMmCore.c index fbb0ec75e557..45976f203dd9 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.c +++ b/StandaloneMmPkg/Core/StandaloneMmCore.c @@ -92,7 +92,6 @@ MM_CORE_MMI_HANDLERS mMmCoreMmiHandlers[] =3D { { NULL, NULL, NULL, FAL= SE }, }; =20 -EFI_SYSTEM_TABLE *mEfiSystemTable; UINTN mMmramRangeCount; EFI_MMRAM_DESCRIPTOR *mMmramRanges; =20 diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.h b/StandaloneMmPkg/Core= /StandaloneMmCore.h index 2a89edd0fc46..f6b3cc861e39 100644 --- a/StandaloneMmPkg/Core/StandaloneMmCore.h +++ b/StandaloneMmPkg/Core/StandaloneMmCore.h @@ -848,6 +848,5 @@ DumpMmramInfo ( =20 extern UINTN mMmramRangeCount; extern EFI_MMRAM_DESCRIPTOR *mMmramRanges; -extern EFI_SYSTEM_TABLE *mEfiSystemTable; =20 #endif --=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 (#78892): https://edk2.groups.io/g/devel/message/78892 Mute This Topic: https://groups.io/mt/84754066/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-