From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.1898.1678137984252750213 for ; Mon, 06 Mar 2023 13:26:27 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=TJjApg2t; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: andrei.warkentin@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678137987; x=1709673987; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BclfaSYKplhpVrC7OcXoLTmA2tn1uvGwKI3VpUSDHTg=; b=TJjApg2t84PnCO74IKH3zBNT574oQLyfpA/6gMGs1DKdsSOR0bIVWBZB oRdDBODkIUcQdDcU7rwmMOxLb39A00d/t6Th0/yBxHEqB7frKzSrcomnG YOBxQD1PfJIV7b1GsTf/lVDJAQWJ6zthCi/fRV2gkNAeImq2GfhRl2Gux FjozfvQhZmwYLAA8xf9SzbakgFqh8sD8gQsBUv5bGS67YyU3TrUW+oFm/ C9kTHCul8Fthwhz5JXkRutB9gZYbP9Ib9Wceum70/sPXpAi7jndtvgBjs ctvIcgckvSCXSqoPggjyWvbdBD69Hb5RDWguxnJDqxt3yoIzhSRPa8fJg g==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="315335542" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="315335542" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 13:26:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="819444257" X-IronPort-AV: E=Sophos;i="5.98,238,1673942400"; d="scan'208";a="819444257" Received: from awarkent-mobl1.amr.corp.intel.com ([10.212.90.17]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 13:26:26 -0800 From: "Andrei Warkentin" To: devel@edk2.groups.io Cc: Andrei Warkentin , Sunil V L , Daniel Schaefer , Michael D Kinney , Liming Gao , Zhiguang Liu Subject: [edk2 2/7] MdePkg: BasePeCoffLib: Allow AArch64 and x64 images in ImageFormatSupported Date: Mon, 6 Mar 2023 15:26:10 -0600 Message-Id: <20230306212615.7400-3-andrei.warkentin@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230306212615.7400-1-andrei.warkentin@intel.com> References: <20230306212615.7400-1-andrei.warkentin@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARM64 and X64 may allow such foreign images to be used when driver implementing EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL is present. Cc: Sunil V L Cc: Daniel Schaefer Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Andrei Warkentin --- MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c b/MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c index adbfe9ccf580..0e9ee395dc26 100644 --- a/MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c +++ b/MdePkg/Library/BasePeCoffLib/RiscV/PeCoffLoaderEx.c @@ -104,7 +104,14 @@ PeCoffLoaderImageFormatSupported ( IN UINT16 Machine ) { - if (Machine == IMAGE_FILE_MACHINE_RISCV64) { + /* + * ARM64 and X64 may allow such foreign images to be used when + * a driver implementing EDKII_PECOFF_IMAGE_EMULATOR_PROTOCOL is + * present. + */ + if (Machine == IMAGE_FILE_MACHINE_RISCV64 || + Machine == IMAGE_FILE_MACHINE_ARM64 || + Machine == IMAGE_FILE_MACHINE_X64) { return TRUE; } -- 2.25.1