From patchwork Wed Sep 12 13:21:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 146562 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4825497ljw; Wed, 12 Sep 2018 06:22:43 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbZxpuRdVudewnO64Fbe+IP9GCrNtzMVZsXbKtsl0z8pZfH+uMrKhOkyDIkNVYENykaJ4rr X-Received: by 2002:a63:1021:: with SMTP id f33-v6mr2310853pgl.72.1536758563687; Wed, 12 Sep 2018 06:22:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536758563; cv=none; d=google.com; s=arc-20160816; b=J4FGQMVT91dwCN5+Le+C/F04TmVzUlSOVgsho2OnmT7JrAGzxDkqGnGEH6ctgTeFvF rxA+lSRbMHjyge1A/6l5vCPdeTxd3WmphRJ5K374c4kCMCkDNnfqMn1gLSuUhFuVbJcZ +R9Xg1WgEIGFpP2bYn9NPjhvapwQgoYVgH3p5gLaDSYo24IRIhnKXpqqbeOF4UObfFLB WRTzP+B/avIhOtwqR2nliFqDFM3meJT+uAhjoWS3cWdd6TUklYv7FG6dfhcg/1YkogkB LEqSQdVvdlVWa4IJ/XJcMiMNQcvbCO+vnhqJAsE4iM9/Cz+qeaN8RtsJX8PLf2V+dk4t Vozg== 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:message-id:date:to:from:dkim-signature :delivered-to; bh=RtEdAv/IaEjbN3gg9LV6RJtvb74x5U2T1CMt+HSjhX0=; b=oqA6D4majFr2vM8oiI6h+2JDllgQN3AVYH1X1VoqAmQeA7ZmZb9KWt56mKUGFYEOFA lXfVHclD+JGHfKCiQnSgz14QIF0wqiE94FL5vdBuR7dfKsAJpzcvUTFV+5GgJSag9Wgp vN73zKBK+5HZg+mdjJhbB+vWSqjAuovpfcuRhjhylhziDIkcY96b+Lh2q8HLxeLd9rRH tL0jIZGiV295xSNhj52Nr+GWcClNrdeYBOFAhxyyoWcQTYOmo0Zn+1ia13IqssiDeINU rCUWVZPzaB2Tu7oK+zgB06opuY9MmRCIyAmM8JxukMhV9SW4+GO8HUtrzoCwnBqJEq94 5U/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AdcuvErA; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id v4-v6si988141plb.400.2018.09.12.06.22.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 06:22:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=AdcuvErA; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 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 D0AD72112A2B7; Wed, 12 Sep 2018 06:22:42 -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:400c:c09::244; helo=mail-wm0-x244.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 4C7A921A00AE6 for ; Wed, 12 Sep 2018 06:22:41 -0700 (PDT) Received: by mail-wm0-x244.google.com with SMTP id s12-v6so2411729wmc.0 for ; Wed, 12 Sep 2018 06:22:40 -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; bh=M/F0h94nHXTs66yCZozaAw+uRiie9rUHqlBLie07EqE=; b=AdcuvErAD2FnGltkGqYTP4D098HsEDPNh47EUUrv7gUd5FTEhfu5caMSImNB8yBV25 88VKDA3Bbzuiw6J+8vJV4oKTQR9Rxldk3HKYEwQDzNLdg4zeb/20WnGqYCzp1QQobCvC uizd4OjSxSI5LlrVF+xMqv7o0SggZI73Z+Jr4= 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; bh=M/F0h94nHXTs66yCZozaAw+uRiie9rUHqlBLie07EqE=; b=k5KDkmHhS1W5RVsPVgU5ZkwRynqZzfsculNxL5z6LMFtgPGhA4i4PLCi+qlrtMt5TH 2CIcYZrLpZ7rg6379fXmIqrgSH4gufix7uHSo8BUpSH39s4NbZWlMs6UsuBqvvDJT+ii iPPHRbhG2DmgwjZBuAXXJHkLUkD1ryf2JP619B0KF2LuXGpAZyg5BJ8I0bOthGPLISdH RSywczPCaCskPeSdFLQlR685mz9/7kW0Zaj3sm8vY/AdpVxHPhwEPwZLK83GnRz24M06 H8eSts4wE63Qv4BR4OqXlNR+U5s3o1uAEMGLcb5+YwmdkoVVaCIR/CHe6an1aUgMu5cW 69wQ== X-Gm-Message-State: APzg51At3q0uBaoWkkL9E/n2sNeyCJZ8RlRDcSktEui41uHMuJverrUv Hq9+xgWjgDFPNOO9VlUOYUs4Cydm9NPv/A== X-Received: by 2002:a1c:1314:: with SMTP id 20-v6mr1643996wmt.55.1536758559032; Wed, 12 Sep 2018 06:22:39 -0700 (PDT) Received: from mba13.kuq.prv ([2001:a62:605:90f4:1f3:d690:1764:36ca]) by smtp.gmail.com with ESMTPSA id e133-v6sm1985129wma.33.2018.09.12.06.22.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 06:22:38 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Wed, 12 Sep 2018 15:21:47 +0200 Message-Id: <20180912132151.4258-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [edk2] [PATCH 0/4] MdeModulePkg: add support for dispatching foreign arch PE/COFF images 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 , Zimmer Vincent , Eric Dong , Andrew Fish , agraf@suse.de, Brian Richardson , Michael D Kinney , Laszlo Ersek , Star Zeng MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Add the basic plumbing to DXE core, the PCI bus driver and the boot manager to allow PE/COFF images to be dispatched that target an architecture that is not native for the platform, but which is supported by an emulator. One implementation of such an emulator can be found here: https://github.com/ardbiesheuvel/X86EmulatorPkg Cc: Zimmer Vincent Cc: Brian Richardson Cc: Michael D Kinney Cc: Andrew Fish Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Star Zeng Cc: Eric Dong Cc: Ruiyu Ni Ard Biesheuvel (4): MdeModulePkg: introduce PE/COFF image emulator protocol MdeModulePkg/DxeCore: invoke the emulator protocol for foreign images MdeModulePkg/PciBusDxe: invoke PE/COFF emulator for foreign option ROMs MdeModulePkg/UefiBootManagerLib: allow foreign Driver#### images MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.h | 1 + MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf | 1 + .../Bus/Pci/PciBusDxe/PciOptionRomSupport.c | 16 +++++- MdeModulePkg/Core/Dxe/DxeMain.h | 3 ++ MdeModulePkg/Core/Dxe/DxeMain.inf | 1 + MdeModulePkg/Core/Dxe/Image/Image.c | 39 +++++++++++--- .../Include/Protocol/PeCoffImageEmulator.h | 51 +++++++++++++++++++ .../Library/UefiBootManagerLib/BmLoadOption.c | 26 +++++++++- .../Library/UefiBootManagerLib/InternalBm.h | 1 + .../UefiBootManagerLib/UefiBootManagerLib.inf | 1 + MdeModulePkg/MdeModulePkg.dec | 4 ++ 11 files changed, 136 insertions(+), 8 deletions(-) create mode 100644 MdeModulePkg/Include/Protocol/PeCoffImageEmulator.h -- 2.17.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Jaben Carsey