On 10/22/24 02:50, Ilya Leoshkevich wrote:
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -2898,7 +2898,7 @@ static uintptr_t pgb_try_itree(const PGBAddrs
*ga, uintptr_t base,
static uintptr_t pgb_find_itree(const PGBAddrs *ga, IntervalTreeRoot
*root,
uintptr_t align, uintptr_t brk)
{
- uintptr_t last = mmap_min_addr;
+ uintptr_t last = sizeof(uintptr_t) == 4 ? MiB : GiB;
uintptr_t base, skip;
while (true) {
But just for my understanding, what is wrong with the current approach?
The intention here is to fix the weird case without affecting the happy
path.
Once the identity map fails, the magnitude of guest_base does not matter. I've always
been a bit uncomfortable with butting right up against mmap_min_addr.
It also looks natural to try the fallback once the normal
handling fails.
The normal path is supposed to have complete knowledge of the address space. There should
be no need to fall back to blind probing. To me that does not seem natural at all.
r~