From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 26084AC09D7 for ; Mon, 2 Sep 2024 02:49:25 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=iHBhTYnR26OQYD7PbP+zdD/wcjbGnQGoVGgA3l/aMVs=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240830; t=1725245365; v=1; x=1725590964; b=uh8JT7GMy9GulhwUN5TdQdUwOlC4kBNyhAjkgx8OumGDSXX1Io4kXlrpjM6q2ordBqrnoTKL HKbNOtR0Nk9MDOl4Ar7Zit9a0wHTQb9qEWzvjEP0OSK6olY4kuIHbeg5s3m1JI7lzEWFy+W2Hmy y6W5X6ApmGwkOMKTCICZ6pHj8ZDuyEi2va/8RXa+kaYUn72faYoAIkoLVqI+9TdBqnaKQjjflUA t6FeHTGtF3Llv+W0vKwU8EvWRoNKh8699kbYa9L0YRyqlUAfn9vVVLUP0AfpcL16uNXSQw6CCyz YWjQUOXkbHiDCrAgfoyMc+QSwokHis22PSHu6gTgwsxPg== X-Received: by 127.0.0.2 with SMTP id pUseYY7687511xW4bpOUxq4j; Sun, 01 Sep 2024 19:49:24 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.30170.1725245362635451136 for ; Sun, 01 Sep 2024 19:49:23 -0700 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8Dxi+qtJ9Vm0+wnAA--.13324S3; Mon, 02 Sep 2024 10:49:17 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by front2 (Coremail) with SMTP id qciowMAxQMapJ9VmxaADAA--.10460S3; Mon, 02 Sep 2024 10:49:14 +0800 (CST) Message-ID: Date: Mon, 2 Sep 2024 10:49:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH] Emulator/X86EmulatorDxe: Replace with MultiArchUefiPkg build To: devel@edk2.groups.io, ardb@kernel.org, Rebecca Cran , "Warkentin, Andrei" Cc: quic_llindhol@quicinc.com, michael.d.kinney@intel.com References: <20240831223232.59981-1-rebecca@bsdio.com> From: "Chao Li" In-Reply-To: X-CM-TRANSID: qciowMAxQMapJ9VmxaADAA--.10460S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAgEICGbUWRwEkAABsh X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sun, 01 Sep 2024 19:49:23 -0700 Resent-From: lichao@loongson.cn Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: DoRH8Ug3dH84IUHamVauYUQex7686176AA= Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=uh8JT7GM; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io

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=3D\"config-target-$(UNICORN_EMU_ARCH).h\"". If it is stored in cc_resp.txt, the format will become: "DCONFIG_TARGET_HEADER=3D/"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 mo=
re 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 byt=
es
 Emulator/X86EmulatorDxe/AArch64/LoadOpRom.efi     | Bin 0 -> 28672 byte=
s
 Emulator/X86EmulatorDxe/README.md                 |  11 +++++++----
 Emulator/X86EmulatorDxe/RISCV64/EmulatorDxe.depex | Bin 0 -> 54 bytes
 Emulator/X86EmulatorDxe/RISCV64/EmulatorDxe.efi   | Bin 0 -> 561216 byt=
es
 Emulator/X86EmulatorDxe/RISCV64/LoadOpRom.efi     | Bin 0 -> 30848 byte=
s
 Emulator/X86EmulatorDxe/X86EmulatorDxe.depex      | Bin 36 -> 0 bytes
 Emulator/X86EmulatorDxe/X86EmulatorDxe.efi        | Bin 913408 -> 0 byt=
es
 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:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#120463) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_