diff options
Diffstat (limited to 'meta/recipes-devtools')
20 files changed, 81 insertions, 676 deletions
diff --git a/meta/recipes-devtools/qemu/qemu-native.inc b/meta/recipes-devtools/qemu/qemu-native.inc index c04297cad0..69c2c43e6b 100644 --- a/meta/recipes-devtools/qemu/qemu-native.inc +++ b/meta/recipes-devtools/qemu/qemu-native.inc | |||
@@ -3,8 +3,8 @@ inherit native | |||
3 | require qemu.inc | 3 | require qemu.inc |
4 | 4 | ||
5 | SRC_URI_append = " \ | 5 | SRC_URI_append = " \ |
6 | file://0011-fix-libcap-header-issue-on-some-distro.patch \ | 6 | file://0010-fix-libcap-header-issue-on-some-distro.patch \ |
7 | file://0012-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch \ | 7 | file://0011-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch \ |
8 | " | 8 | " |
9 | 9 | ||
10 | EXTRA_OEMAKE_append = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'" | 10 | EXTRA_OEMAKE_append = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'" |
diff --git a/meta/recipes-devtools/qemu/qemu-native_4.0.0.bb b/meta/recipes-devtools/qemu/qemu-native_4.1.0.bb index c8acff8e19..c8acff8e19 100644 --- a/meta/recipes-devtools/qemu/qemu-native_4.0.0.bb +++ b/meta/recipes-devtools/qemu/qemu-native_4.1.0.bb | |||
diff --git a/meta/recipes-devtools/qemu/qemu-system-native_4.0.0.bb b/meta/recipes-devtools/qemu/qemu-system-native_4.1.0.bb index 964dcee524..d83ee59375 100644 --- a/meta/recipes-devtools/qemu/qemu-system-native_4.0.0.bb +++ b/meta/recipes-devtools/qemu/qemu-system-native_4.1.0.bb | |||
@@ -2,7 +2,7 @@ BPN = "qemu" | |||
2 | 2 | ||
3 | require qemu-native.inc | 3 | require qemu-native.inc |
4 | 4 | ||
5 | # As some of the files installed by qemu-native and qemu-system-native | 5 | # As some of the files installed by qemu-native and qemu-system-native |
6 | # are the same, we depend on qemu-native to get the full installation set | 6 | # are the same, we depend on qemu-native to get the full installation set |
7 | # and avoid file clashes | 7 | # and avoid file clashes |
8 | DEPENDS = "glib-2.0-native zlib-native pixman-native qemu-native bison-native" | 8 | DEPENDS = "glib-2.0-native zlib-native pixman-native qemu-native bison-native" |
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index 46c40b7d4f..d2dd2bc9c1 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -17,20 +17,16 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
17 | file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \ | 17 | file://0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch \ |
18 | file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \ | 18 | file://0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch \ |
19 | file://0004-qemu-disable-Valgrind.patch \ | 19 | file://0004-qemu-disable-Valgrind.patch \ |
20 | file://0005-qemu-Limit-paths-searched-during-user-mode-emulation.patch \ | 20 | file://0005-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch \ |
21 | file://0006-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch \ | 21 | file://0006-chardev-connect-socket-to-a-spawned-command.patch \ |
22 | file://0007-chardev-connect-socket-to-a-spawned-command.patch \ | 22 | file://0007-apic-fixup-fallthrough-to-PIC.patch \ |
23 | file://0008-apic-fixup-fallthrough-to-PIC.patch \ | 23 | file://0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ |
24 | file://0009-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch \ | 24 | file://0009-Fix-webkitgtk-builds.patch \ |
25 | file://0010-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch \ | ||
26 | file://0013-target-arm-Fix-vector-operation-segfault.patch \ | ||
27 | file://0014-linux-user-fix-to-handle-variably-sized-SIOCGSTAMP-w.patch \ | ||
28 | file://CVE-2019-12155.patch \ | ||
29 | " | 25 | " |
30 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" | 26 | UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar" |
31 | 27 | ||
32 | SRC_URI[md5sum] = "0afeca336fd57ae3d3086ec07f59d708" | 28 | SRC_URI[md5sum] = "cdf2b5ca52b9abac9bacb5842fa420f8" |
33 | SRC_URI[sha256sum] = "13a93dfe75b86734326f8d5b475fde82ec692d5b5a338b4262aeeb6b0fa4e469" | 29 | SRC_URI[sha256sum] = "656e60218689bdeec69903087fd7582d5d3e72238d02f4481d8dc6d79fd909c6" |
34 | 30 | ||
35 | COMPATIBLE_HOST_mipsarchn32 = "null" | 31 | COMPATIBLE_HOST_mipsarchn32 = "null" |
36 | COMPATIBLE_HOST_mipsarchn64 = "null" | 32 | COMPATIBLE_HOST_mipsarchn64 = "null" |
@@ -141,7 +137,7 @@ PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses," | |||
141 | PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native" | 137 | PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native" |
142 | PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native" | 138 | PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native" |
143 | PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng," | 139 | PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng," |
144 | PACKAGECONFIG[ssh2] = "--enable-libssh2,--disable-libssh2,libssh2," | 140 | PACKAGECONFIG[ssh] = "--enable-libssh,--disable-libssh,libssh," |
145 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt," | 141 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt," |
146 | PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle" | 142 | PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle" |
147 | PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1" | 143 | PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1" |
diff --git a/meta/recipes-devtools/qemu/qemu/0001-qemu-Add-missing-wacom-HID-descriptor.patch b/meta/recipes-devtools/qemu/qemu/0001-qemu-Add-missing-wacom-HID-descriptor.patch index 5373915ff0..9478102ae5 100644 --- a/meta/recipes-devtools/qemu/qemu/0001-qemu-Add-missing-wacom-HID-descriptor.patch +++ b/meta/recipes-devtools/qemu/qemu/0001-qemu-Add-missing-wacom-HID-descriptor.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 1cb804cf0e47116202011f3386b4739af668224a Mon Sep 17 00:00:00 2001 | 1 | From 4655dc18074e0be9d239f51dac32b61435da8549 Mon Sep 17 00:00:00 2001 |
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | 2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> |
3 | Date: Thu, 27 Nov 2014 14:04:29 +0000 | 3 | Date: Thu, 27 Nov 2014 14:04:29 +0000 |
4 | Subject: [PATCH] qemu: Add missing wacom HID descriptor | 4 | Subject: [PATCH] qemu: Add missing wacom HID descriptor |
@@ -19,10 +19,10 @@ Upstream-Status: Submitted | |||
19 | 1 file changed, 93 insertions(+), 1 deletion(-) | 19 | 1 file changed, 93 insertions(+), 1 deletion(-) |
20 | 20 | ||
21 | diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c | 21 | diff --git a/hw/usb/dev-wacom.c b/hw/usb/dev-wacom.c |
22 | index ac0bc83b..6f9b22d4 100644 | 22 | index 8c43db93..3ff8ca28 100644 |
23 | --- a/hw/usb/dev-wacom.c | 23 | --- a/hw/usb/dev-wacom.c |
24 | +++ b/hw/usb/dev-wacom.c | 24 | +++ b/hw/usb/dev-wacom.c |
25 | @@ -72,6 +72,89 @@ static const USBDescStrings desc_strings = { | 25 | @@ -74,6 +74,89 @@ static const USBDescStrings desc_strings = { |
26 | [STR_SERIALNUMBER] = "1", | 26 | [STR_SERIALNUMBER] = "1", |
27 | }; | 27 | }; |
28 | 28 | ||
@@ -112,7 +112,7 @@ index ac0bc83b..6f9b22d4 100644 | |||
112 | static const USBDescIface desc_iface_wacom = { | 112 | static const USBDescIface desc_iface_wacom = { |
113 | .bInterfaceNumber = 0, | 113 | .bInterfaceNumber = 0, |
114 | .bNumEndpoints = 1, | 114 | .bNumEndpoints = 1, |
115 | @@ -89,7 +172,7 @@ static const USBDescIface desc_iface_wacom = { | 115 | @@ -91,7 +174,7 @@ static const USBDescIface desc_iface_wacom = { |
116 | 0x00, /* u8 country_code */ | 116 | 0x00, /* u8 country_code */ |
117 | 0x01, /* u8 num_descriptors */ | 117 | 0x01, /* u8 num_descriptors */ |
118 | 0x22, /* u8 type: Report */ | 118 | 0x22, /* u8 type: Report */ |
@@ -121,7 +121,7 @@ index ac0bc83b..6f9b22d4 100644 | |||
121 | }, | 121 | }, |
122 | }, | 122 | }, |
123 | }, | 123 | }, |
124 | @@ -269,6 +352,15 @@ static void usb_wacom_handle_control(USBDevice *dev, USBPacket *p, | 124 | @@ -271,6 +354,15 @@ static void usb_wacom_handle_control(USBDevice *dev, USBPacket *p, |
125 | } | 125 | } |
126 | 126 | ||
127 | switch (request) { | 127 | switch (request) { |
diff --git a/meta/recipes-devtools/qemu/qemu/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch b/meta/recipes-devtools/qemu/qemu/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch index 7b7c5d71a0..2ccddd53cf 100644 --- a/meta/recipes-devtools/qemu/qemu/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch +++ b/meta/recipes-devtools/qemu/qemu/0002-Add-subpackage-ptest-which-runs-all-unit-test-cases-.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 281116b31981b0b9e174bda8abe00f4eaa33c2ae Mon Sep 17 00:00:00 2001 | 1 | From 67751f3a23e3db3012f391b3b3b73a4484488ce9 Mon Sep 17 00:00:00 2001 |
2 | From: Juro Bystricky <juro.bystricky@intel.com> | 2 | From: Juro Bystricky <juro.bystricky@intel.com> |
3 | Date: Thu, 31 Aug 2017 11:06:56 -0700 | 3 | Date: Thu, 31 Aug 2017 11:06:56 -0700 |
4 | Subject: [PATCH] Add subpackage -ptest which runs all unit test cases for | 4 | Subject: [PATCH] Add subpackage -ptest which runs all unit test cases for |
@@ -15,10 +15,10 @@ Signed-off-by: Juro Bystricky <juro.bystricky@intel.com> | |||
15 | 1 file changed, 8 insertions(+) | 15 | 1 file changed, 8 insertions(+) |
16 | 16 | ||
17 | diff --git a/tests/Makefile.include b/tests/Makefile.include | 17 | diff --git a/tests/Makefile.include b/tests/Makefile.include |
18 | index 36fc73fe..01fecd4d 100644 | 18 | index fd7fdb86..83b7f409 100644 |
19 | --- a/tests/Makefile.include | 19 | --- a/tests/Makefile.include |
20 | +++ b/tests/Makefile.include | 20 | +++ b/tests/Makefile.include |
21 | @@ -1184,4 +1184,12 @@ all: $(QEMU_IOTESTS_HELPERS-y) | 21 | @@ -1183,4 +1183,12 @@ all: $(QEMU_IOTESTS_HELPERS-y) |
22 | -include $(wildcard tests/*.d) | 22 | -include $(wildcard tests/*.d) |
23 | -include $(wildcard tests/libqos/*.d) | 23 | -include $(wildcard tests/libqos/*.d) |
24 | 24 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch b/meta/recipes-devtools/qemu/qemu/0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch index 9a18ca18e4..5c42d68030 100644 --- a/meta/recipes-devtools/qemu/qemu/0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch +++ b/meta/recipes-devtools/qemu/qemu/0003-qemu-Add-addition-environment-space-to-boot-loader-q.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From bf04acef9ec31ddcc18ddbb4ac5b7b1e7368bf7d Mon Sep 17 00:00:00 2001 | 1 | From 235b94f1188597873c8776b019fed49947983392 Mon Sep 17 00:00:00 2001 |
2 | From: Jason Wessel <jason.wessel@windriver.com> | 2 | From: Jason Wessel <jason.wessel@windriver.com> |
3 | Date: Fri, 28 Mar 2014 17:42:43 +0800 | 3 | Date: Fri, 28 Mar 2014 17:42:43 +0800 |
4 | Subject: [PATCH] qemu: Add addition environment space to boot loader | 4 | Subject: [PATCH] qemu: Add addition environment space to boot loader |
@@ -19,7 +19,7 @@ Signed-off-by: Roy Li <rongqing.li@windriver.com> | |||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | 19 | 1 file changed, 1 insertion(+), 1 deletion(-) |
20 | 20 | ||
21 | diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c | 21 | diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c |
22 | index 439665ab..285c78ef 100644 | 22 | index 20e019bf..d150b01c 100644 |
23 | --- a/hw/mips/mips_malta.c | 23 | --- a/hw/mips/mips_malta.c |
24 | +++ b/hw/mips/mips_malta.c | 24 | +++ b/hw/mips/mips_malta.c |
25 | @@ -60,7 +60,7 @@ | 25 | @@ -60,7 +60,7 @@ |
diff --git a/meta/recipes-devtools/qemu/qemu/0004-qemu-disable-Valgrind.patch b/meta/recipes-devtools/qemu/qemu/0004-qemu-disable-Valgrind.patch index 9e326081f2..0ac4ab40b1 100644 --- a/meta/recipes-devtools/qemu/qemu/0004-qemu-disable-Valgrind.patch +++ b/meta/recipes-devtools/qemu/qemu/0004-qemu-disable-Valgrind.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From e40f797548bc3ff06c71b6cbe042a46406894d18 Mon Sep 17 00:00:00 2001 | 1 | From 3ad7a375015d47fdf5016e03e11fa93440d6d8bd Mon Sep 17 00:00:00 2001 |
2 | From: Ross Burton <ross.burton@intel.com> | 2 | From: Ross Burton <ross.burton@intel.com> |
3 | Date: Tue, 20 Oct 2015 22:19:08 +0100 | 3 | Date: Tue, 20 Oct 2015 22:19:08 +0100 |
4 | Subject: [PATCH] qemu: disable Valgrind | 4 | Subject: [PATCH] qemu: disable Valgrind |
@@ -13,10 +13,10 @@ Signed-off-by: Ross Burton <ross.burton@intel.com> | |||
13 | 1 file changed, 9 deletions(-) | 13 | 1 file changed, 9 deletions(-) |
14 | 14 | ||
15 | diff --git a/configure b/configure | 15 | diff --git a/configure b/configure |
16 | index 1c563a70..eaf9bb5e 100755 | 16 | index 714e7fb6..dad4fc59 100755 |
17 | --- a/configure | 17 | --- a/configure |
18 | +++ b/configure | 18 | +++ b/configure |
19 | @@ -5311,15 +5311,6 @@ fi | 19 | @@ -5335,15 +5335,6 @@ fi |
20 | # check if we have valgrind/valgrind.h | 20 | # check if we have valgrind/valgrind.h |
21 | 21 | ||
22 | valgrind_h=no | 22 | valgrind_h=no |
diff --git a/meta/recipes-devtools/qemu/qemu/0005-qemu-Limit-paths-searched-during-user-mode-emulation.patch b/meta/recipes-devtools/qemu/qemu/0005-qemu-Limit-paths-searched-during-user-mode-emulation.patch deleted file mode 100644 index 819720a3f2..0000000000 --- a/meta/recipes-devtools/qemu/qemu/0005-qemu-Limit-paths-searched-during-user-mode-emulation.patch +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | From 547c3710a1493d2fd6bb56b819cf162db433756a Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
3 | Date: Wed, 9 Mar 2016 22:49:02 +0000 | ||
4 | Subject: [PATCH] qemu: Limit paths searched during user mode emulation | ||
5 | |||
6 | By default qemu builds a complete list of directories within the user | ||
7 | emulation sysroot (-L option). The OE sysroot directory is large and | ||
8 | this is confusing, for example it indexes all pkgdata. In particular this | ||
9 | confuses strace of qemu binaries with tons of irrelevant paths. | ||
10 | |||
11 | This patch stops the code indexing up front and instead only indexes | ||
12 | things if/as/when it needs to. This drastically reduces the files it | ||
13 | reads and reduces memory usage and cleans up strace. | ||
14 | |||
15 | It would also avoid the infinite directory traversal bug in [YOCTO #6996] | ||
16 | although the code could still be vulnerable if it parsed those specific | ||
17 | paths. | ||
18 | |||
19 | RP | ||
20 | 2016/3/9 | ||
21 | Upstream-Status: Pending | ||
22 | |||
23 | --- | ||
24 | util/path.c | 44 ++++++++++++++++++++++---------------------- | ||
25 | 1 file changed, 22 insertions(+), 22 deletions(-) | ||
26 | |||
27 | diff --git a/util/path.c b/util/path.c | ||
28 | index 7f9fc272..a416cd4a 100644 | ||
29 | --- a/util/path.c | ||
30 | +++ b/util/path.c | ||
31 | @@ -15,6 +15,7 @@ struct pathelem | ||
32 | char *name; | ||
33 | /* Full path name, eg. /usr/gnemul/x86-linux/lib. */ | ||
34 | char *pathname; | ||
35 | + int populated_entries; | ||
36 | struct pathelem *parent; | ||
37 | /* Children */ | ||
38 | unsigned int num_entries; | ||
39 | @@ -45,6 +46,7 @@ static struct pathelem *new_entry(const char *root, | ||
40 | new->name = g_strdup(name); | ||
41 | new->pathname = g_strdup_printf("%s/%s", root, name); | ||
42 | new->num_entries = 0; | ||
43 | + new->populated_entries = 0; | ||
44 | return new; | ||
45 | } | ||
46 | |||
47 | @@ -53,15 +55,16 @@ static struct pathelem *new_entry(const char *root, | ||
48 | /* Not all systems provide this feature */ | ||
49 | #if defined(DT_DIR) && defined(DT_UNKNOWN) && defined(DT_LNK) | ||
50 | # define dirent_type(dirent) ((dirent)->d_type) | ||
51 | -# define is_dir_maybe(type) \ | ||
52 | - ((type) == DT_DIR || (type) == DT_UNKNOWN || (type) == DT_LNK) | ||
53 | +# define is_not_dir(type) \ | ||
54 | + ((type) != DT_DIR && (type) != DT_UNKNOWN && (type) != DT_LNK) | ||
55 | #else | ||
56 | # define dirent_type(dirent) (1) | ||
57 | -# define is_dir_maybe(type) (type) | ||
58 | +# define is_not_dir(type) (0) | ||
59 | #endif | ||
60 | |||
61 | static struct pathelem *add_dir_maybe(struct pathelem *path) | ||
62 | { | ||
63 | + unsigned int i; | ||
64 | DIR *dir; | ||
65 | |||
66 | if ((dir = opendir(path->pathname)) != NULL) { | ||
67 | @@ -74,6 +77,11 @@ static struct pathelem *add_dir_maybe(struct pathelem *path) | ||
68 | } | ||
69 | closedir(dir); | ||
70 | } | ||
71 | + | ||
72 | + for (i = 0; i < path->num_entries; i++) | ||
73 | + (path->entries[i])->parent = path; | ||
74 | + | ||
75 | + path->populated_entries = 1; | ||
76 | return path; | ||
77 | } | ||
78 | |||
79 | @@ -89,26 +97,16 @@ static struct pathelem *add_entry(struct pathelem *root, const char *name, | ||
80 | e = &root->entries[root->num_entries-1]; | ||
81 | |||
82 | *e = new_entry(root->pathname, root, name); | ||
83 | - if (is_dir_maybe(type)) { | ||
84 | - *e = add_dir_maybe(*e); | ||
85 | + if (is_not_dir(type)) { | ||
86 | + (*e)->populated_entries = 1; | ||
87 | } | ||
88 | |||
89 | return root; | ||
90 | } | ||
91 | |||
92 | -/* This needs to be done after tree is stabilized (ie. no more reallocs!). */ | ||
93 | -static void set_parents(struct pathelem *child, struct pathelem *parent) | ||
94 | -{ | ||
95 | - unsigned int i; | ||
96 | - | ||
97 | - child->parent = parent; | ||
98 | - for (i = 0; i < child->num_entries; i++) | ||
99 | - set_parents(child->entries[i], child); | ||
100 | -} | ||
101 | - | ||
102 | /* FIXME: Doesn't handle DIR/.. where DIR is not in emulated dir. */ | ||
103 | static const char * | ||
104 | -follow_path(const struct pathelem *cursor, const char *name) | ||
105 | +follow_path(struct pathelem *cursor, struct pathelem **source, const char *name) | ||
106 | { | ||
107 | unsigned int i, namelen; | ||
108 | |||
109 | @@ -119,14 +117,18 @@ follow_path(const struct pathelem *cursor, const char *name) | ||
110 | return cursor->pathname; | ||
111 | |||
112 | if (strneq(name, namelen, "..")) | ||
113 | - return follow_path(cursor->parent, name + namelen); | ||
114 | + return follow_path(cursor->parent, &cursor->parent, name + namelen); | ||
115 | |||
116 | if (strneq(name, namelen, ".")) | ||
117 | - return follow_path(cursor, name + namelen); | ||
118 | + return follow_path(cursor, source, name + namelen); | ||
119 | + | ||
120 | + if (!cursor->populated_entries) | ||
121 | + *source = add_dir_maybe(cursor); | ||
122 | + cursor = *source; | ||
123 | |||
124 | for (i = 0; i < cursor->num_entries; i++) | ||
125 | if (strneq(name, namelen, cursor->entries[i]->name)) | ||
126 | - return follow_path(cursor->entries[i], name + namelen); | ||
127 | + return follow_path(cursor->entries[i], &cursor->entries[i], name + namelen); | ||
128 | |||
129 | /* Not found */ | ||
130 | return NULL; | ||
131 | @@ -160,8 +162,6 @@ void init_paths(const char *prefix) | ||
132 | g_free(base->name); | ||
133 | g_free(base); | ||
134 | base = NULL; | ||
135 | - } else { | ||
136 | - set_parents(base, base); | ||
137 | } | ||
138 | } | ||
139 | |||
140 | @@ -173,5 +173,5 @@ const char *path(const char *name) | ||
141 | if (!base || !name || name[0] != '/') | ||
142 | return name; | ||
143 | |||
144 | - return follow_path(base, name) ?: name; | ||
145 | + return follow_path(base, &base, name) ?: name; | ||
146 | } | ||
diff --git a/meta/recipes-devtools/qemu/qemu/0006-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch b/meta/recipes-devtools/qemu/qemu/0005-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch index b62a588c66..a73681510e 100644 --- a/meta/recipes-devtools/qemu/qemu/0006-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch +++ b/meta/recipes-devtools/qemu/qemu/0005-qemu-native-set-ld.bfd-fix-cflags-and-set-some-envir.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 107fd860529a3c1319d54c3c225758457b0d9394 Mon Sep 17 00:00:00 2001 | 1 | From 80e6070bcdfe636b103a13598e6c38ad0d0e7624 Mon Sep 17 00:00:00 2001 |
2 | From: Stephen Arnold <sarnold@vctlabs.com> | 2 | From: Stephen Arnold <sarnold@vctlabs.com> |
3 | Date: Sun, 12 Jun 2016 18:09:56 -0700 | 3 | Date: Sun, 12 Jun 2016 18:09:56 -0700 |
4 | Subject: [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment | 4 | Subject: [PATCH] qemu-native: set ld.bfd, fix cflags, and set some environment |
@@ -10,10 +10,10 @@ Upstream-Status: Pending | |||
10 | 1 file changed, 4 deletions(-) | 10 | 1 file changed, 4 deletions(-) |
11 | 11 | ||
12 | diff --git a/configure b/configure | 12 | diff --git a/configure b/configure |
13 | index eaf9bb5e..de2933d1 100755 | 13 | index dad4fc59..685bbe5e 100755 |
14 | --- a/configure | 14 | --- a/configure |
15 | +++ b/configure | 15 | +++ b/configure |
16 | @@ -5928,10 +5928,6 @@ write_c_skeleton | 16 | @@ -5971,10 +5971,6 @@ write_c_skeleton |
17 | if test "$gcov" = "yes" ; then | 17 | if test "$gcov" = "yes" ; then |
18 | CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" | 18 | CFLAGS="-fprofile-arcs -ftest-coverage -g $CFLAGS" |
19 | LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" | 19 | LDFLAGS="-fprofile-arcs -ftest-coverage $LDFLAGS" |
diff --git a/meta/recipes-devtools/qemu/qemu/0007-chardev-connect-socket-to-a-spawned-command.patch b/meta/recipes-devtools/qemu/qemu/0006-chardev-connect-socket-to-a-spawned-command.patch index f3f3dc3f5e..a42385530f 100644 --- a/meta/recipes-devtools/qemu/qemu/0007-chardev-connect-socket-to-a-spawned-command.patch +++ b/meta/recipes-devtools/qemu/qemu/0006-chardev-connect-socket-to-a-spawned-command.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 136e159482a1bc8676cbe6e767055d0c3fb20065 Mon Sep 17 00:00:00 2001 | 1 | From ad853601e75f6d0dd09672bcca05fbe4fac766a4 Mon Sep 17 00:00:00 2001 |
2 | From: Alistair Francis <alistair.francis@xilinx.com> | 2 | From: Alistair Francis <alistair.francis@xilinx.com> |
3 | Date: Thu, 21 Dec 2017 11:35:16 -0800 | 3 | Date: Thu, 21 Dec 2017 11:35:16 -0800 |
4 | Subject: [PATCH] chardev: connect socket to a spawned command | 4 | Subject: [PATCH] chardev: connect socket to a spawned command |
@@ -52,10 +52,10 @@ Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> | |||
52 | 3 files changed, 109 insertions(+) | 52 | 3 files changed, 109 insertions(+) |
53 | 53 | ||
54 | diff --git a/chardev/char-socket.c b/chardev/char-socket.c | 54 | diff --git a/chardev/char-socket.c b/chardev/char-socket.c |
55 | index 3916505d..a8e9dce8 100644 | 55 | index 7ca5d97a..207fae4a 100644 |
56 | --- a/chardev/char-socket.c | 56 | --- a/chardev/char-socket.c |
57 | +++ b/chardev/char-socket.c | 57 | +++ b/chardev/char-socket.c |
58 | @@ -1273,6 +1273,67 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock, | 58 | @@ -1278,6 +1278,67 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock, |
59 | return true; | 59 | return true; |
60 | } | 60 | } |
61 | 61 | ||
@@ -123,7 +123,7 @@ index 3916505d..a8e9dce8 100644 | |||
123 | 123 | ||
124 | static void qmp_chardev_open_socket(Chardev *chr, | 124 | static void qmp_chardev_open_socket(Chardev *chr, |
125 | ChardevBackend *backend, | 125 | ChardevBackend *backend, |
126 | @@ -1281,6 +1342,9 @@ static void qmp_chardev_open_socket(Chardev *chr, | 126 | @@ -1286,6 +1347,9 @@ static void qmp_chardev_open_socket(Chardev *chr, |
127 | { | 127 | { |
128 | SocketChardev *s = SOCKET_CHARDEV(chr); | 128 | SocketChardev *s = SOCKET_CHARDEV(chr); |
129 | ChardevSocket *sock = backend->u.socket.data; | 129 | ChardevSocket *sock = backend->u.socket.data; |
@@ -133,7 +133,7 @@ index 3916505d..a8e9dce8 100644 | |||
133 | bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; | 133 | bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; |
134 | bool is_listen = sock->has_server ? sock->server : true; | 134 | bool is_listen = sock->has_server ? sock->server : true; |
135 | bool is_telnet = sock->has_telnet ? sock->telnet : false; | 135 | bool is_telnet = sock->has_telnet ? sock->telnet : false; |
136 | @@ -1346,6 +1410,14 @@ static void qmp_chardev_open_socket(Chardev *chr, | 136 | @@ -1351,6 +1415,14 @@ static void qmp_chardev_open_socket(Chardev *chr, |
137 | 137 | ||
138 | update_disconnected_filename(s); | 138 | update_disconnected_filename(s); |
139 | 139 | ||
@@ -148,7 +148,7 @@ index 3916505d..a8e9dce8 100644 | |||
148 | if (s->is_listen) { | 148 | if (s->is_listen) { |
149 | if (qmp_chardev_open_socket_server(chr, is_telnet || is_tn3270, | 149 | if (qmp_chardev_open_socket_server(chr, is_telnet || is_tn3270, |
150 | is_waitconnect, errp) < 0) { | 150 | is_waitconnect, errp) < 0) { |
151 | @@ -1365,9 +1437,26 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, | 151 | @@ -1370,9 +1442,26 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, |
152 | const char *host = qemu_opt_get(opts, "host"); | 152 | const char *host = qemu_opt_get(opts, "host"); |
153 | const char *port = qemu_opt_get(opts, "port"); | 153 | const char *port = qemu_opt_get(opts, "port"); |
154 | const char *fd = qemu_opt_get(opts, "fd"); | 154 | const char *fd = qemu_opt_get(opts, "fd"); |
@@ -175,7 +175,7 @@ index 3916505d..a8e9dce8 100644 | |||
175 | if ((!!path + !!fd + !!host) != 1) { | 175 | if ((!!path + !!fd + !!host) != 1) { |
176 | error_setg(errp, | 176 | error_setg(errp, |
177 | "Exactly one of 'path', 'fd' or 'host' required"); | 177 | "Exactly one of 'path', 'fd' or 'host' required"); |
178 | @@ -1410,12 +1499,24 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, | 178 | @@ -1415,12 +1504,24 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, |
179 | sock->has_tls_authz = qemu_opt_get(opts, "tls-authz"); | 179 | sock->has_tls_authz = qemu_opt_get(opts, "tls-authz"); |
180 | sock->tls_authz = g_strdup(qemu_opt_get(opts, "tls-authz")); | 180 | sock->tls_authz = g_strdup(qemu_opt_get(opts, "tls-authz")); |
181 | 181 | ||
@@ -201,10 +201,10 @@ index 3916505d..a8e9dce8 100644 | |||
201 | addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET; | 201 | addr->type = SOCKET_ADDRESS_LEGACY_KIND_INET; |
202 | addr->u.inet.data = g_new(InetSocketAddress, 1); | 202 | addr->u.inet.data = g_new(InetSocketAddress, 1); |
203 | diff --git a/chardev/char.c b/chardev/char.c | 203 | diff --git a/chardev/char.c b/chardev/char.c |
204 | index 514cd6b0..36a40d67 100644 | 204 | index 7b6b2cb1..0c2ca64b 100644 |
205 | --- a/chardev/char.c | 205 | --- a/chardev/char.c |
206 | +++ b/chardev/char.c | 206 | +++ b/chardev/char.c |
207 | @@ -835,6 +835,9 @@ QemuOptsList qemu_chardev_opts = { | 207 | @@ -837,6 +837,9 @@ QemuOptsList qemu_chardev_opts = { |
208 | },{ | 208 | },{ |
209 | .name = "path", | 209 | .name = "path", |
210 | .type = QEMU_OPT_STRING, | 210 | .type = QEMU_OPT_STRING, |
diff --git a/meta/recipes-devtools/qemu/qemu/0008-apic-fixup-fallthrough-to-PIC.patch b/meta/recipes-devtools/qemu/qemu/0007-apic-fixup-fallthrough-to-PIC.patch index 13037f33f3..b50e8c2545 100644 --- a/meta/recipes-devtools/qemu/qemu/0008-apic-fixup-fallthrough-to-PIC.patch +++ b/meta/recipes-devtools/qemu/qemu/0007-apic-fixup-fallthrough-to-PIC.patch | |||
@@ -1,4 +1,4 @@ | |||
1 | From 1b3f264e2ba18caf658fae27293c426c8366c6a3 Mon Sep 17 00:00:00 2001 | 1 | From f51e49e7d7d87b7254242b7360f99c2df94a5a2d Mon Sep 17 00:00:00 2001 |
2 | From: Mark Asselstine <mark.asselstine@windriver.com> | 2 | From: Mark Asselstine <mark.asselstine@windriver.com> |
3 | Date: Tue, 26 Feb 2013 11:43:28 -0500 | 3 | Date: Tue, 26 Feb 2013 11:43:28 -0500 |
4 | Subject: [PATCH] apic: fixup fallthrough to PIC | 4 | Subject: [PATCH] apic: fixup fallthrough to PIC |
@@ -30,10 +30,10 @@ Signed-off-by: He Zhe <zhe.he@windriver.com> | |||
30 | 1 file changed, 1 insertion(+), 1 deletion(-) | 30 | 1 file changed, 1 insertion(+), 1 deletion(-) |
31 | 31 | ||
32 | diff --git a/hw/intc/apic.c b/hw/intc/apic.c | 32 | diff --git a/hw/intc/apic.c b/hw/intc/apic.c |
33 | index 6ea619c3..f892811e 100644 | 33 | index bce89911..df4b582e 100644 |
34 | --- a/hw/intc/apic.c | 34 | --- a/hw/intc/apic.c |
35 | +++ b/hw/intc/apic.c | 35 | +++ b/hw/intc/apic.c |
36 | @@ -604,7 +604,7 @@ int apic_accept_pic_intr(DeviceState *dev) | 36 | @@ -603,7 +603,7 @@ int apic_accept_pic_intr(DeviceState *dev) |
37 | APICCommonState *s = APIC(dev); | 37 | APICCommonState *s = APIC(dev); |
38 | uint32_t lvt0; | 38 | uint32_t lvt0; |
39 | 39 | ||
diff --git a/meta/recipes-devtools/qemu/qemu/0009-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 index c572ff94d0..e562f25bec 100644 --- a/meta/recipes-devtools/qemu/qemu/0009-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 | |||
@@ -1,4 +1,4 @@ | |||
1 | From a33ae91504ea4d254b5ace64a84791d3c96c9773 Mon Sep 17 00:00:00 2001 | 1 | From 25a064f91f73630e5dff2a6aeb23d953c469cea6 Mon Sep 17 00:00:00 2001 |
2 | From: Alistair Francis <alistair.francis@xilinx.com> | 2 | From: Alistair Francis <alistair.francis@xilinx.com> |
3 | Date: Wed, 17 Jan 2018 10:51:49 -0800 | 3 | Date: Wed, 17 Jan 2018 10:51:49 -0800 |
4 | Subject: [PATCH] linux-user: Fix webkitgtk hangs on 32-bit x86 target | 4 | Subject: [PATCH] linux-user: Fix webkitgtk hangs on 32-bit x86 target |
@@ -19,10 +19,10 @@ Signed-off-by: Alistair Francis <alistair.francis@xilinx.com> | |||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | 19 | 1 file changed, 1 insertion(+), 1 deletion(-) |
20 | 20 | ||
21 | diff --git a/linux-user/main.c b/linux-user/main.c | 21 | diff --git a/linux-user/main.c b/linux-user/main.c |
22 | index a0aba9cb..34c54924 100644 | 22 | index 8ffc5251..4067e739 100644 |
23 | --- a/linux-user/main.c | 23 | --- a/linux-user/main.c |
24 | +++ b/linux-user/main.c | 24 | +++ b/linux-user/main.c |
25 | @@ -69,7 +69,7 @@ int have_guest_base; | 25 | @@ -77,7 +77,7 @@ int have_guest_base; |
26 | (TARGET_LONG_BITS == 32 || defined(TARGET_ABI32)) | 26 | (TARGET_LONG_BITS == 32 || defined(TARGET_ABI32)) |
27 | /* There are a number of places where we assign reserved_va to a variable | 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. */ | 28 | of type abi_ulong and expect it to fit. Avoid the last page. */ |
diff --git a/meta/recipes-devtools/qemu/qemu/0010-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch b/meta/recipes-devtools/qemu/qemu/0009-Fix-webkitgtk-builds.patch index 3418eb7c65..4072d9455f 100644 --- a/meta/recipes-devtools/qemu/qemu/0010-Revert-linux-user-fix-mmap-munmap-mprotect-mremap-sh.patch +++ b/meta/recipes-devtools/qemu/qemu/0009-Fix-webkitgtk-builds.patch | |||
@@ -1,32 +1,35 @@ | |||
1 | From 2a66bd95c856de6950fbd802c5b99075207c1d76 Mon Sep 17 00:00:00 2001 | 1 | From b633b9a1813fcd715dce44659a89293f1c64ae8c Mon Sep 17 00:00:00 2001 |
2 | From: Martin Jansa <martin.jansa@lge.com> | 2 | From: Martin Jansa <martin.jansa@lge.com> |
3 | Date: Fri, 1 Jun 2018 08:41:07 +0000 | 3 | Date: Fri, 1 Jun 2018 08:41:07 +0000 |
4 | Subject: [PATCH] Revert "linux-user: fix mmap/munmap/mprotect/mremap/shmat" | 4 | Subject: [PATCH] Fix webkitgtk builds |
5 | 5 | ||
6 | Causes qemu-i386 to hang during gobject-introspection in webkitgtk build | 6 | This is a partial revert of "linux-user: fix mmap/munmap/mprotect/mremap/shmat". |
7 | when musl is used on qemux86 - the same issue as | 7 | |
8 | 0010-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch | 8 | This patch fixes qemu-i386 hangs during gobject-introspection in webkitgtk build |
9 | was fixing in 2.11.0 release, but with this patch the fix no longer worked | 9 | when musl is used on qemux86. This is the same issue that |
10 | as discussed here: | 10 | 0008-linux-user-Fix-webkitgtk-hangs-on-32-bit-x86-target.patch was |
11 | http://lists.openembedded.org/pipermail/openembedded-core/2018-May/150302.html | 11 | fixing in the 2.11 release. |
12 | http://lists.openembedded.org/pipermail/openembedded-core/2018-June/151382.html | 12 | |
13 | This patch also fixes a build failure when building webkitgtk for | ||
14 | qemumips. A QEMU assert is seen while building webkitgtk: | ||
15 | page_check_range: Assertion `start < ((target_ulong)1 << L1_MAP_ADDR_SPACE_BITS)' failed. | ||
13 | 16 | ||
14 | This reverts commit ebf9a3630c911d0cfc9c20f7cafe9ba4f88cf583. | 17 | This reverts commit ebf9a3630c911d0cfc9c20f7cafe9ba4f88cf583. |
15 | 18 | ||
16 | Upstream-Status: Pending | 19 | Upstream-Status: Pending |
17 | 20 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | |
18 | --- | 21 | --- |
19 | include/exec/cpu-all.h | 6 +----- | 22 | include/exec/cpu-all.h | 6 +----- |
20 | include/exec/cpu_ldst.h | 16 +++++++++------- | 23 | include/exec/cpu_ldst.h | 5 ++++- |
21 | linux-user/mmap.c | 17 ++++------------- | 24 | linux-user/mmap.c | 17 ++++------------- |
22 | linux-user/syscall.c | 5 +---- | 25 | linux-user/syscall.c | 5 +---- |
23 | 4 files changed, 15 insertions(+), 29 deletions(-) | 26 | 4 files changed, 10 insertions(+), 23 deletions(-) |
24 | 27 | ||
25 | diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h | 28 | diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h |
26 | index b16c9ec5..612db6a0 100644 | 29 | index 536ea58f81..4c63a6a2e4 100644 |
27 | --- a/include/exec/cpu-all.h | 30 | --- a/include/exec/cpu-all.h |
28 | +++ b/include/exec/cpu-all.h | 31 | +++ b/include/exec/cpu-all.h |
29 | @@ -163,12 +163,8 @@ extern unsigned long guest_base; | 32 | @@ -162,12 +162,8 @@ extern unsigned long guest_base; |
30 | extern int have_guest_base; | 33 | extern int have_guest_base; |
31 | extern unsigned long reserved_va; | 34 | extern unsigned long reserved_va; |
32 | 35 | ||
@@ -41,37 +44,26 @@ index b16c9ec5..612db6a0 100644 | |||
41 | 44 | ||
42 | #include "exec/hwaddr.h" | 45 | #include "exec/hwaddr.h" |
43 | diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h | 46 | diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h |
44 | index d78041d7..845639f7 100644 | 47 | index 9151fdb042..cb2b8f329f 100644 |
45 | --- a/include/exec/cpu_ldst.h | 48 | --- a/include/exec/cpu_ldst.h |
46 | +++ b/include/exec/cpu_ldst.h | 49 | +++ b/include/exec/cpu_ldst.h |
47 | @@ -62,13 +62,15 @@ typedef uint64_t abi_ptr; | 50 | @@ -65,7 +65,10 @@ typedef uint64_t abi_ptr; |
48 | /* All direct uses of g2h and h2g need to go away for usermode softmmu. */ | 51 | #if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS |
49 | #define g2h(x) ((void *)((unsigned long)(abi_ptr)(x) + guest_base)) | 52 | #define guest_addr_valid(x) (1) |
50 | 53 | #else | |
51 | -#define guest_addr_valid(x) ((x) <= GUEST_ADDR_MAX) | 54 | -#define guest_addr_valid(x) ((x) <= GUEST_ADDR_MAX) |
52 | -#define h2g_valid(x) guest_addr_valid((unsigned long)(x) - guest_base) | 55 | +#define guest_addr_valid(x) ({ \ |
53 | - | 56 | + ((x) < (1ul << TARGET_VIRT_ADDR_SPACE_BITS)) && \ |
54 | -static inline int guest_range_valid(unsigned long start, unsigned long len) | 57 | + (!reserved_va || ((x) < reserved_va)); \ |
55 | -{ | ||
56 | - return len - 1 <= GUEST_ADDR_MAX && start <= GUEST_ADDR_MAX - len + 1; | ||
57 | -} | ||
58 | +#if HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS | ||
59 | +#define h2g_valid(x) 1 | ||
60 | +#else | ||
61 | +#define h2g_valid(x) ({ \ | ||
62 | + unsigned long __guest = (unsigned long)(x) - guest_base; \ | ||
63 | + (__guest < (1ul << TARGET_VIRT_ADDR_SPACE_BITS)) && \ | ||
64 | + (!reserved_va || (__guest < reserved_va)); \ | ||
65 | +}) | 58 | +}) |
66 | +#endif | 59 | #endif |
60 | #define h2g_valid(x) guest_addr_valid((unsigned long)(x) - guest_base) | ||
67 | 61 | ||
68 | #define h2g_nocheck(x) ({ \ | ||
69 | unsigned long __ret = (unsigned long)(x) - guest_base; \ | ||
70 | diff --git a/linux-user/mmap.c b/linux-user/mmap.c | 62 | diff --git a/linux-user/mmap.c b/linux-user/mmap.c |
71 | index e0249efe..cfe34b35 100644 | 63 | index 46a6e3a761..7735465462 100644 |
72 | --- a/linux-user/mmap.c | 64 | --- a/linux-user/mmap.c |
73 | +++ b/linux-user/mmap.c | 65 | +++ b/linux-user/mmap.c |
74 | @@ -79,7 +79,7 @@ int target_mprotect(abi_ulong start, abi_ulong len, int prot) | 66 | @@ -78,7 +78,7 @@ int target_mprotect(abi_ulong start, abi_ulong len, int prot) |
75 | return -TARGET_EINVAL; | 67 | return -TARGET_EINVAL; |
76 | len = TARGET_PAGE_ALIGN(len); | 68 | len = TARGET_PAGE_ALIGN(len); |
77 | end = start + len; | 69 | end = start + len; |
@@ -80,7 +72,7 @@ index e0249efe..cfe34b35 100644 | |||
80 | return -TARGET_ENOMEM; | 72 | return -TARGET_ENOMEM; |
81 | } | 73 | } |
82 | prot &= PROT_READ | PROT_WRITE | PROT_EXEC; | 74 | prot &= PROT_READ | PROT_WRITE | PROT_EXEC; |
83 | @@ -490,8 +490,8 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, | 75 | @@ -495,8 +495,8 @@ abi_long target_mmap(abi_ulong start, abi_ulong len, int prot, |
84 | * It can fail only on 64-bit host with 32-bit target. | 76 | * It can fail only on 64-bit host with 32-bit target. |
85 | * On any other target/host host mmap() handles this error correctly. | 77 | * On any other target/host host mmap() handles this error correctly. |
86 | */ | 78 | */ |
@@ -91,7 +83,7 @@ index e0249efe..cfe34b35 100644 | |||
91 | goto fail; | 83 | goto fail; |
92 | } | 84 | } |
93 | 85 | ||
94 | @@ -631,10 +631,8 @@ int target_munmap(abi_ulong start, abi_ulong len) | 86 | @@ -636,10 +636,8 @@ int target_munmap(abi_ulong start, abi_ulong len) |
95 | if (start & ~TARGET_PAGE_MASK) | 87 | if (start & ~TARGET_PAGE_MASK) |
96 | return -TARGET_EINVAL; | 88 | return -TARGET_EINVAL; |
97 | len = TARGET_PAGE_ALIGN(len); | 89 | len = TARGET_PAGE_ALIGN(len); |
@@ -103,7 +95,7 @@ index e0249efe..cfe34b35 100644 | |||
103 | mmap_lock(); | 95 | mmap_lock(); |
104 | end = start + len; | 96 | end = start + len; |
105 | real_start = start & qemu_host_page_mask; | 97 | real_start = start & qemu_host_page_mask; |
106 | @@ -689,13 +687,6 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size, | 98 | @@ -694,13 +692,6 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size, |
107 | int prot; | 99 | int prot; |
108 | void *host_addr; | 100 | void *host_addr; |
109 | 101 | ||
@@ -118,10 +110,10 @@ index e0249efe..cfe34b35 100644 | |||
118 | 110 | ||
119 | if (flags & MREMAP_FIXED) { | 111 | if (flags & MREMAP_FIXED) { |
120 | diff --git a/linux-user/syscall.c b/linux-user/syscall.c | 112 | diff --git a/linux-user/syscall.c b/linux-user/syscall.c |
121 | index 96cd4bf8..e6754772 100644 | 113 | index 8b41a03901..bc5d85de02 100644 |
122 | --- a/linux-user/syscall.c | 114 | --- a/linux-user/syscall.c |
123 | +++ b/linux-user/syscall.c | 115 | +++ b/linux-user/syscall.c |
124 | @@ -3860,9 +3860,6 @@ static inline abi_ulong do_shmat(CPUArchState *cpu_env, | 116 | @@ -4031,9 +4031,6 @@ static inline abi_ulong do_shmat(CPUArchState *cpu_env, |
125 | return -TARGET_EINVAL; | 117 | return -TARGET_EINVAL; |
126 | } | 118 | } |
127 | } | 119 | } |
@@ -131,7 +123,7 @@ index 96cd4bf8..e6754772 100644 | |||
131 | 123 | ||
132 | mmap_lock(); | 124 | mmap_lock(); |
133 | 125 | ||
134 | @@ -6633,7 +6630,7 @@ static int open_self_maps(void *cpu_env, int fd) | 126 | @@ -6881,7 +6878,7 @@ static int open_self_maps(void *cpu_env, int fd) |
135 | } | 127 | } |
136 | if (h2g_valid(min)) { | 128 | if (h2g_valid(min)) { |
137 | int flags = page_get_flags(h2g(min)); | 129 | int flags = page_get_flags(h2g(min)); |
@@ -140,3 +132,6 @@ index 96cd4bf8..e6754772 100644 | |||
140 | if (page_check_range(h2g(min), max - min, flags) == -1) { | 132 | if (page_check_range(h2g(min), max - min, flags) == -1) { |
141 | continue; | 133 | continue; |
142 | } | 134 | } |
135 | -- | ||
136 | 2.22.0 | ||
137 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/0011-fix-libcap-header-issue-on-some-distro.patch b/meta/recipes-devtools/qemu/qemu/0010-fix-libcap-header-issue-on-some-distro.patch index 3a7d7bbd33..3a7d7bbd33 100644 --- a/meta/recipes-devtools/qemu/qemu/0011-fix-libcap-header-issue-on-some-distro.patch +++ b/meta/recipes-devtools/qemu/qemu/0010-fix-libcap-header-issue-on-some-distro.patch | |||
diff --git a/meta/recipes-devtools/qemu/qemu/0012-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch b/meta/recipes-devtools/qemu/qemu/0011-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch index 04664195d1..e5ebfc1267 100644 --- a/meta/recipes-devtools/qemu/qemu/0012-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch +++ b/meta/recipes-devtools/qemu/qemu/0011-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch | |||
@@ -37,7 +37,7 @@ index e83f72b4..e6e2576e 100644 | |||
37 | if (err && err != ESRCH) { | 37 | if (err && err != ESRCH) { |
38 | fprintf(stderr, "qemu:%s: %s", __func__, strerror(err)); | 38 | fprintf(stderr, "qemu:%s: %s", __func__, strerror(err)); |
39 | + fprintf(stderr, "CPU #%d:\n", cpu->cpu_index); | 39 | + fprintf(stderr, "CPU #%d:\n", cpu->cpu_index); |
40 | + cpu_dump_state(cpu, stderr, fprintf, 0); | 40 | + cpu_dump_state(cpu, stderr, 0); |
41 | + backtrace_print(); | 41 | + backtrace_print(); |
42 | exit(1); | 42 | exit(1); |
43 | } | 43 | } |
diff --git a/meta/recipes-devtools/qemu/qemu/0013-target-arm-Fix-vector-operation-segfault.patch b/meta/recipes-devtools/qemu/qemu/0013-target-arm-Fix-vector-operation-segfault.patch deleted file mode 100644 index c1dd957dc9..0000000000 --- a/meta/recipes-devtools/qemu/qemu/0013-target-arm-Fix-vector-operation-segfault.patch +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | From 2f143d3ad1c05e91cf2cdf5de06d59a80a95e6c8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@wdc.com> | ||
3 | Date: Thu, 23 May 2019 14:47:43 +0100 | ||
4 | Subject: [PATCH] target/arm: Fix vector operation segfault | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Commit 89e68b575 "target/arm: Use vector operations for saturation" | ||
10 | causes this abort() when booting QEMU ARM with a Cortex-A15: | ||
11 | |||
12 | 0 0x00007ffff4c2382f in raise () at /usr/lib/libc.so.6 | ||
13 | 1 0x00007ffff4c0e672 in abort () at /usr/lib/libc.so.6 | ||
14 | 2 0x00005555559c1839 in disas_neon_data_insn (insn=<optimized out>, s=<optimized out>) at ./target/arm/translate.c:6673 | ||
15 | 3 0x00005555559c1839 in disas_neon_data_insn (s=<optimized out>, insn=<optimized out>) at ./target/arm/translate.c:6386 | ||
16 | 4 0x00005555559cd8a4 in disas_arm_insn (insn=4081107068, s=0x7fffe59a9510) at ./target/arm/translate.c:9289 | ||
17 | 5 0x00005555559cd8a4 in arm_tr_translate_insn (dcbase=0x7fffe59a9510, cpu=<optimized out>) at ./target/arm/translate.c:13612 | ||
18 | 6 0x00005555558d1d39 in translator_loop (ops=0x5555561cc580 <arm_translator_ops>, db=0x7fffe59a9510, cpu=0x55555686a2f0, tb=<optimized out>, max_insns=<optimized out>) at ./accel/tcg/translator.c:96 | ||
19 | 7 0x00005555559d10d4 in gen_intermediate_code (cpu=cpu@entry=0x55555686a2f0, tb=tb@entry=0x7fffd7840080 <code_gen_buffer+126091347>, max_insns=max_insns@entry=512) at ./target/arm/translate.c:13901 | ||
20 | 8 0x00005555558d06b9 in tb_gen_code (cpu=cpu@entry=0x55555686a2f0, pc=3067096216, cs_base=0, flags=192, cflags=-16252928, cflags@entry=524288) at ./accel/tcg/translate-all.c:1736 | ||
21 | 9 0x00005555558ce467 in tb_find (cf_mask=524288, tb_exit=1, last_tb=0x7fffd783e640 <code_gen_buffer+126084627>, cpu=0x1) at ./accel/tcg/cpu-exec.c:407 | ||
22 | 10 0x00005555558ce467 in cpu_exec (cpu=cpu@entry=0x55555686a2f0) at ./accel/tcg/cpu-exec.c:728 | ||
23 | 11 0x000055555588b0cf in tcg_cpu_exec (cpu=0x55555686a2f0) at ./cpus.c:1431 | ||
24 | 12 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=0x55555686a2f0) at ./cpus.c:1735 | ||
25 | 13 0x000055555588d223 in qemu_tcg_cpu_thread_fn (arg=arg@entry=0x55555686a2f0) at ./cpus.c:1709 | ||
26 | 14 0x0000555555d2629a in qemu_thread_start (args=<optimized out>) at ./util/qemu-thread-posix.c:502 | ||
27 | 15 0x00007ffff4db8a92 in start_thread () at /usr/lib/libpthread. | ||
28 | |||
29 | This patch ensures that we don't hit the abort() in the second switch | ||
30 | case in disas_neon_data_insn() as we will return from the first case. | ||
31 | |||
32 | Signed-off-by: Alistair Francis <alistair.francis@wdc.com> | ||
33 | Reviewed-by: Richard Henderson <richard.henderson@linaro.org> | ||
34 | Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> | ||
35 | Reviewed-by: Alex Bennée <alex.bennee@linaro.org> | ||
36 | Tested-by: Alex Bennée <alex.bennee@linaro.org> | ||
37 | Message-id: ad91b397f360b2fc7f4087e476f7df5b04d42ddb.1558021877.git.alistair.francis@wdc.com | ||
38 | Signed-off-by: Peter Maydell <peter.maydell@linaro.org> | ||
39 | Upstream-Status: Backport [4.1.0] | ||
40 | --- | ||
41 | target/arm/translate.c | 4 ++-- | ||
42 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
43 | |||
44 | diff --git a/target/arm/translate.c b/target/arm/translate.c | ||
45 | index dd053c80d6..298c262825 100644 | ||
46 | --- a/target/arm/translate.c | ||
47 | +++ b/target/arm/translate.c | ||
48 | @@ -6598,13 +6598,13 @@ static int disas_neon_data_insn(DisasContext *s, uint32_t insn) | ||
49 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | ||
50 | rn_ofs, rm_ofs, vec_size, vec_size, | ||
51 | (u ? uqadd_op : sqadd_op) + size); | ||
52 | - break; | ||
53 | + return 0; | ||
54 | |||
55 | case NEON_3R_VQSUB: | ||
56 | tcg_gen_gvec_4(rd_ofs, offsetof(CPUARMState, vfp.qc), | ||
57 | rn_ofs, rm_ofs, vec_size, vec_size, | ||
58 | (u ? uqsub_op : sqsub_op) + size); | ||
59 | - break; | ||
60 | + return 0; | ||
61 | |||
62 | case NEON_3R_VMUL: /* VMUL */ | ||
63 | if (u) { | ||
64 | -- | ||
65 | 2.21.0 | ||
66 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/0014-linux-user-fix-to-handle-variably-sized-SIOCGSTAMP-w.patch b/meta/recipes-devtools/qemu/qemu/0014-linux-user-fix-to-handle-variably-sized-SIOCGSTAMP-w.patch deleted file mode 100644 index 7cac8ef3d1..0000000000 --- a/meta/recipes-devtools/qemu/qemu/0014-linux-user-fix-to-handle-variably-sized-SIOCGSTAMP-w.patch +++ /dev/null | |||
@@ -1,339 +0,0 @@ | |||
1 | From 8104018ba4c66e568d2583a3a0ee940851ee7471 Mon Sep 17 00:00:00 2001 | ||
2 | From: Daniel P. Berrangé <berrange@redhat.com> | ||
3 | Date: Tue, 23 Jul 2019 17:50:00 +0200 | ||
4 | Subject: [PATCH] linux-user: fix to handle variably sized SIOCGSTAMP with new | ||
5 | kernels | ||
6 | MIME-Version: 1.0 | ||
7 | Content-Type: text/plain; charset=UTF-8 | ||
8 | Content-Transfer-Encoding: 8bit | ||
9 | |||
10 | The SIOCGSTAMP symbol was previously defined in the | ||
11 | asm-generic/sockios.h header file. QEMU sees that header | ||
12 | indirectly via sys/socket.h | ||
13 | |||
14 | In linux kernel commit 0768e17073dc527ccd18ed5f96ce85f9985e9115 | ||
15 | the asm-generic/sockios.h header no longer defines SIOCGSTAMP. | ||
16 | Instead it provides only SIOCGSTAMP_OLD, which only uses a | ||
17 | 32-bit time_t on 32-bit architectures. | ||
18 | |||
19 | The linux/sockios.h header then defines SIOCGSTAMP using | ||
20 | either SIOCGSTAMP_OLD or SIOCGSTAMP_NEW as appropriate. If | ||
21 | SIOCGSTAMP_NEW is used, then the tv_sec field is 64-bit even | ||
22 | on 32-bit architectures | ||
23 | |||
24 | To cope with this we must now convert the old and new type from | ||
25 | the target to the host one. | ||
26 | |||
27 | Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> | ||
28 | Signed-off-by: Laurent Vivier <laurent@vivier.eu> | ||
29 | Reviewed-by: Arnd Bergmann <arnd@arndb.de> | ||
30 | Message-Id: <20190718130641.15294-1-laurent@vivier.eu> | ||
31 | Signed-off-by: Laurent Vivier <laurent@vivier.eu> | ||
32 | Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> | ||
33 | --- | ||
34 | Upstream-Status: Backport [upstream commit: 6d5d5dde9adb5acb32e6b8e3dfbf47fff0f308d2] | ||
35 | |||
36 | linux-user/ioctls.h | 21 +++++- | ||
37 | linux-user/syscall.c | 140 +++++++++++++++++++++++++++++-------- | ||
38 | linux-user/syscall_defs.h | 30 +++++++- | ||
39 | linux-user/syscall_types.h | 6 -- | ||
40 | 4 files changed, 159 insertions(+), 38 deletions(-) | ||
41 | |||
42 | diff --git a/linux-user/ioctls.h b/linux-user/ioctls.h | ||
43 | index ae8951625f..e6a27ad9d6 100644 | ||
44 | --- a/linux-user/ioctls.h | ||
45 | +++ b/linux-user/ioctls.h | ||
46 | @@ -219,8 +219,25 @@ | ||
47 | IOCTL(SIOCGRARP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_arpreq))) | ||
48 | IOCTL(SIOCGIWNAME, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_char_ifreq))) | ||
49 | IOCTL(SIOCGPGRP, IOC_R, MK_PTR(TYPE_INT)) /* pid_t */ | ||
50 | - IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval))) | ||
51 | - IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec))) | ||
52 | + | ||
53 | + /* | ||
54 | + * We can't use IOCTL_SPECIAL() because it will set | ||
55 | + * host_cmd to XXX_OLD and XXX_NEW and these macros | ||
56 | + * are not defined with kernel prior to 5.2. | ||
57 | + * We must set host_cmd to the same value as in target_cmd | ||
58 | + * otherwise the consistency check in syscall_init() | ||
59 | + * will trigger an error. | ||
60 | + * host_cmd is ignored by the do_ioctl_XXX() helpers. | ||
61 | + * FIXME: create a macro to define this kind of entry | ||
62 | + */ | ||
63 | + { TARGET_SIOCGSTAMP_OLD, TARGET_SIOCGSTAMP_OLD, | ||
64 | + "SIOCGSTAMP_OLD", IOC_R, do_ioctl_SIOCGSTAMP }, | ||
65 | + { TARGET_SIOCGSTAMPNS_OLD, TARGET_SIOCGSTAMPNS_OLD, | ||
66 | + "SIOCGSTAMPNS_OLD", IOC_R, do_ioctl_SIOCGSTAMPNS }, | ||
67 | + { TARGET_SIOCGSTAMP_NEW, TARGET_SIOCGSTAMP_NEW, | ||
68 | + "SIOCGSTAMP_NEW", IOC_R, do_ioctl_SIOCGSTAMP }, | ||
69 | + { TARGET_SIOCGSTAMPNS_NEW, TARGET_SIOCGSTAMPNS_NEW, | ||
70 | + "SIOCGSTAMPNS_NEW", IOC_R, do_ioctl_SIOCGSTAMPNS }, | ||
71 | |||
72 | IOCTL(RNDGETENTCNT, IOC_R, MK_PTR(TYPE_INT)) | ||
73 | IOCTL(RNDADDTOENTCNT, IOC_W, MK_PTR(TYPE_INT)) | ||
74 | diff --git a/linux-user/syscall.c b/linux-user/syscall.c | ||
75 | index 96cd4bf86d..6df480e13d 100644 | ||
76 | --- a/linux-user/syscall.c | ||
77 | +++ b/linux-user/syscall.c | ||
78 | @@ -37,6 +37,7 @@ | ||
79 | #include <sched.h> | ||
80 | #include <sys/timex.h> | ||
81 | #include <sys/socket.h> | ||
82 | +#include <linux/sockios.h> | ||
83 | #include <sys/un.h> | ||
84 | #include <sys/uio.h> | ||
85 | #include <poll.h> | ||
86 | @@ -1139,8 +1140,9 @@ static inline abi_long copy_from_user_timeval(struct timeval *tv, | ||
87 | { | ||
88 | struct target_timeval *target_tv; | ||
89 | |||
90 | - if (!lock_user_struct(VERIFY_READ, target_tv, target_tv_addr, 1)) | ||
91 | + if (!lock_user_struct(VERIFY_READ, target_tv, target_tv_addr, 1)) { | ||
92 | return -TARGET_EFAULT; | ||
93 | + } | ||
94 | |||
95 | __get_user(tv->tv_sec, &target_tv->tv_sec); | ||
96 | __get_user(tv->tv_usec, &target_tv->tv_usec); | ||
97 | @@ -1155,8 +1157,26 @@ static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr, | ||
98 | { | ||
99 | struct target_timeval *target_tv; | ||
100 | |||
101 | - if (!lock_user_struct(VERIFY_WRITE, target_tv, target_tv_addr, 0)) | ||
102 | + if (!lock_user_struct(VERIFY_WRITE, target_tv, target_tv_addr, 0)) { | ||
103 | + return -TARGET_EFAULT; | ||
104 | + } | ||
105 | + | ||
106 | + __put_user(tv->tv_sec, &target_tv->tv_sec); | ||
107 | + __put_user(tv->tv_usec, &target_tv->tv_usec); | ||
108 | + | ||
109 | + unlock_user_struct(target_tv, target_tv_addr, 1); | ||
110 | + | ||
111 | + return 0; | ||
112 | +} | ||
113 | + | ||
114 | +static inline abi_long copy_to_user_timeval64(abi_ulong target_tv_addr, | ||
115 | + const struct timeval *tv) | ||
116 | +{ | ||
117 | + struct target__kernel_sock_timeval *target_tv; | ||
118 | + | ||
119 | + if (!lock_user_struct(VERIFY_WRITE, target_tv, target_tv_addr, 0)) { | ||
120 | return -TARGET_EFAULT; | ||
121 | + } | ||
122 | |||
123 | __put_user(tv->tv_sec, &target_tv->tv_sec); | ||
124 | __put_user(tv->tv_usec, &target_tv->tv_usec); | ||
125 | @@ -1166,6 +1186,48 @@ static inline abi_long copy_to_user_timeval(abi_ulong target_tv_addr, | ||
126 | return 0; | ||
127 | } | ||
128 | |||
129 | +static inline abi_long target_to_host_timespec(struct timespec *host_ts, | ||
130 | + abi_ulong target_addr) | ||
131 | +{ | ||
132 | + struct target_timespec *target_ts; | ||
133 | + | ||
134 | + if (!lock_user_struct(VERIFY_READ, target_ts, target_addr, 1)) { | ||
135 | + return -TARGET_EFAULT; | ||
136 | + } | ||
137 | + __get_user(host_ts->tv_sec, &target_ts->tv_sec); | ||
138 | + __get_user(host_ts->tv_nsec, &target_ts->tv_nsec); | ||
139 | + unlock_user_struct(target_ts, target_addr, 0); | ||
140 | + return 0; | ||
141 | +} | ||
142 | + | ||
143 | +static inline abi_long host_to_target_timespec(abi_ulong target_addr, | ||
144 | + struct timespec *host_ts) | ||
145 | +{ | ||
146 | + struct target_timespec *target_ts; | ||
147 | + | ||
148 | + if (!lock_user_struct(VERIFY_WRITE, target_ts, target_addr, 0)) { | ||
149 | + return -TARGET_EFAULT; | ||
150 | + } | ||
151 | + __put_user(host_ts->tv_sec, &target_ts->tv_sec); | ||
152 | + __put_user(host_ts->tv_nsec, &target_ts->tv_nsec); | ||
153 | + unlock_user_struct(target_ts, target_addr, 1); | ||
154 | + return 0; | ||
155 | +} | ||
156 | + | ||
157 | +static inline abi_long host_to_target_timespec64(abi_ulong target_addr, | ||
158 | + struct timespec *host_ts) | ||
159 | +{ | ||
160 | + struct target__kernel_timespec *target_ts; | ||
161 | + | ||
162 | + if (!lock_user_struct(VERIFY_WRITE, target_ts, target_addr, 0)) { | ||
163 | + return -TARGET_EFAULT; | ||
164 | + } | ||
165 | + __put_user(host_ts->tv_sec, &target_ts->tv_sec); | ||
166 | + __put_user(host_ts->tv_nsec, &target_ts->tv_nsec); | ||
167 | + unlock_user_struct(target_ts, target_addr, 1); | ||
168 | + return 0; | ||
169 | +} | ||
170 | + | ||
171 | static inline abi_long copy_from_user_timezone(struct timezone *tz, | ||
172 | abi_ulong target_tz_addr) | ||
173 | { | ||
174 | @@ -4790,6 +4852,54 @@ static abi_long do_ioctl_kdsigaccept(const IOCTLEntry *ie, uint8_t *buf_temp, | ||
175 | return get_errno(safe_ioctl(fd, ie->host_cmd, sig)); | ||
176 | } | ||
177 | |||
178 | +static abi_long do_ioctl_SIOCGSTAMP(const IOCTLEntry *ie, uint8_t *buf_temp, | ||
179 | + int fd, int cmd, abi_long arg) | ||
180 | +{ | ||
181 | + struct timeval tv; | ||
182 | + abi_long ret; | ||
183 | + | ||
184 | + ret = get_errno(safe_ioctl(fd, SIOCGSTAMP, &tv)); | ||
185 | + if (is_error(ret)) { | ||
186 | + return ret; | ||
187 | + } | ||
188 | + | ||
189 | + if (cmd == (int)TARGET_SIOCGSTAMP_OLD) { | ||
190 | + if (copy_to_user_timeval(arg, &tv)) { | ||
191 | + return -TARGET_EFAULT; | ||
192 | + } | ||
193 | + } else { | ||
194 | + if (copy_to_user_timeval64(arg, &tv)) { | ||
195 | + return -TARGET_EFAULT; | ||
196 | + } | ||
197 | + } | ||
198 | + | ||
199 | + return ret; | ||
200 | +} | ||
201 | + | ||
202 | +static abi_long do_ioctl_SIOCGSTAMPNS(const IOCTLEntry *ie, uint8_t *buf_temp, | ||
203 | + int fd, int cmd, abi_long arg) | ||
204 | +{ | ||
205 | + struct timespec ts; | ||
206 | + abi_long ret; | ||
207 | + | ||
208 | + ret = get_errno(safe_ioctl(fd, SIOCGSTAMPNS, &ts)); | ||
209 | + if (is_error(ret)) { | ||
210 | + return ret; | ||
211 | + } | ||
212 | + | ||
213 | + if (cmd == (int)TARGET_SIOCGSTAMPNS_OLD) { | ||
214 | + if (host_to_target_timespec(arg, &ts)) { | ||
215 | + return -TARGET_EFAULT; | ||
216 | + } | ||
217 | + } else{ | ||
218 | + if (host_to_target_timespec64(arg, &ts)) { | ||
219 | + return -TARGET_EFAULT; | ||
220 | + } | ||
221 | + } | ||
222 | + | ||
223 | + return ret; | ||
224 | +} | ||
225 | + | ||
226 | #ifdef TIOCGPTPEER | ||
227 | static abi_long do_ioctl_tiocgptpeer(const IOCTLEntry *ie, uint8_t *buf_temp, | ||
228 | int fd, int cmd, abi_long arg) | ||
229 | @@ -6160,32 +6270,6 @@ static inline abi_long target_ftruncate64(void *cpu_env, abi_long arg1, | ||
230 | } | ||
231 | #endif | ||
232 | |||
233 | -static inline abi_long target_to_host_timespec(struct timespec *host_ts, | ||
234 | - abi_ulong target_addr) | ||
235 | -{ | ||
236 | - struct target_timespec *target_ts; | ||
237 | - | ||
238 | - if (!lock_user_struct(VERIFY_READ, target_ts, target_addr, 1)) | ||
239 | - return -TARGET_EFAULT; | ||
240 | - __get_user(host_ts->tv_sec, &target_ts->tv_sec); | ||
241 | - __get_user(host_ts->tv_nsec, &target_ts->tv_nsec); | ||
242 | - unlock_user_struct(target_ts, target_addr, 0); | ||
243 | - return 0; | ||
244 | -} | ||
245 | - | ||
246 | -static inline abi_long host_to_target_timespec(abi_ulong target_addr, | ||
247 | - struct timespec *host_ts) | ||
248 | -{ | ||
249 | - struct target_timespec *target_ts; | ||
250 | - | ||
251 | - if (!lock_user_struct(VERIFY_WRITE, target_ts, target_addr, 0)) | ||
252 | - return -TARGET_EFAULT; | ||
253 | - __put_user(host_ts->tv_sec, &target_ts->tv_sec); | ||
254 | - __put_user(host_ts->tv_nsec, &target_ts->tv_nsec); | ||
255 | - unlock_user_struct(target_ts, target_addr, 1); | ||
256 | - return 0; | ||
257 | -} | ||
258 | - | ||
259 | static inline abi_long target_to_host_itimerspec(struct itimerspec *host_itspec, | ||
260 | abi_ulong target_addr) | ||
261 | { | ||
262 | diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h | ||
263 | index 12c8407144..c918419306 100644 | ||
264 | --- a/linux-user/syscall_defs.h | ||
265 | +++ b/linux-user/syscall_defs.h | ||
266 | @@ -208,16 +208,34 @@ struct target_linger { | ||
267 | abi_int l_linger; /* How long to linger for */ | ||
268 | }; | ||
269 | |||
270 | +#if defined(TARGET_SPARC64) && !defined(TARGET_ABI32) | ||
271 | +struct target_timeval { | ||
272 | + abi_long tv_sec; | ||
273 | + abi_int tv_usec; | ||
274 | +}; | ||
275 | +#define target__kernel_sock_timeval target_timeval | ||
276 | +#else | ||
277 | struct target_timeval { | ||
278 | abi_long tv_sec; | ||
279 | abi_long tv_usec; | ||
280 | }; | ||
281 | |||
282 | +struct target__kernel_sock_timeval { | ||
283 | + abi_llong tv_sec; | ||
284 | + abi_llong tv_usec; | ||
285 | +}; | ||
286 | +#endif | ||
287 | + | ||
288 | struct target_timespec { | ||
289 | abi_long tv_sec; | ||
290 | abi_long tv_nsec; | ||
291 | }; | ||
292 | |||
293 | +struct target__kernel_timespec { | ||
294 | + abi_llong tv_sec; | ||
295 | + abi_llong tv_nsec; | ||
296 | +}; | ||
297 | + | ||
298 | struct target_timezone { | ||
299 | abi_int tz_minuteswest; | ||
300 | abi_int tz_dsttime; | ||
301 | @@ -743,8 +761,16 @@ struct target_pollfd { | ||
302 | #define TARGET_SIOCATMARK 0x8905 | ||
303 | #define TARGET_SIOCGPGRP 0x8904 | ||
304 | #endif | ||
305 | -#define TARGET_SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ | ||
306 | -#define TARGET_SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
307 | +#if defined(TARGET_SH4) | ||
308 | +#define TARGET_SIOCGSTAMP_OLD TARGET_IOR('s', 100, struct target_timeval) | ||
309 | +#define TARGET_SIOCGSTAMPNS_OLD TARGET_IOR('s', 101, struct target_timespec) | ||
310 | +#else | ||
311 | +#define TARGET_SIOCGSTAMP_OLD 0x8906 | ||
312 | +#define TARGET_SIOCGSTAMPNS_OLD 0x8907 | ||
313 | +#endif | ||
314 | + | ||
315 | +#define TARGET_SIOCGSTAMP_NEW TARGET_IOR(0x89, 0x06, abi_llong[2]) | ||
316 | +#define TARGET_SIOCGSTAMPNS_NEW TARGET_IOR(0x89, 0x07, abi_llong[2]) | ||
317 | |||
318 | /* Networking ioctls */ | ||
319 | #define TARGET_SIOCADDRT 0x890B /* add routing table entry */ | ||
320 | diff --git a/linux-user/syscall_types.h b/linux-user/syscall_types.h | ||
321 | index b98a23b0f1..4e36983826 100644 | ||
322 | --- a/linux-user/syscall_types.h | ||
323 | +++ b/linux-user/syscall_types.h | ||
324 | @@ -14,12 +14,6 @@ STRUCT(serial_icounter_struct, | ||
325 | STRUCT(sockaddr, | ||
326 | TYPE_SHORT, MK_ARRAY(TYPE_CHAR, 14)) | ||
327 | |||
328 | -STRUCT(timeval, | ||
329 | - MK_ARRAY(TYPE_LONG, 2)) | ||
330 | - | ||
331 | -STRUCT(timespec, | ||
332 | - MK_ARRAY(TYPE_LONG, 2)) | ||
333 | - | ||
334 | STRUCT(rtentry, | ||
335 | TYPE_ULONG, MK_STRUCT(STRUCT_sockaddr), MK_STRUCT(STRUCT_sockaddr), MK_STRUCT(STRUCT_sockaddr), | ||
336 | TYPE_SHORT, TYPE_SHORT, TYPE_ULONG, TYPE_PTRVOID, TYPE_SHORT, TYPE_PTRVOID, | ||
337 | -- | ||
338 | 2.21.0 | ||
339 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/CVE-2019-12155.patch b/meta/recipes-devtools/qemu/qemu/CVE-2019-12155.patch deleted file mode 100644 index c49a5e9a2a..0000000000 --- a/meta/recipes-devtools/qemu/qemu/CVE-2019-12155.patch +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | From d52680fc932efb8a2f334cc6993e705ed1e31e99 Mon Sep 17 00:00:00 2001 | ||
2 | From: Prasad J Pandit <pjp@fedoraproject.org> | ||
3 | Date: Thu, 25 Apr 2019 12:05:34 +0530 | ||
4 | Subject: [PATCH] qxl: check release info object | ||
5 | |||
6 | When releasing spice resources in release_resource() routine, | ||
7 | if release info object 'ext.info' is null, it leads to null | ||
8 | pointer dereference. Add check to avoid it. | ||
9 | |||
10 | Reported-by: Bugs SysSec <bugs-syssec@rub.de> | ||
11 | Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org> | ||
12 | Message-id: 20190425063534.32747-1-ppandit@redhat.com | ||
13 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | CVE: CVE-2019-12155 | ||
17 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
18 | --- | ||
19 | hw/display/qxl.c | 3 +++ | ||
20 | 1 file changed, 3 insertions(+) | ||
21 | |||
22 | diff --git a/hw/display/qxl.c b/hw/display/qxl.c | ||
23 | index c8ce5781e03..632923add23 100644 | ||
24 | --- a/hw/display/qxl.c | ||
25 | +++ b/hw/display/qxl.c | ||
26 | @@ -777,6 +777,9 @@ static void interface_release_resource(QXLInstance *sin, | ||
27 | QXLReleaseRing *ring; | ||
28 | uint64_t *item, id; | ||
29 | |||
30 | + if (!ext.info) { | ||
31 | + return; | ||
32 | + } | ||
33 | if (ext.group_id == MEMSLOT_GROUP_HOST) { | ||
34 | /* host group -> vga mode update request */ | ||
35 | QXLCommandExt *cmdext = (void *)(intptr_t)(ext.info->id); | ||
diff --git a/meta/recipes-devtools/qemu/qemu_4.0.0.bb b/meta/recipes-devtools/qemu/qemu_4.1.0.bb index 76776098d0..76776098d0 100644 --- a/meta/recipes-devtools/qemu/qemu_4.0.0.bb +++ b/meta/recipes-devtools/qemu/qemu_4.1.0.bb | |||