From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.5673.1677196505855436099 for ; Thu, 23 Feb 2023 15:55:11 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=hRVzk/YB; spf=pass (domain: intel.com, ip: 134.134.136.20, 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=1677196511; x=1708732511; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=BclfaSYKplhpVrC7OcXoLTmA2tn1uvGwKI3VpUSDHTg=; b=hRVzk/YBuy1wxj0DzkJPTXjEkTT1yz2sAiJqhvWE6+Whb7qpMHTl1dAW 2FDHgH5MPj3z+Co4Mo0yq+FA8ARij8pcYyt9nviubPImt2Y/5s9X8Fzbw paMuC+89QuN3poW6BZAeqZzsiL7RLQH62iwJDpaPd0ziUbAovl4GKUDlc tA5n38MaFfWE4hmDd2ujXDxzK5h4kzZFoyip/hyCfF66LeFpvgmJ0hFFs NQOLaGSEXqdglA1HNcUoYAH9m8oiVYm7TzpHYQRAhIQpvBCpbDicmNhYk 6Onpk/E374qHYx7+q+yg2/tdlmtPwUndL8mGLVzXylTa3e/r5vA88fUoL g==; X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="321549940" X-IronPort-AV: E=Sophos;i="5.97,322,1669104000"; d="scan'208";a="321549940" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 15:55:11 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10630"; a="702984464" X-IronPort-AV: E=Sophos;i="5.97,322,1669104000"; d="scan'208";a="702984464" Received: from cywong-mobl.amr.corp.intel.com (HELO awarkent-mobl1.amr.corp.intel.com) ([10.212.53.4]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2023 15:55:10 -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: [PATCH 2/7] MdePkg: BasePeCoffLib: Allow AArch64 and x64 images in ImageFormatSupported Date: Thu, 23 Feb 2023 17:54:49 -0600 Message-Id: <20230223235454.23556-3-andrei.warkentin@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230223235454.23556-1-andrei.warkentin@intel.com> References: <20230223235454.23556-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