diff options
17 files changed, 823 insertions, 0 deletions
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0001-net-tulip-Restrict-DMA-engine-to-memories.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0001-net-tulip-Restrict-DMA-engine-to-memories.patch new file mode 100644 index 00000000..6c85a77b --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0001-net-tulip-Restrict-DMA-engine-to-memories.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | CVE: CVE-2022-2962 | ||
2 | Upstream-Status: Backport | ||
3 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
4 | |||
5 | From 5c5c50b0a73d78ffe18336c9996fef5eae9bbbb0 Mon Sep 17 00:00:00 2001 | ||
6 | From: Zheyu Ma <zheyuma97@gmail.com> | ||
7 | Date: Sun, 21 Aug 2022 20:43:43 +0800 | ||
8 | Subject: [PATCH] net: tulip: Restrict DMA engine to memories | ||
9 | |||
10 | The DMA engine is started by I/O access and then itself accesses the | ||
11 | I/O registers, triggering a reentrancy bug. | ||
12 | |||
13 | The following log can reveal it: | ||
14 | ==5637==ERROR: AddressSanitizer: stack-overflow | ||
15 | #0 0x5595435f6078 in tulip_xmit_list_update qemu/hw/net/tulip.c:673 | ||
16 | #1 0x5595435f204a in tulip_write qemu/hw/net/tulip.c:805:13 | ||
17 | #2 0x559544637f86 in memory_region_write_accessor qemu/softmmu/memory.c:492:5 | ||
18 | #3 0x5595446379fa in access_with_adjusted_size qemu/softmmu/memory.c:554:18 | ||
19 | #4 0x5595446372fa in memory_region_dispatch_write qemu/softmmu/memory.c | ||
20 | #5 0x55954468b74c in flatview_write_continue qemu/softmmu/physmem.c:2825:23 | ||
21 | #6 0x559544683662 in flatview_write qemu/softmmu/physmem.c:2867:12 | ||
22 | #7 0x5595446833f3 in address_space_write qemu/softmmu/physmem.c:2963:18 | ||
23 | #8 0x5595435fb082 in dma_memory_rw_relaxed qemu/include/sysemu/dma.h:87:12 | ||
24 | #9 0x5595435fb082 in dma_memory_rw qemu/include/sysemu/dma.h:130:12 | ||
25 | #10 0x5595435fb082 in dma_memory_write qemu/include/sysemu/dma.h:171:12 | ||
26 | #11 0x5595435fb082 in stl_le_dma qemu/include/sysemu/dma.h:272:1 | ||
27 | #12 0x5595435fb082 in stl_le_pci_dma qemu/include/hw/pci/pci.h:910:1 | ||
28 | #13 0x5595435fb082 in tulip_desc_write qemu/hw/net/tulip.c:101:9 | ||
29 | #14 0x5595435f7e3d in tulip_xmit_list_update qemu/hw/net/tulip.c:706:9 | ||
30 | #15 0x5595435f204a in tulip_write qemu/hw/net/tulip.c:805:13 | ||
31 | |||
32 | Fix this bug by restricting the DMA engine to memories regions. | ||
33 | |||
34 | Signed-off-by: Zheyu Ma <zheyuma97@gmail.com> | ||
35 | Signed-off-by: Jason Wang <jasowang@redhat.com> | ||
36 | --- | ||
37 | hw/net/tulip.c | 4 ++-- | ||
38 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
39 | |||
40 | diff --git a/hw/net/tulip.c b/hw/net/tulip.c | ||
41 | index 097e905bec..b9e42c322a 100644 | ||
42 | --- a/hw/net/tulip.c | ||
43 | +++ b/hw/net/tulip.c | ||
44 | @@ -70,7 +70,7 @@ static const VMStateDescription vmstate_pci_tulip = { | ||
45 | static void tulip_desc_read(TULIPState *s, hwaddr p, | ||
46 | struct tulip_descriptor *desc) | ||
47 | { | ||
48 | - const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED; | ||
49 | + const MemTxAttrs attrs = { .memory = true }; | ||
50 | |||
51 | if (s->csr[0] & CSR0_DBO) { | ||
52 | ldl_be_pci_dma(&s->dev, p, &desc->status, attrs); | ||
53 | @@ -88,7 +88,7 @@ static void tulip_desc_read(TULIPState *s, hwaddr p, | ||
54 | static void tulip_desc_write(TULIPState *s, hwaddr p, | ||
55 | struct tulip_descriptor *desc) | ||
56 | { | ||
57 | - const MemTxAttrs attrs = MEMTXATTRS_UNSPECIFIED; | ||
58 | + const MemTxAttrs attrs = { .memory = true }; | ||
59 | |||
60 | if (s->csr[0] & CSR0_DBO) { | ||
61 | stl_be_pci_dma(&s->dev, p, desc->status, attrs); | ||
62 | -- | ||
63 | 2.34.1 | ||
64 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch new file mode 100644 index 00000000..6fb160e6 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From de64af82950a6908f9407dfc92b83c17e2af3eab Mon Sep 17 00:00:00 2001 | ||
2 | From: Jason Wessel <jason.wessel@windriver.com> | ||
3 | Date: Fri, 28 Mar 2014 17:42:43 +0800 | ||
4 | Subject: [PATCH 01/12] qemu: Add addition environment space to boot loader | ||
5 | qemu-system-mips | ||
6 | |||
7 | Upstream-Status: Inappropriate - OE uses deep paths | ||
8 | |||
9 | If you create a project with very long directory names like 128 characters | ||
10 | deep and use NFS, the kernel arguments will be truncated. The kernel will | ||
11 | accept longer strings such as 1024 bytes, but the qemu boot loader defaulted | ||
12 | to only 256 bytes. This patch expands the limit. | ||
13 | |||
14 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> | ||
15 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
16 | |||
17 | --- | ||
18 | hw/mips/malta.c | 2 +- | ||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/hw/mips/malta.c b/hw/mips/malta.c | ||
22 | index 628851172..12d37f35d 100644 | ||
23 | --- a/hw/mips/malta.c | ||
24 | +++ b/hw/mips/malta.c | ||
25 | @@ -61,7 +61,7 @@ | ||
26 | #define ENVP_PADDR 0x2000 | ||
27 | #define ENVP_VADDR cpu_mips_phys_to_kseg0(NULL, ENVP_PADDR) | ||
28 | #define ENVP_NB_ENTRIES 16 | ||
29 | -#define ENVP_ENTRY_SIZE 256 | ||
30 | +#define ENVP_ENTRY_SIZE 1024 | ||
31 | |||
32 | /* Hardware addresses */ | ||
33 | #define FLASH_ADDRESS 0x1e000000ULL | ||
34 | -- | ||
35 | 2.30.2 | ||
36 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0002-chardev-connect-socket-to-a-spawned-command.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0002-chardev-connect-socket-to-a-spawned-command.patch new file mode 100644 index 00000000..63a99c96 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0002-chardev-connect-socket-to-a-spawned-command.patch | |||
@@ -0,0 +1,246 @@ | |||
1 | From 14cd62607c9de232edf0a9b8503bd02783e03411 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alistair Francis <alistair.francis@xilinx.com> | ||
3 | Date: Thu, 21 Dec 2017 11:35:16 -0800 | ||
4 | Subject: [PATCH 02/12] chardev: connect socket to a spawned command | ||
5 | |||
6 | The command is started in a shell (sh -c) with stdin connect to QEMU | ||
7 | via a Unix domain stream socket. QEMU then exchanges data via its own | ||
8 | end of the socket, just like it normally does. | ||
9 | |||
10 | "-chardev socket" supports some ways of connecting via protocols like | ||
11 | telnet, but that is only a subset of the functionality supported by | ||
12 | tools socat. To use socat instead, for example to connect via a socks | ||
13 | proxy, use: | ||
14 | |||
15 | -chardev 'socket,id=socat,cmd=exec socat FD:0 SOCKS4A:socks-proxy.localdomain:example.com:9999,,socksuser=nobody' \ | ||
16 | -device usb-serial,chardev=socat | ||
17 | |||
18 | Beware that commas in the command must be escaped as double commas. | ||
19 | |||
20 | Or interactively in the console: | ||
21 | (qemu) chardev-add socket,id=cat,cmd=cat | ||
22 | (qemu) device_add usb-serial,chardev=cat | ||
23 | ^ac | ||
24 | # cat >/dev/ttyUSB0 | ||
25 | hello | ||
26 | hello | ||
27 | |||
28 | Another usage is starting swtpm from inside QEMU. swtpm will | ||
29 | automatically shut down once it looses the connection to the parent | ||
30 | QEMU, so there is no risk of lingering processes: | ||
31 | |||
32 | -chardev 'socket,id=chrtpm0,cmd=exec swtpm socket --terminate --ctrl type=unixio,,clientfd=0 --tpmstate dir=... --log file=swtpm.log' \ | ||
33 | -tpmdev emulator,id=tpm0,chardev=chrtpm0 \ | ||
34 | -device tpm-tis,tpmdev=tpm0 | ||
35 | |||
36 | The patch was discussed upstream, but QEMU developers believe that the | ||
37 | code calling QEMU should be responsible for managing additional | ||
38 | processes. In OE-core, that would imply enhancing runqemu and | ||
39 | oeqa. This patch is a simpler solution. | ||
40 | |||
41 | Because it is not going upstream, the patch was written so that it is | ||
42 | as simple as possible. | ||
43 | |||
44 | Upstream-Status: Inappropriate [embedded specific] | ||
45 | |||
46 | Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> | ||
47 | |||
48 | --- | ||
49 | chardev/char-socket.c | 100 ++++++++++++++++++++++++++++++++++++++++++ | ||
50 | chardev/char.c | 3 ++ | ||
51 | qapi/char.json | 5 +++ | ||
52 | 3 files changed, 108 insertions(+) | ||
53 | |||
54 | diff --git a/chardev/char-socket.c b/chardev/char-socket.c | ||
55 | index fab2d791d..c79641f24 100644 | ||
56 | --- a/chardev/char-socket.c | ||
57 | +++ b/chardev/char-socket.c | ||
58 | @@ -1315,6 +1315,67 @@ static bool qmp_chardev_validate_socket(ChardevSocket *sock, | ||
59 | return true; | ||
60 | } | ||
61 | |||
62 | +#ifndef _WIN32 | ||
63 | +static void chardev_open_socket_cmd(Chardev *chr, | ||
64 | + const char *cmd, | ||
65 | + Error **errp) | ||
66 | +{ | ||
67 | + int fds[2] = { -1, -1 }; | ||
68 | + QIOChannelSocket *sioc = NULL; | ||
69 | + pid_t pid = -1; | ||
70 | + const char *argv[] = { "/bin/sh", "-c", cmd, NULL }; | ||
71 | + | ||
72 | + /* | ||
73 | + * We need a Unix domain socket for commands like swtpm and a single | ||
74 | + * connection, therefore we cannot use qio_channel_command_new_spawn() | ||
75 | + * without patching it first. Duplicating the functionality is easier. | ||
76 | + */ | ||
77 | + if (socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC, 0, fds)) { | ||
78 | + error_setg_errno(errp, errno, "Error creating socketpair(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC)"); | ||
79 | + goto error; | ||
80 | + } | ||
81 | + | ||
82 | + pid = qemu_fork(errp); | ||
83 | + if (pid < 0) { | ||
84 | + goto error; | ||
85 | + } | ||
86 | + | ||
87 | + if (!pid) { | ||
88 | + /* child */ | ||
89 | + dup2(fds[1], STDIN_FILENO); | ||
90 | + execv(argv[0], (char * const *)argv); | ||
91 | + _exit(1); | ||
92 | + } | ||
93 | + | ||
94 | + /* | ||
95 | + * Hand over our end of the socket pair to the qio channel. | ||
96 | + * | ||
97 | + * We don't reap the child because it is expected to keep | ||
98 | + * running. We also don't support the "reconnect" option for the | ||
99 | + * same reason. | ||
100 | + */ | ||
101 | + sioc = qio_channel_socket_new_fd(fds[0], errp); | ||
102 | + if (!sioc) { | ||
103 | + goto error; | ||
104 | + } | ||
105 | + fds[0] = -1; | ||
106 | + | ||
107 | + g_free(chr->filename); | ||
108 | + chr->filename = g_strdup_printf("cmd:%s", cmd); | ||
109 | + tcp_chr_new_client(chr, sioc); | ||
110 | + | ||
111 | + error: | ||
112 | + if (fds[0] >= 0) { | ||
113 | + close(fds[0]); | ||
114 | + } | ||
115 | + if (fds[1] >= 0) { | ||
116 | + close(fds[1]); | ||
117 | + } | ||
118 | + if (sioc) { | ||
119 | + object_unref(OBJECT(sioc)); | ||
120 | + } | ||
121 | +} | ||
122 | +#endif | ||
123 | |||
124 | static void qmp_chardev_open_socket(Chardev *chr, | ||
125 | ChardevBackend *backend, | ||
126 | @@ -1323,6 +1384,9 @@ static void qmp_chardev_open_socket(Chardev *chr, | ||
127 | { | ||
128 | SocketChardev *s = SOCKET_CHARDEV(chr); | ||
129 | ChardevSocket *sock = backend->u.socket.data; | ||
130 | +#ifndef _WIN32 | ||
131 | + const char *cmd = sock->cmd; | ||
132 | +#endif | ||
133 | bool do_nodelay = sock->has_nodelay ? sock->nodelay : false; | ||
134 | bool is_listen = sock->has_server ? sock->server : true; | ||
135 | bool is_telnet = sock->has_telnet ? sock->telnet : false; | ||
136 | @@ -1393,6 +1457,14 @@ static void qmp_chardev_open_socket(Chardev *chr, | ||
137 | |||
138 | update_disconnected_filename(s); | ||
139 | |||
140 | +#ifndef _WIN32 | ||
141 | + if (cmd) { | ||
142 | + chardev_open_socket_cmd(chr, cmd, errp); | ||
143 | + | ||
144 | + /* everything ready (or failed permanently) before we return */ | ||
145 | + *be_opened = true; | ||
146 | + } else | ||
147 | +#endif | ||
148 | if (s->is_listen) { | ||
149 | if (qmp_chardev_open_socket_server(chr, is_telnet || is_tn3270, | ||
150 | is_waitconnect, errp) < 0) { | ||
151 | @@ -1412,6 +1484,9 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, | ||
152 | const char *host = qemu_opt_get(opts, "host"); | ||
153 | const char *port = qemu_opt_get(opts, "port"); | ||
154 | const char *fd = qemu_opt_get(opts, "fd"); | ||
155 | +#ifndef _WIN32 | ||
156 | + const char *cmd = qemu_opt_get(opts, "cmd"); | ||
157 | +#endif | ||
158 | #ifdef CONFIG_LINUX | ||
159 | bool tight = qemu_opt_get_bool(opts, "tight", true); | ||
160 | bool abstract = qemu_opt_get_bool(opts, "abstract", false); | ||
161 | @@ -1419,6 +1494,20 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, | ||
162 | SocketAddressLegacy *addr; | ||
163 | ChardevSocket *sock; | ||
164 | |||
165 | +#ifndef _WIN32 | ||
166 | + if (cmd) { | ||
167 | + /* | ||
168 | + * Here we have to ensure that no options are set which are incompatible with | ||
169 | + * spawning a command, otherwise unmodified code that doesn't know about | ||
170 | + * command spawning (like socket_reconnect_timeout()) might get called. | ||
171 | + */ | ||
172 | + if (path || sock->server || sock->has_telnet || sock->has_tn3270 || sock->reconnect || host || port || sock->tls_creds) { | ||
173 | + error_setg(errp, "chardev: socket: cmd does not support any additional options"); | ||
174 | + return; | ||
175 | + } | ||
176 | + } else | ||
177 | +#endif | ||
178 | + | ||
179 | if ((!!path + !!fd + !!host) > 1) { | ||
180 | error_setg(errp, | ||
181 | "None or one of 'path', 'fd' or 'host' option required."); | ||
182 | @@ -1469,13 +1558,24 @@ static void qemu_chr_parse_socket(QemuOpts *opts, ChardevBackend *backend, | ||
183 | sock->tls_creds = g_strdup(qemu_opt_get(opts, "tls-creds")); | ||
184 | sock->has_tls_authz = qemu_opt_get(opts, "tls-authz"); | ||
185 | sock->tls_authz = g_strdup(qemu_opt_get(opts, "tls-authz")); | ||
186 | +#ifndef _WIN32 | ||
187 | + sock->cmd = g_strdup(cmd); | ||
188 | +#endif | ||
189 | |||
190 | addr = g_new0(SocketAddressLegacy, 1); | ||
191 | +#ifndef _WIN32 | ||
192 | + if (path || cmd) { | ||
193 | +#else | ||
194 | if (path) { | ||
195 | +#endif | ||
196 | UnixSocketAddress *q_unix; | ||
197 | addr->type = SOCKET_ADDRESS_TYPE_UNIX; | ||
198 | q_unix = addr->u.q_unix.data = g_new0(UnixSocketAddress, 1); | ||
199 | +#ifndef _WIN32 | ||
200 | + q_unix->path = cmd ? g_strdup_printf("cmd:%s", cmd) : g_strdup(path); | ||
201 | +#else | ||
202 | q_unix->path = g_strdup(path); | ||
203 | +#endif | ||
204 | #ifdef CONFIG_LINUX | ||
205 | q_unix->has_tight = true; | ||
206 | q_unix->tight = tight; | ||
207 | diff --git a/chardev/char.c b/chardev/char.c | ||
208 | index 0169d8dde..ce9a21f41 100644 | ||
209 | --- a/chardev/char.c | ||
210 | +++ b/chardev/char.c | ||
211 | @@ -835,6 +835,9 @@ QemuOptsList qemu_chardev_opts = { | ||
212 | },{ | ||
213 | .name = "path", | ||
214 | .type = QEMU_OPT_STRING, | ||
215 | + },{ | ||
216 | + .name = "cmd", | ||
217 | + .type = QEMU_OPT_STRING, | ||
218 | },{ | ||
219 | .name = "host", | ||
220 | .type = QEMU_OPT_STRING, | ||
221 | diff --git a/qapi/char.json b/qapi/char.json | ||
222 | index 7b4215157..37feabdac 100644 | ||
223 | --- a/qapi/char.json | ||
224 | +++ b/qapi/char.json | ||
225 | @@ -250,6 +250,10 @@ | ||
226 | # | ||
227 | # @addr: socket address to listen on (server=true) | ||
228 | # or connect to (server=false) | ||
229 | +# @cmd: command to run via "sh -c" with stdin as one end of | ||
230 | +# a AF_UNIX SOCK_DSTREAM socket pair. The other end | ||
231 | +# is used by the chardev. Either an addr or a cmd can | ||
232 | +# be specified, but not both. | ||
233 | # @tls-creds: the ID of the TLS credentials object (since 2.6) | ||
234 | # @tls-authz: the ID of the QAuthZ authorization object against which | ||
235 | # the client's x509 distinguished name will be validated. This | ||
236 | @@ -276,6 +280,7 @@ | ||
237 | ## | ||
238 | { 'struct': 'ChardevSocket', | ||
239 | 'data': { 'addr': 'SocketAddressLegacy', | ||
240 | + '*cmd': 'str', | ||
241 | '*tls-creds': 'str', | ||
242 | '*tls-authz' : 'str', | ||
243 | '*server': 'bool', | ||
244 | -- | ||
245 | 2.30.2 | ||
246 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0003-apic-fixup-fallthrough-to-PIC.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0003-apic-fixup-fallthrough-to-PIC.patch new file mode 100644 index 00000000..f350ffce --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0003-apic-fixup-fallthrough-to-PIC.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From dc2a8ccd440ee3741b61606eafed3f7e092f4312 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mark Asselstine <mark.asselstine@windriver.com> | ||
3 | Date: Tue, 26 Feb 2013 11:43:28 -0500 | ||
4 | Subject: [PATCH 03/12] apic: fixup fallthrough to PIC | ||
5 | |||
6 | Commit 0e21e12bb311c4c1095d0269dc2ef81196ccb60a [Don't route PIC | ||
7 | interrupts through the local APIC if the local APIC config says so.] | ||
8 | missed a check to ensure the local APIC is enabled. Since if the local | ||
9 | APIC is disabled it doesn't matter what the local APIC config says. | ||
10 | |||
11 | If this check isn't done and the guest has disabled the local APIC the | ||
12 | guest will receive a general protection fault, similar to what is seen | ||
13 | here: | ||
14 | |||
15 | https://lists.gnu.org/archive/html/qemu-devel/2012-12/msg02304.html | ||
16 | |||
17 | The GPF is caused by an attempt to service interrupt 0xffffffff. This | ||
18 | comes about since cpu_get_pic_interrupt() calls apic_accept_pic_intr() | ||
19 | (with the local APIC disabled apic_get_interrupt() returns -1). | ||
20 | apic_accept_pic_intr() returns 0 and thus the interrupt number which | ||
21 | is returned from cpu_get_pic_interrupt(), and which is attempted to be | ||
22 | serviced, is -1. | ||
23 | |||
24 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
25 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg00878.html] | ||
26 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
27 | |||
28 | --- | ||
29 | hw/intc/apic.c | 2 +- | ||
30 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
31 | |||
32 | diff --git a/hw/intc/apic.c b/hw/intc/apic.c | ||
33 | index 3df11c34d..9506c88ce 100644 | ||
34 | --- a/hw/intc/apic.c | ||
35 | +++ b/hw/intc/apic.c | ||
36 | @@ -605,7 +605,7 @@ int apic_accept_pic_intr(DeviceState *dev) | ||
37 | APICCommonState *s = APIC(dev); | ||
38 | uint32_t lvt0; | ||
39 | |||
40 | - if (!s) | ||
41 | + if (!s || !(s->spurious_vec & APIC_SV_ENABLE)) | ||
42 | return -1; | ||
43 | |||
44 | lvt0 = s->lvt[APIC_LVT_LINT0]; | ||
45 | -- | ||
46 | 2.30.2 | ||
47 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch new file mode 100644 index 00000000..6faebd4e --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From d8265abdce5dc2bf74b3fccdf2b7257b4f3894f0 Mon Sep 17 00:00:00 2001 | ||
2 | From: He Zhe <zhe.he@windriver.com> | ||
3 | Date: Wed, 28 Aug 2019 19:56:28 +0800 | ||
4 | Subject: [PATCH 04/12] configure: Add pkg-config handling for libgcrypt | ||
5 | |||
6 | libgcrypt may also be controlled by pkg-config, this patch adds pkg-config | ||
7 | handling for libgcrypt. | ||
8 | |||
9 | Upstream-Status: Denied [https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg06333.html] | ||
10 | |||
11 | Signed-off-by: He Zhe <zhe.he@windriver.com> | ||
12 | |||
13 | --- | ||
14 | meson.build | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/meson.build b/meson.build | ||
18 | index 861de93c4..d45ff2d7c 100644 | ||
19 | --- a/meson.build | ||
20 | +++ b/meson.build | ||
21 | @@ -1063,7 +1063,7 @@ endif | ||
22 | if not gnutls_crypto.found() | ||
23 | if (not get_option('gcrypt').auto() or have_system) and not get_option('nettle').enabled() | ||
24 | gcrypt = dependency('libgcrypt', version: '>=1.8', | ||
25 | - method: 'config-tool', | ||
26 | + method: 'pkg-config', | ||
27 | required: get_option('gcrypt'), | ||
28 | kwargs: static_kwargs) | ||
29 | # Debian has removed -lgpg-error from libgcrypt-config | ||
30 | -- | ||
31 | 2.30.2 | ||
32 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0005-qemu-Do-not-include-file-if-not-exists.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0005-qemu-Do-not-include-file-if-not-exists.patch new file mode 100644 index 00000000..3f3c39f9 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0005-qemu-Do-not-include-file-if-not-exists.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From f39e7bfc5ed07b5ecaeb705c4eae4855ca120d47 Mon Sep 17 00:00:00 2001 | ||
2 | From: Oleksiy Obitotskyy <oobitots@cisco.com> | ||
3 | Date: Wed, 25 Mar 2020 21:21:35 +0200 | ||
4 | Subject: [PATCH 05/12] qemu: Do not include file if not exists | ||
5 | |||
6 | Script configure checks for if_alg.h and check failed but | ||
7 | if_alg.h still included. | ||
8 | |||
9 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg07188.html] | ||
10 | Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com> | ||
11 | |||
12 | [update patch context] | ||
13 | Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com> | ||
14 | |||
15 | --- | ||
16 | linux-user/syscall.c | 2 ++ | ||
17 | 1 file changed, 2 insertions(+) | ||
18 | |||
19 | diff --git a/linux-user/syscall.c b/linux-user/syscall.c | ||
20 | index f65045efe..340e0c6f0 100644 | ||
21 | --- a/linux-user/syscall.c | ||
22 | +++ b/linux-user/syscall.c | ||
23 | @@ -113,7 +113,9 @@ | ||
24 | #include <linux/blkpg.h> | ||
25 | #include <netpacket/packet.h> | ||
26 | #include <linux/netlink.h> | ||
27 | +#if defined(CONFIG_AF_ALG) | ||
28 | #include <linux/if_alg.h> | ||
29 | +#endif | ||
30 | #include <linux/rtc.h> | ||
31 | #include <sound/asound.h> | ||
32 | #ifdef HAVE_BTRFS_H | ||
33 | -- | ||
34 | 2.30.2 | ||
35 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch new file mode 100644 index 00000000..75c03693 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 375cae3dd6151ef33cae8f243f6a2c2da6c0c356 Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
3 | Date: Fri, 8 Jan 2021 17:27:06 +0000 | ||
4 | Subject: [PATCH 06/12] qemu: Add some user space mmap tweaks to address musl | ||
5 | 32 bit | ||
6 | |||
7 | When using qemu-i386 to build qemux86 webkitgtk on musl, it sits in an | ||
8 | infinite loop of mremap calls of ever decreasing/increasing addresses. | ||
9 | |||
10 | I suspect something in the musl memory allocation code loops indefinitely | ||
11 | if it only sees ENOMEM and only exits when it hits EFAULT. | ||
12 | |||
13 | According to the docs, trying to mremap outside the address space | ||
14 | can/should return EFAULT and changing this allows the build to succeed. | ||
15 | |||
16 | A better return value for the other cases of invalid addresses is EINVAL | ||
17 | rather than ENOMEM so adjust the other part of the test to this. | ||
18 | |||
19 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg01355.html] | ||
20 | Signed-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 | |||
26 | diff --git a/linux-user/mmap.c b/linux-user/mmap.c | ||
27 | index c125031b9..e651834a5 100644 | ||
28 | --- a/linux-user/mmap.c | ||
29 | +++ b/linux-user/mmap.c | ||
30 | @@ -749,12 +749,16 @@ abi_long target_mremap(abi_ulong old_addr, abi_ulong old_size, | ||
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 | |||
50 | -- | ||
51 | 2.30.2 | ||
52 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0007-qemu-Determinism-fixes.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0007-qemu-Determinism-fixes.patch new file mode 100644 index 00000000..0d7dae36 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0007-qemu-Determinism-fixes.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 50bab5c2605b609ea7ea154f57a9be96d656725a Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
3 | Date: Mon, 1 Mar 2021 13:00:47 +0000 | ||
4 | Subject: [PATCH 07/12] qemu: Determinism fixes | ||
5 | |||
6 | When sources are included within debug information, a couple of areas of the | ||
7 | qemu build are not reproducible due to either full buildpaths or timestamps. | ||
8 | |||
9 | Replace the full paths with relative ones. I couldn't figure out how to get | ||
10 | meson to pass relative paths but we can fix that in the script. | ||
11 | |||
12 | Upstream-Status: Pending [some version of all/part of this may be accepted] | ||
13 | RP 2021/3/1 | ||
14 | |||
15 | --- | ||
16 | scripts/decodetree.py | 2 +- | ||
17 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
18 | |||
19 | diff --git a/scripts/decodetree.py b/scripts/decodetree.py | ||
20 | index a03dc6b5e..4ea24c1f3 100644 | ||
21 | --- a/scripts/decodetree.py | ||
22 | +++ b/scripts/decodetree.py | ||
23 | @@ -1328,7 +1328,7 @@ def main(): | ||
24 | toppat = ExcMultiPattern(0) | ||
25 | |||
26 | for filename in args: | ||
27 | - input_file = filename | ||
28 | + input_file = os.path.relpath(filename) | ||
29 | f = open(filename, 'rt', encoding='utf-8') | ||
30 | parse_file(f, toppat) | ||
31 | f.close() | ||
32 | -- | ||
33 | 2.30.2 | ||
34 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch new file mode 100644 index 00000000..43d3c7cf --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 2bf9388b801d4389e2d57e95a7897bfc1c42786e Mon Sep 17 00:00:00 2001 | ||
2 | From: Changqing Li <changqing.li@windriver.com> | ||
3 | Date: Thu, 14 Jan 2021 06:33:04 +0000 | ||
4 | Subject: [PATCH 08/12] tests/meson.build: use relative path to refer to files | ||
5 | |||
6 | Fix error like: | ||
7 | Fatal error: can't create tests/ptimer-test.p/..._qemu-5.2.0_hw_core_ptimer.c.o: File name too long | ||
8 | |||
9 | when build path is too long, use meson.source_root() will make this | ||
10 | filename too long. Fixed by using relative path to refer to files | ||
11 | |||
12 | Upstream-Status: Submitted [send to qemu-devel] | ||
13 | |||
14 | Signed-off-by: Changqing Li <changqing.li@windriver.com> | ||
15 | |||
16 | --- | ||
17 | tests/unit/meson.build | 4 ++-- | ||
18 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
19 | |||
20 | diff --git a/tests/unit/meson.build b/tests/unit/meson.build | ||
21 | index 96b295263..e4c3246dc 100644 | ||
22 | --- a/tests/unit/meson.build | ||
23 | +++ b/tests/unit/meson.build | ||
24 | @@ -44,9 +44,9 @@ tests = { | ||
25 | 'test-keyval': [testqapi], | ||
26 | 'test-logging': [], | ||
27 | 'test-uuid': [], | ||
28 | - 'ptimer-test': ['ptimer-test-stubs.c', meson.project_source_root() / 'hw/core/ptimer.c'], | ||
29 | + 'ptimer-test': ['ptimer-test-stubs.c', '../../hw/core/ptimer.c'], | ||
30 | 'test-qapi-util': [], | ||
31 | - 'test-smp-parse': [qom, meson.project_source_root() / 'hw/core/machine-smp.c'], | ||
32 | + 'test-smp-parse': [qom, '../../hw/core/machine-smp.c'], | ||
33 | } | ||
34 | |||
35 | if have_system or have_tools | ||
36 | -- | ||
37 | 2.30.2 | ||
38 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch new file mode 100644 index 00000000..23d0a698 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From ebf4bb2f51da83af0c61480414cfa156f7308b34 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 21 Mar 2022 10:09:38 -0700 | ||
4 | Subject: [PATCH 09/12] Define MAP_SYNC and MAP_SHARED_VALIDATE on needed linux | ||
5 | systems | ||
6 | |||
7 | linux only wires MAP_SYNC and MAP_SHARED_VALIDATE for architectures | ||
8 | which include asm-generic/mman.h and mips/powerpc are not including this | ||
9 | file in linux/mman.h, therefore these should be defined for such | ||
10 | architectures on Linux as well. This fixes build on mips/musl/linux | ||
11 | |||
12 | Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/qemu-devel/2022-03/msg05298.html] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | Cc: Zhang Yi <yi.z.zhang@linux.intel.com> | ||
15 | Cc: Michael S. Tsirkin <mst@redhat.com> | ||
16 | |||
17 | --- | ||
18 | util/mmap-alloc.c | 10 +++++++--- | ||
19 | 1 file changed, 7 insertions(+), 3 deletions(-) | ||
20 | |||
21 | diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c | ||
22 | index 893d86435..86d3cda24 100644 | ||
23 | --- a/util/mmap-alloc.c | ||
24 | +++ b/util/mmap-alloc.c | ||
25 | @@ -10,14 +10,18 @@ | ||
26 | * later. See the COPYING file in the top-level directory. | ||
27 | */ | ||
28 | |||
29 | +#include "qemu/osdep.h" | ||
30 | #ifdef CONFIG_LINUX | ||
31 | #include <linux/mman.h> | ||
32 | -#else /* !CONFIG_LINUX */ | ||
33 | +#endif /* CONFIG_LINUX */ | ||
34 | + | ||
35 | +#ifndef MAP_SYNC | ||
36 | #define MAP_SYNC 0x0 | ||
37 | +#endif /* MAP_SYNC */ | ||
38 | +#ifndef MAP_SHARED_VALIDATE | ||
39 | #define MAP_SHARED_VALIDATE 0x0 | ||
40 | -#endif /* CONFIG_LINUX */ | ||
41 | +#endif /* MAP_SHARED_VALIDATE */ | ||
42 | |||
43 | -#include "qemu/osdep.h" | ||
44 | #include "qemu/mmap-alloc.h" | ||
45 | #include "qemu/host-utils.h" | ||
46 | #include "qemu/cutils.h" | ||
47 | -- | ||
48 | 2.30.2 | ||
49 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch new file mode 100644 index 00000000..810c74fa --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | CVE: CVE-2022-1050 | ||
2 | Upstream-Status: Submitted [https://lore.kernel.org/qemu-devel/20220403095234.2210-1-yuval.shaia.ml@gmail.com/] | ||
3 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
4 | |||
5 | From dbdef95c272e8f3ec037c3db4197c66002e30995 Mon Sep 17 00:00:00 2001 | ||
6 | From: Yuval Shaia <yuval.shaia.ml@gmail.com> | ||
7 | Date: Sun, 3 Apr 2022 12:52:34 +0300 | ||
8 | Subject: [PATCH] hw/pvrdma: Protect against buggy or malicious guest driver | ||
9 | |||
10 | Guest driver might execute HW commands when shared buffers are not yet | ||
11 | allocated. | ||
12 | This could happen on purpose (malicious guest) or because of some other | ||
13 | guest/host address mapping error. | ||
14 | We need to protect againts such case. | ||
15 | |||
16 | Fixes: CVE-2022-1050 | ||
17 | |||
18 | Reported-by: Raven <wxhusst@gmail.com> | ||
19 | Signed-off-by: Yuval Shaia <yuval.shaia.ml@gmail.com> | ||
20 | --- | ||
21 | hw/rdma/vmw/pvrdma_cmd.c | 6 ++++++ | ||
22 | 1 file changed, 6 insertions(+) | ||
23 | |||
24 | diff --git a/hw/rdma/vmw/pvrdma_cmd.c b/hw/rdma/vmw/pvrdma_cmd.c | ||
25 | index da7ddfa548..89db963c46 100644 | ||
26 | --- a/hw/rdma/vmw/pvrdma_cmd.c | ||
27 | +++ b/hw/rdma/vmw/pvrdma_cmd.c | ||
28 | @@ -796,6 +796,12 @@ int pvrdma_exec_cmd(PVRDMADev *dev) | ||
29 | |||
30 | dsr_info = &dev->dsr_info; | ||
31 | |||
32 | + if (!dsr_info->dsr) { | ||
33 | + /* Buggy or malicious guest driver */ | ||
34 | + rdma_error_report("Exec command without dsr, req or rsp buffers"); | ||
35 | + goto out; | ||
36 | + } | ||
37 | + | ||
38 | if (dsr_info->req->hdr.cmd >= sizeof(cmd_handlers) / | ||
39 | sizeof(struct cmd_handler)) { | ||
40 | rdma_error_report("Unsupported command"); | ||
41 | -- | ||
42 | 2.34.1 | ||
43 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/CVE-2022-3165.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/CVE-2022-3165.patch new file mode 100644 index 00000000..3b4a6694 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/CVE-2022-3165.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | CVE: CVE-2022-3165 | ||
2 | Upstream-Status: Backport | ||
3 | Signed-off-by: Ross Burton <ross.burton@arm.com> | ||
4 | |||
5 | From d307040b18bfcb1393b910f1bae753d5c12a4dc7 Mon Sep 17 00:00:00 2001 | ||
6 | From: Mauro Matteo Cascella <mcascell@redhat.com> | ||
7 | Date: Sun, 25 Sep 2022 22:45:11 +0200 | ||
8 | Subject: [PATCH] ui/vnc-clipboard: fix integer underflow in | ||
9 | vnc_client_cut_text_ext | ||
10 | |||
11 | Extended ClientCutText messages start with a 4-byte header. If len < 4, | ||
12 | an integer underflow occurs in vnc_client_cut_text_ext. The result is | ||
13 | used to decompress data in a while loop in inflate_buffer, leading to | ||
14 | CPU consumption and denial of service. Prevent this by checking dlen in | ||
15 | protocol_client_msg. | ||
16 | |||
17 | Fixes: CVE-2022-3165 | ||
18 | Fixes: 0bf41cab93e5 ("ui/vnc: clipboard support") | ||
19 | Reported-by: TangPeng <tangpeng@qianxin.com> | ||
20 | Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com> | ||
21 | Message-Id: <20220925204511.1103214-1-mcascell@redhat.com> | ||
22 | Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> | ||
23 | --- | ||
24 | ui/vnc.c | 11 ++++++++--- | ||
25 | 1 file changed, 8 insertions(+), 3 deletions(-) | ||
26 | |||
27 | diff --git a/ui/vnc.c b/ui/vnc.c | ||
28 | index 6a05d06147..acb3629cd8 100644 | ||
29 | --- a/ui/vnc.c | ||
30 | +++ b/ui/vnc.c | ||
31 | @@ -2442,8 +2442,8 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len) | ||
32 | if (len == 1) { | ||
33 | return 8; | ||
34 | } | ||
35 | + uint32_t dlen = abs(read_s32(data, 4)); | ||
36 | if (len == 8) { | ||
37 | - uint32_t dlen = abs(read_s32(data, 4)); | ||
38 | if (dlen > (1 << 20)) { | ||
39 | error_report("vnc: client_cut_text msg payload has %u bytes" | ||
40 | " which exceeds our limit of 1MB.", dlen); | ||
41 | @@ -2456,8 +2456,13 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len) | ||
42 | } | ||
43 | |||
44 | if (read_s32(data, 4) < 0) { | ||
45 | - vnc_client_cut_text_ext(vs, abs(read_s32(data, 4)), | ||
46 | - read_u32(data, 8), data + 12); | ||
47 | + if (dlen < 4) { | ||
48 | + error_report("vnc: malformed payload (header less than 4 bytes)" | ||
49 | + " in extended clipboard pseudo-encoding."); | ||
50 | + vnc_client_error(vs); | ||
51 | + break; | ||
52 | + } | ||
53 | + vnc_client_cut_text_ext(vs, dlen, read_u32(data, 8), data + 12); | ||
54 | break; | ||
55 | } | ||
56 | vnc_client_cut_text(vs, read_u32(data, 4), data + 8); | ||
57 | -- | ||
58 | GitLab | ||
59 | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/arm-cpreg-fix.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/arm-cpreg-fix.patch new file mode 100644 index 00000000..071691f8 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/arm-cpreg-fix.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | target/arm: mark SP_EL1 with ARM_CP_EL3_NO_EL2_KEEP | ||
2 | |||
3 | SP_EL1 must be kept when EL3 is present but EL2 is not. Therefore mark | ||
4 | it with ARM_CP_EL3_NO_EL2_KEEP. | ||
5 | |||
6 | Fixes: 696ba3771894 ("target/arm: Handle cpreg registration for missing EL") | ||
7 | Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> | ||
8 | |||
9 | Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2022-09/msg04515.html] | ||
10 | |||
11 | --- | ||
12 | target/arm/helper.c | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | Index: qemu-7.1.0/target/arm/helper.c | ||
16 | =================================================================== | ||
17 | --- qemu-7.1.0.orig/target/arm/helper.c | ||
18 | +++ qemu-7.1.0/target/arm/helper.c | ||
19 | @@ -4971,7 +4971,7 @@ static const ARMCPRegInfo v8_cp_reginfo[ | ||
20 | .fieldoffset = offsetof(CPUARMState, sp_el[0]) }, | ||
21 | { .name = "SP_EL1", .state = ARM_CP_STATE_AA64, | ||
22 | .opc0 = 3, .opc1 = 4, .crn = 4, .crm = 1, .opc2 = 0, | ||
23 | - .access = PL2_RW, .type = ARM_CP_ALIAS, | ||
24 | + .access = PL2_RW, .type = ARM_CP_ALIAS | ARM_CP_EL3_NO_EL2_KEEP, | ||
25 | .fieldoffset = offsetof(CPUARMState, sp_el[1]) }, | ||
26 | { .name = "SPSel", .state = ARM_CP_STATE_AA64, | ||
27 | .opc0 = 3, .opc1 = 0, .crn = 4, .crm = 2, .opc2 = 0, | ||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/powerpc_rom.bin b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/powerpc_rom.bin new file mode 100644 index 00000000..c4044296 --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/powerpc_rom.bin | |||
Binary files differ | |||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/qemu-7.0.0-glibc-2.36.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/qemu-7.0.0-glibc-2.36.patch new file mode 100644 index 00000000..abad1cfe --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/qemu-7.0.0-glibc-2.36.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | Avoid conflicts between sys/mount.h and linux/mount.h that are seen | ||
2 | with glibc 2.36 | ||
3 | |||
4 | Source: https://github.com/archlinux/svntogit-packages/blob/packages/qemu/trunk/qemu-7.0.0-glibc-2.36.patch | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
8 | --- a/linux-user/syscall.c | ||
9 | +++ b/linux-user/syscall.c | ||
10 | @@ -95,7 +95,25 @@ | ||
11 | #include <linux/soundcard.h> | ||
12 | #include <linux/kd.h> | ||
13 | #include <linux/mtio.h> | ||
14 | + | ||
15 | +#ifdef HAVE_SYS_MOUNT_FSCONFIG | ||
16 | +/* | ||
17 | + * glibc >= 2.36 linux/mount.h conflicts with sys/mount.h, | ||
18 | + * which in turn prevents use of linux/fs.h. So we have to | ||
19 | + * define the constants ourselves for now. | ||
20 | + */ | ||
21 | +#define FS_IOC_GETFLAGS _IOR('f', 1, long) | ||
22 | +#define FS_IOC_SETFLAGS _IOW('f', 2, long) | ||
23 | +#define FS_IOC_GETVERSION _IOR('v', 1, long) | ||
24 | +#define FS_IOC_SETVERSION _IOW('v', 2, long) | ||
25 | +#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) | ||
26 | +#define FS_IOC32_GETFLAGS _IOR('f', 1, int) | ||
27 | +#define FS_IOC32_SETFLAGS _IOW('f', 2, int) | ||
28 | +#define FS_IOC32_GETVERSION _IOR('v', 1, int) | ||
29 | +#define FS_IOC32_SETVERSION _IOW('v', 2, int) | ||
30 | +#else | ||
31 | #include <linux/fs.h> | ||
32 | +#endif | ||
33 | #include <linux/fd.h> | ||
34 | #if defined(CONFIG_FIEMAP) | ||
35 | #include <linux/fiemap.h> | ||
36 | --- a/meson.build | ||
37 | +++ b/meson.build | ||
38 | @@ -1686,6 +1686,8 @@ config_host_data.set('HAVE_OPTRESET', | ||
39 | cc.has_header_symbol('getopt.h', 'optreset')) | ||
40 | config_host_data.set('HAVE_IPPROTO_MPTCP', | ||
41 | cc.has_header_symbol('netinet/in.h', 'IPPROTO_MPTCP')) | ||
42 | +config_host_data.set('HAVE_SYS_MOUNT_FSCONFIG', | ||
43 | + cc.has_header_symbol('sys/mount.h', 'FSCONFIG_SET_FLAG')) | ||
44 | |||
45 | # has_member | ||
46 | config_host_data.set('HAVE_SIGEV_NOTIFY_THREAD_ID', | ||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/run-ptest b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/run-ptest new file mode 100644 index 00000000..f9a4e8fb --- /dev/null +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.0/run-ptest | |||
@@ -0,0 +1,13 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | #This script is used to run qemu test suites | ||
4 | # | ||
5 | |||
6 | ptestdir=$(dirname "$(readlink -f "$0")") | ||
7 | export SRC_PATH=$ptestdir | ||
8 | |||
9 | cd $ptestdir/tests | ||
10 | tests=$(find . -name "test-*" ! -name "*.p") | ||
11 | for f in $tests; do | ||
12 | $f | sed '/^ok/ s/ok/PASS:/g' | ||
13 | done | ||
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.inc index b65a1682..c8f593a7 100644 --- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.inc +++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-7.1.inc | |||
@@ -36,6 +36,8 @@ SRC_URI += "\ | |||
36 | file://0001-net-tulip-Restrict-DMA-engine-to-memories.patch \ | 36 | file://0001-net-tulip-Restrict-DMA-engine-to-memories.patch \ |
37 | file://arm-cpreg-fix.patch \ | 37 | file://arm-cpreg-fix.patch \ |
38 | file://CVE-2022-3165.patch \ | 38 | file://CVE-2022-3165.patch \ |
39 | file://qemu-guest-agent.init \ | ||
40 | file://qemu-guest-agent.udev \ | ||
39 | " | 41 | " |
40 | 42 | ||
41 | S = "${WORKDIR}/git" | 43 | S = "${WORKDIR}/git" |