]> git.proxmox.com Git - mirror_qemu.git/commit
linux-user: Rewrite non-fixed probe_guest_base
authorRichard Henderson <richard.henderson@linaro.org>
Mon, 7 Aug 2023 05:26:10 +0000 (22:26 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Tue, 8 Aug 2023 20:41:55 +0000 (13:41 -0700)
commitdd55885516f42f718d0d121c59a5f7be5fdae3e6
treecf9d586a0f3b969c5935c34145840e8187078d1d
parent06f38c6688f8b7dcf65377b3302e45bfecc5e060
linux-user: Rewrite non-fixed probe_guest_base

Use pgb_addr_set to probe for all of the guest addresses,
not just the main executable.  Handle the identity map
specially and separately from the search.

If /proc/self/maps is available, utilize the full power
of the interval tree search, rather than a linear search
through the address list.

If /proc/self/maps is not available, increase the skip
between probes so that we do not probe every single page
of the host address space.  Choose 1 MiB for 32-bit hosts
(max 4k probes) and 1 GiB for 64-bit hosts (possibly a
large number of probes, but the large step makes it more
likely to find empty space quicker).

Tested-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
linux-user/elfload.c