From patchwork Mon Apr 1 03:27:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 161517 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp4874767jan; Sun, 31 Mar 2019 20:27:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyK7xJ83mStU8J3DkDKFZZCT9EkyjS9UWwDMG5hyzke1tcKjA4HGNlEv60TI7L2wzRm1+B9 X-Received: by 2002:a62:448d:: with SMTP id m13mr61806958pfi.182.1554089268499; Sun, 31 Mar 2019 20:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554089268; cv=none; d=google.com; s=arc-20160816; b=PW1oV1reuXlWc0jCUyy0uF3cmwJ3BiLcZQFB4uKOQtMk21XtkepZiTzCj++4KAOH7v rIfuztQVyl+Trrycl/Sq5N0fXpWcEiqxecYP2MZsSWPiKyXk4mLH78p7BHQQ9SdxfInh hQIywmsVgYs4/qdJemo2Tw/0XD1E2WxTOk9q/nR+MFIbR+ExAUb2qil98ERpDActMfRA Xf91yQBAI3gf24TLTudtFO/uigjLGWvvZPblx5AOnPbkBm6eN9IGkIXXrDn2a4Ow23zY TTslhZJMBcnJEZ7CvZyfFFb2Tr8IUwtvIYPwNT4Si4xq/n/uKtACx+lHgX1q0o2+Cf+k XSTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=PPBh2Meahy3B4Uqb5YgocRcNYWXp/J6+uyVei2GFK7o=; b=Q3XKb7j2eqwRmd1NFesoBHNL2VKoiRx6xnGC1JgkhJg9OUtwlkOJgBPEZaBEwTRzez fkAi8BnYY+qsON3XLKkTU1Q2bB2pwbBE7jcCu5jYHz7FEYU9QWIELiH72xcWRYWwNH3W nB+ZKkmfAu0vTWwINi8UhvPxy4AWs2lasGki97wvsTT6bzoEBuwGIqQ5qT3DXKehkfA5 dMca0ImmMHs+cxtL8pd34IV+eUZmYN9o/djrYasEFc/PcMfa9nuwsfcZe3GnX8W/Xf+G ZJWDrXaD1IhybQYRsXky48JTYAHhd3zs/6y5yz/+jkkUR4wTmjT+JvF8vb3vdD0qHpqR JZTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=I4hog5Dy; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id s205si7553760pgs.467.2019.03.31.20.27.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Mar 2019 20:27:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=I4hog5Dy; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1C5CE211EA9EE; Sun, 31 Mar 2019 20:27:48 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 069B5211E011B for ; Sun, 31 Mar 2019 20:27:46 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id i19so3823983pfd.0 for ; Sun, 31 Mar 2019 20:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OwXUHeDB4L60hLaVSJs2r8SdEEcXZ6K4jyQbqQxLzxc=; b=I4hog5DyKlg8hpTlWI6jABStxhTcKoUGVi5ISAfabwdFx03bANHkwlcJ9XZ6BmqXI2 q0hSk1+Iv1wD/u29DD/VQTlYOJjuHU1L7OC5Qh6x5Li8HmwgfhwB271hBu0WKbN7ji71 J0NaM8ICLcjoL4NR+ohV9+k26e9SBQLHBIACS9EjbiTqUHZ8rjxrRgoD8SgUjon3HsoI CDapHC5RiMtPlzu7eTZBrlb/mPzJrhTwzWbuwwSiGV+hBeOH/cp22XZl8WbBh6ChDBL4 rWb16T+DURdqJAfAMvtR/eWIRDGfCQiCClGE6Q9MEXJZDQkCXXLw2v2EMmMIulZ9LNbG vBuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OwXUHeDB4L60hLaVSJs2r8SdEEcXZ6K4jyQbqQxLzxc=; b=ER2bBhKIszQv2r/wpnd30H90PJLm0hm64wnigQtl/XeYVBqvvvMqamAfDf5y/y5rAw AQK2/TYPEvun+LRWlQGacO5zHGv+1QQOXu8MSed12a19vsCM9LPC1QAAbBOcOkWjbd71 Qy8TGUMDDGMWQXZ/zCSVMYGo+zXqYo5JetVB9pYKC5N2cSCE28HXM1AMrJNsjdkhPBdI P5irWetYXqhrOwEUeO1PrflHBvOG/4M/8n573ChxjzhgVaEXK6AIcOWQt5JkKSVM7hAo cUDw7JYHehOOkrjZ6mT3nSjTYGoo1ktAuRQKlEy419JoAW+JAus+CpEtl0R9wlxpxANu u+Bw== X-Gm-Message-State: APjAAAVf3y0efFZM2NbQ65MTZtDQYceqmRsQtSDQebgH6c+iz//ZgCGN wr4mFWzd2dAbO1HRH3XVcph4yjbhjyR0JA== X-Received: by 2002:a63:4542:: with SMTP id u2mr57812156pgk.291.1554089265456; Sun, 31 Mar 2019 20:27:45 -0700 (PDT) Received: from mba13.imgcgcw.net ([147.50.13.10]) by smtp.gmail.com with ESMTPSA id 16sm12758092pfz.106.2019.03.31.20.27.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Mar 2019 20:27:44 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Mon, 1 Apr 2019 10:27:09 +0700 Message-Id: <20190401032709.14787-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190401032709.14787-1-ard.biesheuvel@linaro.org> References: <20190401032709.14787-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v4 7/7] MdeModulePkg/DxeCore: remove explicit EBC handling X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ruiyu Ni , Vincent Zimmer , Eric Dong , Jaben Carsey , Brian Richardson , Liming Gao , Michael D Kinney , Star Zeng MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Now that the EBC machine type is no longer classified as a natively supported machine type on the architectures that can support it via the EBC interpreter, the EBC specific handling in DXE core is no longer used and can be removed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- MdeModulePkg/Core/Dxe/DxeMain.h | 3 -- MdeModulePkg/Core/Dxe/DxeMain.inf | 1 - MdeModulePkg/Core/Dxe/Image/Image.c | 53 ++------------------ 3 files changed, 3 insertions(+), 54 deletions(-) -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMain.h index 48ec30a48aa2..6e83f15a4541 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.h +++ b/MdeModulePkg/Core/Dxe/DxeMain.h @@ -42,7 +42,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include #include @@ -227,8 +226,6 @@ typedef struct { BASE_LIBRARY_JUMP_BUFFER *JumpContext; /// Machine type from PE image UINT16 Machine; - /// EBC Protocol pointer - EFI_EBC_PROTOCOL *Ebc; /// PE/COFF Image Emulator Protocol pointer EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL *PeCoffEmu; /// Runtime image list diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeMain.inf index ce6fc19be5e4..68413517f2a7 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.inf +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf @@ -160,7 +160,6 @@ gEfiLoadedImageProtocolGuid ## PRODUCES gEfiLoadedImageDevicePathProtocolGuid ## PRODUCES gEfiHiiPackageListProtocolGuid ## SOMETIMES_PRODUCES - gEfiEbcProtocolGuid ## SOMETIMES_CONSUMES gEfiSmmBase2ProtocolGuid ## SOMETIMES_CONSUMES gEdkiiPeCoffImageEmulatorProtocolGuid ## SOMETIMES_CONSUMES diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index cda447d23ec5..0b8b2ba15ccf 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -75,7 +75,6 @@ LOADED_IMAGE_PRIVATE_DATA mCorePrivateImage = { NULL, // JumpBuffer NULL, // JumpContext 0, // Machine - NULL, // Ebc NULL, // PeCoffEmu NULL, // RuntimeData NULL // LoadedImageDevicePath @@ -92,9 +91,6 @@ typedef struct { CHAR16 *MachineTypeName; } MACHINE_TYPE_INFO; -// -// EBC machine is not listed in this table, because EBC is in the default supported scopes of other machine type. -// GLOBAL_REMOVE_IF_UNREFERENCED MACHINE_TYPE_INFO mMachineTypeInfo[] = { {EFI_IMAGE_MACHINE_IA32, L"IA32"}, {EFI_IMAGE_MACHINE_IA64, L"IA64"}, @@ -747,51 +743,15 @@ CoreLoadPeImage ( InvalidateInstructionCacheRange ((VOID *)(UINTN)Image->ImageContext.ImageAddress, (UINTN)Image->ImageContext.ImageSize); // - // Copy the machine type from the context to the image private data. This - // is needed during image unload to know if we should call an EBC protocol - // to unload the image. + // Copy the machine type from the context to the image private data. // Image->Machine = Image->ImageContext.Machine; // - // Get the image entry point. If it's an EBC image, then call into the - // interpreter to create a thunk for the entry point and use the returned - // value for the entry point. + // Get the image entry point. // Image->EntryPoint = (EFI_IMAGE_ENTRY_POINT)(UINTN)Image->ImageContext.EntryPoint; - if (Image->ImageContext.Machine == EFI_IMAGE_MACHINE_EBC) { - // - // Locate the EBC interpreter protocol - // - Status = CoreLocateProtocol (&gEfiEbcProtocolGuid, NULL, (VOID **)&Image->Ebc); - if (EFI_ERROR(Status) || Image->Ebc == NULL) { - DEBUG ((DEBUG_LOAD | DEBUG_ERROR, "CoreLoadPeImage: There is no EBC interpreter for an EBC image.\n")); - goto Done; - } - - // - // Register a callback for flushing the instruction cache so that created - // thunks can be flushed. - // - Status = Image->Ebc->RegisterICacheFlush (Image->Ebc, (EBC_ICACHE_FLUSH)InvalidateInstructionCacheRange); - if (EFI_ERROR(Status)) { - goto Done; - } - - // - // Create a thunk for the image's entry point. This will be the new - // entry point for the image. - // - Status = Image->Ebc->CreateThunk ( - Image->Ebc, - Image->Handle, - (VOID *)(UINTN) Image->ImageContext.EntryPoint, - (VOID **) &Image->EntryPoint - ); - if (EFI_ERROR(Status)) { - goto Done; - } - } else if (Image->PeCoffEmu != NULL) { + if (Image->PeCoffEmu != NULL) { Status = Image->PeCoffEmu->RegisterImage (Image->PeCoffEmu, Image->ImageBasePage, EFI_PAGES_TO_SIZE (Image->NumberOfPages), @@ -981,13 +941,6 @@ CoreUnloadAndCloseImage ( UnprotectUefiImage (&Image->Info, Image->LoadedImageDevicePath); - if (Image->Ebc != NULL) { - // - // If EBC protocol exists we must perform cleanups for this image. - // - Image->Ebc->UnloadImage (Image->Ebc, Image->Handle); - } - if (Image->PeCoffEmu != NULL) { // // If the PE/COFF Emulator protocol exists we must unregister the image.