Hi Andrei,

I guss I workaroud it in a not very pertty way: add a line "RespDict[Key] = Value.replace('\\"', '\\"')" under line 901 of "BaseTools/Source/Python/AutoGen/GenMake.py", it works fine.

About LoongArch tcg porting, I still have some issue to debug, it doesn't work very reliably. Once this work is done, I will submit the code to MUA and unicorn-for-efi. In my opinion, the TCI is also very helpful if the ARCH doesn't support TCG in unicorn. :)


Thanks,
Chao
On 2024/9/6 13:41, Andrei Warkentin wrote:

Hi Chao,

 

Yikes. Let me poke at this on my end as well and see if I can do something less hacky. Meanwhile, you’re welcome to propose pull requests for LoongArch support to either the MUA or the Unicorn-for-efi repo (I was thinking of backporting TCI TCG backend to unicorn as a fallback for unsupported arches).

 

A

 

From: Chao Li <lichao@loongson.cn>
Sent: Sunday, September 1, 2024 9:49 PM
To: devel@edk2.groups.io; ardb@kernel.org; Rebecca Cran <rebecca@bsdio.com>; Warkentin, Andrei <andrei.warkentin@intel.com>
Cc: quic_llindhol@quicinc.com; Kinney, Michael D <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH] Emulator/X86EmulatorDxe: Replace with MultiArchUefiPkg build

 

Hi Ard and Rebecca,

Actually, I am working on this project to support LoongArch, and some work has not been completed yet. But I found that Basetools has a bug. If the command line parameter is greater than 4096, it will be saved using cc_resp.txt. However, https://github.com/intel/unicorn-for-efi/blob/main/efi/UnicornX86Lib.inf contains a C language escape character "DCONFIG_TARGET_HEADER=\"config-target-$(UNICORN_EMU_ARCH).h\"". If it is stored in cc_resp.txt, the format will become: "DCONFIG_TARGET_HEADER=/"config-target-$(UNICORN_EMU_ARCH).h/"", which will cause the compiler to fail to replace the correct header file name during the preprocessing stage and prompt "File not found". I am trying to find a solution in Basetools, but there is no result now.

 

Thanks,
Chao

On 2024/9/1 16:05, Ard Biesheuvel via groups.io wrote:

Hi Rebecca,
 
On Sun, 1 Sept 2024 at 00:33, Rebecca Cran <rebecca@bsdio.com> wrote:
 
Replace the old X86EmulatorDxe with one built from
https://github.com/intel/MultiArchUefiPkg. This is a much more modern,
recent implementation that's more reliable and is actively maintained.
 
Add driver binaries for both AArch64 and RISCV64, along with the
LoadOpRom application.
 
Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
---
 Emulator/X86EmulatorDxe/AArch64/EmulatorDxe.depex | Bin 0 -> 54 bytes
 Emulator/X86EmulatorDxe/AArch64/EmulatorDxe.efi   | Bin 0 -> 573440 bytes
 Emulator/X86EmulatorDxe/AArch64/LoadOpRom.efi     | Bin 0 -> 28672 bytes
 Emulator/X86EmulatorDxe/README.md                 |  11 +++++++----
 Emulator/X86EmulatorDxe/RISCV64/EmulatorDxe.depex | Bin 0 -> 54 bytes
 Emulator/X86EmulatorDxe/RISCV64/EmulatorDxe.efi   | Bin 0 -> 561216 bytes
 Emulator/X86EmulatorDxe/RISCV64/LoadOpRom.efi     | Bin 0 -> 30848 bytes
 Emulator/X86EmulatorDxe/X86EmulatorDxe.depex      | Bin 36 -> 0 bytes
 Emulator/X86EmulatorDxe/X86EmulatorDxe.efi        | Bin 913408 -> 0 bytes
 Emulator/X86EmulatorDxe/X86EmulatorDxe.inf        |  10 +++++++---
 10 files changed, 14 insertions(+), 7 deletions(-)
 
 
Happy to see that this work has been absorbed into a project that will
improve and maintain it going forward.
 
However, according to the github.com repo Readme of
MultiArchUefiCpuPkg, these binaries include statically linked UniCorn
builds, which are a mix of LPGL and GPLv2, so you will need to update
the LICENSE file accordingly.
 
Also, glancing over the code, it seems like it removes the NULL
pointer dereference handling that the original X86EmulatorPkg has -
this code was added for a purpose, as some Nvidia option ROMs will
happily dereference NULL pointers, which happens to work on most older
X64 firmware because page 0x0 happens to be mapped. Perhaps Andrei can
comment on this point?
 
 
 
_._,_._,_

Groups.io Links:

You receive all messages sent to this group.

View/Reply Online (#120520) | | Mute This Topic | New Topic
Your Subscription | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_