summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@amd.com>2024-01-09 16:25:47 -0700
committerMark Hatle <mark.hatle@amd.com>2024-01-22 16:31:34 -0700
commit6f7edbe3de0e879e5690d5ec13e21e54d5334b7f (patch)
treee494d0f124934f2edaea945485239ada6c235df6 /meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch
parente7caaf9739e4075721e44f602b7dd44ccb585666 (diff)
downloadmeta-xilinx-6f7edbe3de0e879e5690d5ec13e21e54d5334b7f.tar.gz
qemu: Update to qemu 8.1.0
Backport the QEMU 8.1.x integration from current poky (commit 4bb222e0d71a4cb159b8a4f1a90b65b1af32ac10). Add Xilinx specific integration. Add required libslirp recipe from current poky. Also update the qemu-devicetree to the latest version. Signed-off-by: Mark Hatle <mark.hatle@amd.com>
Diffstat (limited to 'meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch')
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch
new file mode 100644
index 00000000..5d1d7c68
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch
@@ -0,0 +1,49 @@
1From 375cae3dd6151ef33cae8f243f6a2c2da6c0c356 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Fri, 8 Jan 2021 17:27:06 +0000
4Subject: [PATCH 06/12] qemu: Add some user space mmap tweaks to address musl
5 32 bit
6
7When using qemu-i386 to build qemux86 webkitgtk on musl, it sits in an
8infinite loop of mremap calls of ever decreasing/increasing addresses.
9
10I suspect something in the musl memory allocation code loops indefinitely
11if it only sees ENOMEM and only exits when it hits EFAULT.
12
13According to the docs, trying to mremap outside the address space
14can/should return EFAULT and changing this allows the build to succeed.
15
16A better return value for the other cases of invalid addresses is EINVAL
17rather than ENOMEM so adjust the other part of the test to this.
18
19Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg01355.html]
20Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org
21
22---
23 linux-user/mmap.c | 10 +++++++---
24 1 file changed, 7 insertions(+), 3 deletions(-)
25
26Index: qemu-8.0.0/linux-user/mmap.c
27===================================================================
28--- qemu-8.0.0.orig/linux-user/mmap.c
29+++ qemu-8.0.0/linux-user/mmap.c
30@@ -776,12 +776,16 @@ abi_long target_mremap(abi_ulong old_add
31 int prot;
32 void *host_addr;
33
34- if (!guest_range_valid_untagged(old_addr, old_size) ||
35- ((flags & MREMAP_FIXED) &&
36+ if (!guest_range_valid_untagged(old_addr, old_size)) {
37+ errno = EFAULT;
38+ return -1;
39+ }
40+
41+ if (((flags & MREMAP_FIXED) &&
42 !guest_range_valid_untagged(new_addr, new_size)) ||
43 ((flags & MREMAP_MAYMOVE) == 0 &&
44 !guest_range_valid_untagged(old_addr, new_size))) {
45- errno = ENOMEM;
46+ errno = EINVAL;
47 return -1;
48 }
49