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 858407803D8 for ; Fri, 6 Sep 2024 14:22:45 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=9i7X/IOxjXBUhr0vTqLD5HGd4rnyW0Yo+RiiJyBUen4=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:User-Agent:Subject:To:Cc:References:From:In-Reply-To:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240830; t=1725632565; v=1; x=1725891763; b=IdiXlt2vvOd4XceZvWFFsqY6t6q37zi05wmDzEWqlWSYbFi0SAxPUE2NIqzWQ2xw62FaaVmR vvlASOCVcdMsZ5A3YxyXcm14efZFrC2Q4gG9EJ1QxOt3K7mG1wDwHN4mwtULK6yT2Jka0QaO0ua wfDlz1TPlkIrl8AsPvLJMz/PIqRTePzB3Z1qhgWwvLDwnijTbbOrC68q6Ov+un7amBVaXmNqFPO Oo5Do8apry5xROBNHbtyplXTNn5PWzw25dbWx+J2okyoYWycMivkv5mdot+dcyxAcSKuKvir9u/ nP/nAFG6hmhEH6awWvejzS1lBPElqvQGwKUSaULVVN/bg== X-Received: by 127.0.0.2 with SMTP id TYveYY7687511xR9cClUVj6T; Fri, 06 Sep 2024 07:22:43 -0700 X-Received: from SN4PR2101CU001.outbound.protection.outlook.com (SN4PR2101CU001.outbound.protection.outlook.com [40.93.195.131]) by mx.groups.io with SMTP id smtpd.web10.82.1725632563015372929 for ; Fri, 06 Sep 2024 07:22:43 -0700 X-Received: from LV3PR01MB8464.prod.exchangelabs.com (2603:10b6:408:1a3::7) by BN0PR01MB7039.prod.exchangelabs.com (2603:10b6:408:16e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.17; Fri, 6 Sep 2024 14:22:40 +0000 X-Received: from LV3PR01MB8464.prod.exchangelabs.com ([fe80::74dd:8ddd:b9c2:8d2d]) by LV3PR01MB8464.prod.exchangelabs.com ([fe80::74dd:8ddd:b9c2:8d2d%6]) with mapi id 15.20.7918.024; Fri, 6 Sep 2024 14:22:40 +0000 Message-ID: <1b111e7f-7153-474b-8656-53ce289abb2a@os.amperecomputing.com> Date: Fri, 6 Sep 2024 08:22:37 -0600 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH] Emulator/X86EmulatorDxe: Replace with MultiArchUefiPkg build To: devel@edk2.groups.io, andrei.warkentin@intel.com, Ard Biesheuvel , Rebecca Cran Cc: "quic_llindhol@quicinc.com" , "Kinney, Michael D" References: <20240831223232.59981-1-rebecca@bsdio.com> From: "Rebecca Cran via groups.io" In-Reply-To: X-ClientProxiedBy: BY1P220CA0017.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:5c3::6) To LV3PR01MB8464.prod.exchangelabs.com (2603:10b6:408:1a3::7) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV3PR01MB8464:EE_|BN0PR01MB7039:EE_ X-MS-Office365-Filtering-Correlation-Id: cf56166d-62ae-45e2-959f-08dcce7f5d69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Message-Info: =?utf-8?B?WGkzUnl5TWYrbU9ZQ01OY2lER3RiMEZ2ZzR5YXlKaks0TEFVK3JBYmg3ajdt?= =?utf-8?B?OXZzY0FZOHJpMGhMZU1KMm9ET0RwTmNEaXFsVmx0emtXbTM2YWJkZXVGVGRl?= =?utf-8?B?T1lqMUg2K1FWZ0hJZEFPc2VTUEEzSFpjNE9EaGZ4bmFSblZYOGhrdFNnZjBv?= =?utf-8?B?UkpiVHljcnFwS3RzUFRhSi9RZVFqaGZ3RDloOGtlVDcxRkV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1NRaTV0eVFzTTF5S1Rva3RqZjRN?= =?utf-8?B?ei80VnU1R3EwMDFRZjRrVnRyS09Bc1Bnakdhb1BTOGxPNVJyWWE5cWJGcGk4?= =?utf-8?B?d2dhNEk2QVNENi9JNUEwMU45NHFLbEpzNGhlL1IzQ1o4WjlOMHozT0xvSkFJ?= =?utf-8?B?WnFySjIyME16eVBYOHk4MmlQR0U0am5rR1EyMnJPbG4za1k4dWx0bjdWZmpu?= =?utf-8?B?NWphMWNvWDh4ZmxwTUhXbE01TGhMR2hKQlJ5OVdramF4YTZocENRTEQvQmRz?= =?utf-8?Q?dcFUGyaZ88s51tvpguEfJuY=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: cf56166d-62ae-45e2-959f-08dcce7f5d69 X-MS-Exchange-CrossTenant-AuthSource: LV3PR01MB8464.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2024 14:22:40.5372 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WFhYNKbOUgBgLLCpHr1bygtPv9YhBpmbH+yjuXKA7al6M1JW8uAJNlJ8PDqPXsC9NoVvdEAR+HZRKZfSjleDlJhvzLWbDtxWJh+HjRpMYN47SlbLc090rHO9Hj6sySv5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR01MB7039 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: Fri, 06 Sep 2024 07:22:43 -0700 Resent-From: rebecca@os.amperecomputing.com Reply-To: devel@edk2.groups.io,rebecca@os.amperecomputing.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: C44G2nw94H82LPa0UI4yLByhx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed 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=IdiXlt2v; dmarc=pass (policy=none) header.from=groups.io; 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 Andrei, I've been talking to a few people about X86EmulatorPkg and their=20 experience with it hasn't been positive: apparently there are lots of=20 cases where it's failed to work (i.e. caused crashes) which is why it's=20 not been more widely used. Since suggesting they try MultiArchUefiPkg they've said it's working=20 much better, and in fact some people have proceeded with enabling it in=20 their firmware. I'm a bit confused about the licensing of MultiArchUefiPkg given the=20 license file says it's LGPL while it uses the GPL-licensed Unicorn library. Does that mean the overall licensing for it will be GPL? --=20 Rebecca On 9/5/2024 11:32 PM, Andrei Warkentin via groups.io wrote: > Hey folks, > > Sorry for the late response. > > - My suggestion is not to replace, but augment. MultiArchUefiPkg is fairl= y new, not particularly well adopted, surely with some flaws lurking here a= nd there and for certain with no guarantee of fitness or proof that it will= work 100% or 100% better than X86EmulatorPkg for every single use case of = X86EmulatorPkg in the wild. X86EmulatorPkg has been around for a lot longer= than its rewrite, and I think the people actively using X86EmulatorPkg sho= uld continue to have the option to continue using it. > > - Unicorn has been a blessing and a curse, although abstracting the emula= tor with an API seems like a winner. An API-compatible emulator or JIT is s= omething I've been thinking about, but not really doing anything about it f= or the moment. So yes, actual licensing of binaries is cursed. > > - All memory but the zero page is visible to the emulator. See CpuNullRea= dCb/CpuNullWriteCb. See also TestNullDeref in Application/EmulatorTest. I d= on't remember if I added the behavior because this is what the original did= , or because I actively tripped on the NULL accesses from some x86 code I w= as testing... > > A > >> -----Original Message----- >> From: Ard Biesheuvel >> Sent: Sunday, September 1, 2024 3:05 AM >> To: Rebecca Cran ; Warkentin, Andrei >> >> Cc: devel@edk2.groups.io; quic_llindhol@quicinc.com; Kinney, Michael D >> >> Subject: Re: [PATCH] Emulator/X86EmulatorDxe: Replace with >> MultiArchUefiPkg build >> >> Hi Rebecca, >> >> On Sun, 1 Sept 2024 at 00:33, Rebecca Cran 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 >>> --- >>> 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 bu= ilds, >> which are a mix of LPGL and GPLv2, so you will need to update the LICENS= E >> file accordingly. >> >> Also, glancing over the code, it seems like it removes the NULL pointer >> dereference handling that the original X86EmulatorPkg has - this code wa= s >> 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? > >=20 > > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120521): https://edk2.groups.io/g/devel/message/120521 Mute This Topic: https://groups.io/mt/108202804/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-