summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/qemu
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-06 13:54:33 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-09 09:09:50 +0000
commit7cb670c4a9af7126a58fae7a71aad9526531b02c (patch)
treefde1334ea62a83a5b35d39cdf29090bb65f9bf94 /meta/recipes-devtools/qemu
parent0d298198e57753213391788a8a9204d99648636b (diff)
downloadpoky-7cb670c4a9af7126a58fae7a71aad9526531b02c.tar.gz
qemu: Drop vm reservation changes to resolve build issues
When building with the new version of qemu we see errors like: """ qemu-i386: Unable to reserve 0x7ffff000 bytes of virtual address space at 0x1000 (Success) for use as guest address space (check your virtual memory ulimit setting, min_mmap_addr or reserve less using -R option) ERROR: The postinstall intercept hook 'update_gio_module_cache-nativesdk' failed """ The VM reseration patches we're carrying look suspicious in this context. Drop them since the patches appear to be a liability causing other issues and there is a much simpler fix for the webkitgtk issues on musl on 32 bit (see later linux-user mmap patches). Reviewed-by: Alistair Francis <alistair.francis@wdc.com> (From OE-Core rev: 8a0efb16ca7cf22902fac743718c776b57c6d2f6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/qemu')
-rw-r--r--meta/recipes-devtools/qemu/qemu.inc2
-rw-r--r--meta/recipes-devtools/qemu/qemu/0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch33
-rw-r--r--meta/recipes-devtools/qemu/qemu/0009-Fix-webkitgtk-builds.patch137
3 files changed, 0 insertions, 172 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 23d0adb901..4c1502da7f 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -23,8 +23,6 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
23 file://0004-qemu-disable-Valgrind.patch \ 23 file://0004-qemu-disable-Valgrind.patch \
24 file://0006-chardev-connect-socket-to-a-spawned-command.patch \ 24 file://0006-chardev-connect-socket-to-a-spawned-command.patch \
25 file://0007-apic-fixup-fallthrough-to-PIC.patch \ 25 file://0007-apic-fixup-fallthrough-to-PIC.patch \
26 file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \
27 file://0009-Fix-webkitgtk-builds.patch \
28 file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \ 26 file://0010-configure-Add-pkg-config-handling-for-libgcrypt.patch \
29 file://0001-Add-enable-disable-udev.patch \ 27 file://0001-Add-enable-disable-udev.patch \
30 file://0001-qemu-Do-not-include-file-if-not-exists.patch \ 28 file://0001-qemu-Do-not-include-file-if-not-exists.patch \
diff --git a/meta/recipes-devtools/qemu/qemu/0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch b/meta/recipes-devtools/qemu/qemu/0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch
deleted file mode 100644
index 74621a08e8..0000000000
--- a/meta/recipes-devtools/qemu/qemu/0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From cf8c9aac5243f506a1a3e8e284414f311cde04f5 Mon Sep 17 00:00:00 2001
2From: Alistair Francis <alistair.francis@xilinx.com>
3Date: Wed, 17 Jan 2018 10:51:49 -0800
4Subject: [PATCH] linux-user: Fix webkitgtk hangs on 32-bit x86 target
5
6Since commit "linux-user: Tidy and enforce reserved_va initialization"
7(18e80c55bb6ec17c05ec0ba717ec83933c2bfc07) the Yocto webkitgtk build
8hangs when cross compiling for 32-bit x86 on a 64-bit x86 machine using
9musl.
10
11To fix the issue reduce the MAX_RESERVED_VA macro to be a closer match
12to what it was before the problematic commit.
13
14Upstream-Status: Submitted http://lists.gnu.org/archive/html/qemu-devel/2018-01/msg04185.html
15Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
16
17---
18 linux-user/main.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21Index: qemu-5.2.0/linux-user/main.c
22===================================================================
23--- qemu-5.2.0.orig/linux-user/main.c
24+++ qemu-5.2.0/linux-user/main.c
25@@ -92,7 +92,7 @@ static int last_log_mask;
26 (TARGET_LONG_BITS == 32 || defined(TARGET_ABI32))
27 /* There are a number of places where we assign reserved_va to a variable
28 of type abi_ulong and expect it to fit. Avoid the last page. */
29-# define MAX_RESERVED_VA(CPU) (0xfffffffful & TARGET_PAGE_MASK)
30+# define MAX_RESERVED_VA(CPU) (0x7ffffffful & TARGET_PAGE_MASK)
31 # else
32 # define MAX_RESERVED_VA(CPU) (1ul << TARGET_VIRT_ADDR_SPACE_BITS)
33 # endif
diff --git a/meta/recipes-devtools/qemu/qemu/0009-Fix-webkitgtk-builds.patch b/meta/recipes-devtools/qemu/qemu/0009-Fix-webkitgtk-builds.patch
deleted file mode 100644
index 2ddc09966c..0000000000
--- a/meta/recipes-devtools/qemu/qemu/0009-Fix-webkitgtk-builds.patch
+++ /dev/null
@@ -1,137 +0,0 @@
1From 815c97ba0de02da9dace3fcfcbdf9b20e029f0d7 Mon Sep 17 00:00:00 2001
2From: Martin Jansa <martin.jansa@lge.com>
3Date: Fri, 1 Jun 2018 08:41:07 +0000
4Subject: [PATCH] Fix webkitgtk builds
5
6This is a partial revert of "linux-user: fix mmap/munmap/mprotect/mremap/shmat".
7
8This patch fixes qemu-i386 hangs during gobject-introspection in webkitgtk build
9when musl is used on qemux86. This is the same issue that
100008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch was
11fixing in the 2.11 release.
12
13This patch also fixes a build failure when building webkitgtk for
14qemumips. A QEMU assert is seen while building webkitgtk:
15page_check_range: Assertion `start < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)' failed.
16
17This reverts commit ebf9a3630c911d0cfc9c20f7cafe9ba4f88cf583.
18
19Upstream-Status: Pending
20Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
21
22[update patch context]
23Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
24---
25 include/exec/cpu-all.h | 6 +-----
26 include/exec/cpu_ldst.h | 5 ++++-
27 linux-user/mmap.c | 17 ++++-------------
28 linux-user/syscall.c | 5 +----
29 4 files changed, 10 insertions(+), 23 deletions(-)
30
31Index: qemu-5.2.0/include/exec/cpu-all.h
32===================================================================
33--- qemu-5.2.0.orig/include/exec/cpu-all.h
34+++ qemu-5.2.0/include/exec/cpu-all.h
35@@ -176,11 +176,8 @@ extern unsigned long reserved_va;
36 * avoid setting bits at the top of guest addresses that might need
37 * to be used for tags.
38 */
39-#define GUEST_ADDR_MAX_ \
40- ((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \
41- UINT32_MAX : ~0ul)
42-#define GUEST_ADDR_MAX (reserved_va ? reserved_va - 1 : GUEST_ADDR_MAX_)
43-
44+#define GUEST_ADDR_MAX (reserved_va ? reserved_va : \
45+ (1ul << TARGET_VIRT_ADDR_SPACE_BITS) - 1)
46 #else
47
48 #include "exec/hwaddr.h"
49Index: qemu-5.2.0/include/exec/cpu_ldst.h
50===================================================================
51--- qemu-5.2.0.orig/include/exec/cpu_ldst.h
52+++ qemu-5.2.0/include/exec/cpu_ldst.h
53@@ -75,7 +75,10 @@ typedef uint64_t abi_ptr;
54 #if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS
55 #define guest_addr_valid(x) (1)
56 #else
57-#define guest_addr_valid(x) ((x) <= GUEST_ADDR_MAX)
58+#define guest_addr_valid(x) ({ \
59+ ((x) < (1ul << TARGET_VIRT_ADDR_SPACE_BITS)) && \
60+ (!reserved_va || ((x) < reserved_va)); \
61+})
62 #endif
63 #define h2g_valid(x) guest_addr_valid((unsigned long)(x) - guest_base)
64
65Index: qemu-5.2.0/linux-user/mmap.c
66===================================================================
67--- qemu-5.2.0.orig/linux-user/mmap.c
68+++ qemu-5.2.0/linux-user/mmap.c
69@@ -119,7 +119,7 @@ int target_mprotect(abi_ulong start, abi
70 }
71 len = TARGET_PAGE_ALIGN(len);
72 end = start + len;
73- if (!guest_range_valid(start, len)) {
74+ if (end < start) {
75 return -TARGET_ENOMEM;
76 }
77 if (len == 0) {
78@@ -527,8 +527,8 @@ abi_long target_mmap(abi_ulong start, ab
79 * It can fail only on 64-bit host with 32-bit target.
80 * On any other target/host host mmap() handles this error correctly.
81 */
82- if (end < start || !guest_range_valid(start, len)) {
83- errno = ENOMEM;
84+ if (end < start || ((unsigned long)start + len - 1 > (abi_ulong) -1)) {
85+ errno = EINVAL;
86 goto fail;
87 }
88
89@@ -664,10 +664,8 @@ int target_munmap(abi_ulong start, abi_u
90 if (start & ~TARGET_PAGE_MASK)
91 return -TARGET_EINVAL;
92 len = TARGET_PAGE_ALIGN(len);
93- if (len == 0 || !guest_range_valid(start, len)) {
94+ if (len == 0)
95 return -TARGET_EINVAL;
96- }
97-
98 mmap_lock();
99 end = start + len;
100 real_start = start & qemu_host_page_mask;
101@@ -722,13 +720,6 @@ abi_long target_mremap(abi_ulong old_add
102 int prot;
103 void *host_addr;
104
105- if (!guest_range_valid(old_addr, old_size) ||
106- ((flags & MREMAP_FIXED) &&
107- !guest_range_valid(new_addr, new_size))) {
108- errno = ENOMEM;
109- return -1;
110- }
111-
112 mmap_lock();
113
114 if (flags & MREMAP_FIXED) {
115Index: qemu-5.2.0/linux-user/syscall.c
116===================================================================
117--- qemu-5.2.0.orig/linux-user/syscall.c
118+++ qemu-5.2.0/linux-user/syscall.c
119@@ -4590,9 +4590,6 @@ static inline abi_ulong do_shmat(CPUArch
120 return -TARGET_EINVAL;
121 }
122 }
123- if (!guest_range_valid(shmaddr, shm_info.shm_segsz)) {
124- return -TARGET_EINVAL;
125- }
126
127 mmap_lock();
128
129@@ -7790,7 +7787,7 @@ static int open_self_maps(void *cpu_env,
130 const char *path;
131
132 max = h2g_valid(max - 1) ?
133- max : (uintptr_t) g2h(GUEST_ADDR_MAX) + 1;
134+ max : (uintptr_t) g2h(GUEST_ADDR_MAX);
135
136 if (page_check_range(h2g(min), max - min, flags) == -1) {
137 continue;