From patchwork Sat Sep 15 13:28:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 146775 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp1805233ljw; Sat, 15 Sep 2018 06:29:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdY+kfEby/LhPqUe06Y698jwb5B1FbWG14yQoCK+w3f07KMnyEOUeBR9JlsuA8k5QlrVFxhf X-Received: by 2002:a17:902:4001:: with SMTP id b1-v6mr16856541pld.312.1537018167077; Sat, 15 Sep 2018 06:29:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537018167; cv=none; d=google.com; s=arc-20160816; b=NSNNDgD3J0hB2TLnNo4UVO4AWfZIeQjO+mDUgADpY89imA/w+zJkxN8zoLehdMSzVi DI4jDGBvF0d3IHvrULV78mko101chlqJZi7NrAsvwE1v8lYX3/+2piMxw7e3EFz6ueJr N3qT4Tg59xGObxORbSiwX2zX1MEYRsdbdQcNvbdkaIedGiA3lYrbkYVgSMBlIYptWUOX 1FejgGIE0xkE28Edj3Rfu3cTHflJeLBNym2l8bygwJ7RUE3SinfRNP1R65g5RdG+f/E+ T5tMbbZKQRhULyk043/9uIxSbx8e+IlIuCkb8FLF6R8dniTnr44z2f48OhI95zEPpn2S hoDA== 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=B3twvqznjVMh18bOhtY62XeMx/dtVFQo++/4NAD8Dy0=; b=UFVdsfslUAE3yUra2Ez3XJK8bmwjRrDyeDPltrwi3/vutGma6ND6/x3cWt1NpOWKYI Dc85rwz1nxB9aIz0z99xuuJ3KWIq/cpeVylFhH92dLnltBPda1eAziX1kussxpWwzlUM YtxPrxCvh+zojwNWuqqeT26eYnm96nqfLBXURcCdp7+h4kGHPsGBtxqH2R7WCcBwwEFQ cHRRy7AJOgRh7WsLateQDzlNxcAq4s9JFTBPVvjTsh8QAnyss1ll8F83Qm0VIMbwYxGZ ikDqvH07nTY0uuDjZxA50EyStT5mV0hyvhWtnQEXSUv3DgbI2oFEGo2jW44YzoCb8bRO LRBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=G4kHutGy; 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 u4-v6si10731283plj.134.2018.09.15.06.29.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Sep 2018 06:29:27 -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=G4kHutGy; 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 1A1AE211350FF; Sat, 15 Sep 2018 06:29:19 -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=2a00:1450:4864:20::543; helo=mail-ed1-x543.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) (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 4FEEE211350E9 for ; Sat, 15 Sep 2018 06:29:17 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id u1-v6so9512863eds.1 for ; Sat, 15 Sep 2018 06:29:17 -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=eX7WTuqwg+qX1Ys2FS9saLuKyaP89HVy37MEcuk/Xco=; b=G4kHutGyCqJEuPhcsLcsauyDe4w9GvTHgYUaMGdN57bVSTPeTGufLT7el1vgUwS4FY 8TaTJ2iBmqwm7vU6TdMw1UHtnUOvFMGTg8FrY0+k7tWusXHl8V8adan/6IXEDMfXGiH8 zNbUbnaKZTDgd6wquzJPumF6NzlqlK02RyJYM= 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=eX7WTuqwg+qX1Ys2FS9saLuKyaP89HVy37MEcuk/Xco=; b=rhHqkVhk3sCZ9d9ECPAiOc4X43Sy+bGFDWwgk2Thx9gV41bhAfZD623dTpJ1OoXFag da6afxmf0Ujl0hBOIMiPq27EtyReZiEaFE/V9JCwhUCAGCVXU0PB+T+oM6MJOWpMoZB8 RE/LEztqxM1z/NEG9OHRfyQYS2NkirrSZiQmWHA0qeyJyVBxg0WgT4FlsleX+8Ig9FD5 iTaHzlX4Y2MvyU0bUWvIcospu2OJTJekIl2CmzS3pMcapb4IFD+MpPNNhQ5SrN4oPn+K uRrtsVl2X0PggTMcHV0Z0TUEFn6aDNjqWfXCUFsLKvnBsROGobOOu9L55NywLF0wFx3R gfKA== X-Gm-Message-State: APzg51B7icsfsfg8Rexzscrp/v9xq3NlwzrcPOcwLVBpojW1mOjw+/k2 +eKGHkTUkCE36SYcpN006AYKCBTJmEs3SQ== X-Received: by 2002:a50:acc6:: with SMTP id x64-v6mr29336389edc.152.1537018155432; Sat, 15 Sep 2018 06:29:15 -0700 (PDT) Received: from mba13.kuq.prv ([194.138.39.100]) by smtp.gmail.com with ESMTPSA id j23-v6sm4449262edh.29.2018.09.15.06.29.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Sep 2018 06:29:14 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Sat, 15 Sep 2018 15:28:59 +0200 Message-Id: <20180915132859.25727-8-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180915132859.25727-1-ard.biesheuvel@linaro.org> References: <20180915132859.25727-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 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 , Andrew Fish , 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 ff2418c5ae5e..c473006813fe 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 @@ -228,8 +227,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 63e650ee7c27..a969b869b331 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.inf +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf @@ -161,7 +161,6 @@ gEfiLoadedImageProtocolGuid ## PRODUCES gEfiLoadedImageDevicePathProtocolGuid ## PRODUCES gEfiHiiPackageListProtocolGuid ## SOMETIMES_PRODUCES - gEfiEbcProtocolGuid ## SOMETIMES_CONSUMES gEfiSmmBase2ProtocolGuid ## SOMETIMES_CONSUMES gEfiBlockIoProtocolGuid ## SOMETIMES_CONSUMES gEdkiiPeCoffImageEmulatorProtocolGuid ## SOMETIMES_CONSUMES diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 0a4bb3644af0..902a44455fdd 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -66,7 +66,6 @@ LOADED_IMAGE_PRIVATE_DATA mCorePrivateImage = { NULL, // JumpBuffer NULL, // JumpContext 0, // Machine - NULL, // Ebc NULL, // PeCoffEmu NULL, // RuntimeData NULL // LoadedImageDevicePath @@ -83,9 +82,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"}, @@ -705,51 +701,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), @@ -939,13 +899,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.