|
From: | Akihiko Odaki |
Subject: | Re: [PATCH v6 8/8] linux-user: Load pie executables at upper memory |
Date: | Wed, 2 Aug 2023 18:58:29 +0900 |
User-agent: | Mozilla Thunderbird |
On 2023/08/02 18:34, Helge Deller wrote:
On 8/2/23 10:44, Akihiko Odaki wrote:On 2023/08/02 17:42, Helge Deller wrote:On 8/2/23 09:49, Akihiko Odaki wrote:On 2023/08/02 8:27, Helge Deller wrote:Fix the elf loader to calculate a valid TASK_UNMAPPED_BASE address for all32-bit architectures, based on the GUEST_ADDR_MAX constant. Additionally modify the elf loader to load dynamic pie executables at around: ~ 0x5500000000 for 64-bit guest binaries on 64-bit host, - 0x00300000 for 32-bit guest binaries on 64-bit host, and - 0x00000000 for 32-bit guest binaries on 32-bit host.Why do you change guest addresses depending on the host?The addresses are guest-addresses. A 32-bit guest PIE can't be loaded at e.g. 0x5500000000, while a 64-bit guest PIE needs to be loaded at 0x5500000000.I mean, why do you use address 0x00000000 for 32-bit guest binaries on 32-bit host while you use address 0x00300000 on 64-bit host?To keep the memory pressure for the 32-bit qemu binary minimal. On 64-bit host we have the full 32-bit address space for the guest. Helge
That makes sense. I'm worried that using 0x00000000 may break NULL checks on the guest though.
Regards, Akihiko Odaki
[Prev in Thread] | Current Thread | [Next in Thread] |