From: Richard Purdie Date: Fri, 8 Jan 2021 17:27:06 +0000 (+0000) Subject: qemu: Add some user space mmap tweaks to address musl 32 bit build issues X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~9140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18a37fcd7c0a64a339d1eea88b16ba75c017c5d5;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git qemu: Add some user space mmap tweaks to address musl 32 bit build issues Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 286901fb1f0..cfa65f99d04 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc @@ -27,6 +27,8 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ file://0001-Add-enable-disable-udev.patch \ file://0001-qemu-Do-not-include-file-if-not-exists.patch \ file://mingwfix.patch \ + file://mmap.patch \ + file://mmap2.patch \ " UPSTREAM_CHECK_REGEX = "qemu-(?P\d+(\.\d+)+)\.tar" diff --git a/meta/recipes-devtools/qemu/qemu/mmap.patch b/meta/recipes-devtools/qemu/qemu/mmap.patch new file mode 100644 index 00000000000..0f7d2ce04c2 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/mmap.patch @@ -0,0 +1,29 @@ +If mremap() is called without the MREMAP_MAYMOVE flag with a start address +just before the end of memory (reserved_va) where new_size would exceed +GUEST_ADD_MAX, the assert(end - 1 <= GUEST_ADDR_MAX) in page_set_flags() +would trigger. + +Add an extra guard to the guest_range_valid() checks to prevent this and +avoid asserting binaries when reserved_va is set. + +This meant a test case now gives the same behaviour regardless of whether +reserved_va is set or not. + +Upstream-Status: Pending +Signed-off-by: Richard Purdie