linux-user: expand reserved brk space for 64bit guests
authorAlex Bennée <alex.bennee@linaro.org>
Thu, 13 Jan 2022 16:55:50 +0000 (16:55 +0000)
committerAlex Bennée <alex.bennee@linaro.org>
Tue, 18 Jan 2022 16:44:05 +0000 (16:44 +0000)
commit11d3672788b48548811810bdc0f3f7969662572d
treedc24c5f66ea681dd140c5ee1e254abfba3762c98
parent3918fe16b0f8c6657928a14f41b7ff50061e33e1
linux-user: expand reserved brk space for 64bit guests

A recent change to fix commpage allocation issues on 32bit hosts
revealed another intermittent issue on s390x. The root cause was the
headroom we give for the brk space wasn't enough causing the guest to
attempt to map something on top of QEMUs own pages. We do not
currently do anything to protect from this (see #555).

By inspection the brk mmap moves around and top of the address range
has been measured as far as 19Mb away from the top of the binary. As
we chose a smallish number to keep 32bit on 32 bit feasible we only
increase the gap for 64 bit guests. This does mean that 64-on-32
static binaries are more likely to fail to find a hole in the address
space but that is hopefully a fairly rare situation.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220113165550.4184455-1-alex.bennee@linaro.org>
linux-user/elfload.c