[edk2-devel] [edk2 2/7] MdePkg: BasePeCoffLib: Allow AArch64 and x64 images in ImageFormatSupported

Andrei Warkentin andrei.warkentin at intel.com
Mon Mar 6 21:26:10 UTC 2023


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 <sunilvl at ventanamicro.com>
Cc: Daniel Schaefer <git at danielschaefer.me>
Cc: Michael D Kinney <michael.d.kinney at intel.com>
Cc: Liming Gao <gaoliming at byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu at intel.com>
Signed-off-by: Andrei Warkentin <andrei.warkentin at intel.com>
---
 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100761): https://edk2.groups.io/g/devel/message/100761
Mute This Topic: https://groups.io/mt/97436049/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list