summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-xilinx-core/conf/layer.conf2
-rw-r--r--meta-xilinx-core/recipes-connectivity/slirp/libslirp_git.bb18
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1.inc280
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch33
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch355
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0003-apic-fixup-fallthrough-to-PIC.patch44
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch29
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0005-qemu-Do-not-include-file-if-not-exists.patch32
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch49
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0007-qemu-Determinism-fixes.patch31
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch41
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch46
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch40
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/cross.patch38
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/fixedmeson.patch20
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/fixmips.patch18
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/powerpc_rom.binbin0 -> 4096 bytes
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/qemu-guest-agent.init75
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/qemu-guest-agent.udev2
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/run-ptest13
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb2
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-native-8.1.inc7
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-targets-8.1.inc28
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-2024.1.inc4
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc78
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native-8.1.inc2
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc11
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2024.1.bb10
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2024.1.bb29
-rw-r--r--meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2024.1.bb32
30 files changed, 1331 insertions, 38 deletions
diff --git a/meta-xilinx-core/conf/layer.conf b/meta-xilinx-core/conf/layer.conf
index 9c8e6b94..752eeb37 100644
--- a/meta-xilinx-core/conf/layer.conf
+++ b/meta-xilinx-core/conf/layer.conf
@@ -48,7 +48,7 @@ BUILDCFG_VARS:append = " SOC_VARIANT XILINX_RELEASE_VERSION"
48 48
49XILINX_QEMU_VERSION[v2023.1] = "v7.1.0-xilinx-v2023.1%" 49XILINX_QEMU_VERSION[v2023.1] = "v7.1.0-xilinx-v2023.1%"
50XILINX_QEMU_VERSION[v2023.2] = "v7.1.0-xilinx-v2023.2%" 50XILINX_QEMU_VERSION[v2023.2] = "v7.1.0-xilinx-v2023.2%"
51XILINX_QEMU_VERSION[v2024.1] = "v7.1.0-xilinx-v2024.1%" 51XILINX_QEMU_VERSION[v2024.1] = "v8.1.0-xilinx-v2024.1%"
52PREFERRED_VERSION_qemu-xilinx ?= "${@d.getVarFlag('XILINX_QEMU_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" 52PREFERRED_VERSION_qemu-xilinx ?= "${@d.getVarFlag('XILINX_QEMU_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}"
53PREFERRED_VERSION_qemu-xilinx-native ?= "${@d.getVarFlag('XILINX_QEMU_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" 53PREFERRED_VERSION_qemu-xilinx-native ?= "${@d.getVarFlag('XILINX_QEMU_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}"
54PREFERRED_VERSION_qemu-xilinx-system-native ?= "${@d.getVarFlag('XILINX_QEMU_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}" 54PREFERRED_VERSION_qemu-xilinx-system-native ?= "${@d.getVarFlag('XILINX_QEMU_VERSION', d.getVar('XILINX_RELEASE_VERSION')) or 'undefined'}"
diff --git a/meta-xilinx-core/recipes-connectivity/slirp/libslirp_git.bb b/meta-xilinx-core/recipes-connectivity/slirp/libslirp_git.bb
new file mode 100644
index 00000000..334b786b
--- /dev/null
+++ b/meta-xilinx-core/recipes-connectivity/slirp/libslirp_git.bb
@@ -0,0 +1,18 @@
1SUMMARY = "A general purpose TCP-IP emulator"
2DESCRIPTION = "A general purpose TCP-IP emulator used by virtual machine hypervisors to provide virtual networking services."
3HOMEPAGE = "https://gitlab.freedesktop.org/slirp/libslirp"
4LICENSE = "BSD-3-Clause & MIT"
5LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=bca0186b14e6b05e338e729f106db727"
6
7SRC_URI = "git://gitlab.freedesktop.org/slirp/libslirp.git;protocol=https;branch=master"
8SRCREV = "3ad1710a96678fe79066b1469cead4058713a1d9"
9PV = "4.7.0"
10S = "${WORKDIR}/git"
11
12DEPENDS = " \
13 glib-2.0 \
14"
15
16inherit meson pkgconfig
17
18BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1.inc
new file mode 100644
index 00000000..a6920fec
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1.inc
@@ -0,0 +1,280 @@
1SUMMARY = "Fast open source processor emulator"
2DESCRIPTION = "QEMU is a hosted virtual machine monitor: it emulates the \
3machine's processor through dynamic binary translation and provides a set \
4of different hardware and device models for the machine, enabling it to run \
5a variety of guest operating systems"
6HOMEPAGE = "http://qemu.org"
7LICENSE = "GPL-2.0-only & LGPL-2.1-only"
8
9RDEPENDS:${PN}-ptest = "bash"
10
11require qemu-targets-8.1.inc
12# https://gitlab.com/qemu-project/qemu/-/commit/81e2b198a8cb4ee5fdf108bd438f44b193ee3a36 means
13# we need a full python3-native setup
14inherit pkgconfig ptest update-rc.d systemd python3native
15
16LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
17 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
18
19SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \
20 file://powerpc_rom.bin \
21 file://run-ptest \
22 file://0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch \
23 file://0003-apic-fixup-fallthrough-to-PIC.patch \
24 file://0004-configure-Add-pkg-config-handling-for-libgcrypt.patch \
25 file://0005-qemu-Do-not-include-file-if-not-exists.patch \
26 file://0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch \
27 file://0007-qemu-Determinism-fixes.patch \
28 file://0008-tests-meson.build-use-relative-path-to-refer-to-file.patch \
29 file://0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \
30 file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \
31 file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \
32 file://fixedmeson.patch \
33 file://fixmips.patch \
34 file://qemu-guest-agent.init \
35 file://qemu-guest-agent.udev \
36 "
37UPSTREAM_CHECK_REGEX = "qemu-(?P<pver>\d+(\.\d+)+)\.tar"
38
39
40SRC_URI[sha256sum] = "541526a764576eb494d2ff5ec46aeb253e62ea29035d1c23c0a8af4e6cd4f087"
41
42SRC_URI:append:class-target = " file://cross.patch"
43SRC_URI:append:class-nativesdk = " file://cross.patch"
44
45CVE_STATUS[CVE-2017-5957] = "cpe-incorrect: Applies against virglrender < 0.6.0 and not qemu itself"
46
47CVE_STATUS[CVE-2007-0998] = "not-applicable-config: The VNC server can expose host files uder some circumstances. We don't enable it by default."
48
49# https://bugzilla.redhat.com/show_bug.cgi?id=1609015#c11
50CVE_STATUS[CVE-2018-18438] = "disputed: The issues identified by this CVE were determined to not constitute a vulnerability."
51
52# As per https://nvd.nist.gov/vuln/detail/CVE-2023-0664
53# https://bugzilla.redhat.com/show_bug.cgi?id=2167423
54CVE_STATUS[CVE-2023-0664] = "not-applicable-platform: Issue only applies on Windows"
55
56# As per https://bugzilla.redhat.com/show_bug.cgi?id=2203387
57CVE_STATUS[CVE-2023-2680] = "not-applicable-platform: RHEL specific issue."
58
59COMPATIBLE_HOST:mipsarchn32 = "null"
60COMPATIBLE_HOST:mipsarchn64 = "null"
61COMPATIBLE_HOST:riscv32 = "null"
62
63# Per https://lists.nongnu.org/archive/html/qemu-devel/2020-09/msg03873.html
64# upstream states qemu doesn't work without optimization
65DEBUG_BUILD = "0"
66
67do_install:append() {
68 # Prevent QA warnings about installed ${localstatedir}/run
69 if [ -d ${D}${localstatedir}/run ]; then rmdir ${D}${localstatedir}/run; fi
70}
71
72do_install_ptest() {
73 cp -rL ${B}/tests ${D}${PTEST_PATH}
74 find ${D}${PTEST_PATH}/tests -type f -name "*.[Sshcodp]" | xargs -i rm -rf {}
75
76 # Don't check the file genreated by configure
77 sed -i -e "1s,#!/usr/bin/bash,#!${base_bindir}/bash," ${D}${PTEST_PATH}/tests/data/acpi/disassemle-aml.sh
78
79 # Strip the paths from the QEMU variable, we can use PATH
80 makfiles=$(find ${D}${PTEST_PATH} -name "*.mak")
81 sed -i -e "s#^QEMU=.*/qemu-#QEMU=qemu-#g" $makfiles
82
83 # Strip compiler flags as they break reproducibility
84 sed -i -e "s,^CC=.*,CC=gcc," \
85 -e "s,^CCAS=.*,CCAS=gcc," \
86 -e "s,^LD=.*,LD=ld," $makfiles
87
88 # Update SRC_PATH variable to the right place on target
89 sed -i -e "s#^SRC_PATH=.*#SRC_PATH=${PTEST_PATH}#g" $makfiles
90
91 # https://gitlab.com/qemu-project/qemu/-/issues/1403
92 rm ${D}${PTEST_PATH}/tests/unit/test-io-channel-command
93}
94
95# QEMU_TARGETS is overridable variable
96QEMU_TARGETS ?= "arm aarch64 i386 loongarch64 mips mipsel mips64 mips64el ppc ppc64 ppc64le riscv32 riscv64 sh4 x86_64"
97
98EXTRA_OECONF = " \
99 --prefix=${prefix} \
100 --bindir=${bindir} \
101 --includedir=${includedir} \
102 --libdir=${libdir} \
103 --mandir=${mandir} \
104 --datadir=${datadir} \
105 --docdir=${docdir}/${BPN} \
106 --sysconfdir=${sysconfdir} \
107 --libexecdir=${libexecdir} \
108 --localstatedir=${localstatedir} \
109 --with-suffix=${BPN} \
110 --disable-strip \
111 --disable-werror \
112 --extra-cflags='${CFLAGS}' \
113 --extra-ldflags='${LDFLAGS}' \
114 --disable-download \
115 --disable-docs \
116 ${PACKAGECONFIG_CONFARGS} \
117 "
118
119B = "${WORKDIR}/build"
120
121#EXTRA_OECONF:append = " --python=${HOSTTOOLS_DIR}/python3"
122
123do_configure:prepend:class-native() {
124 # Append build host pkg-config paths for native target since the host may provide sdl
125 BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
126 if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
127 export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
128 fi
129}
130
131do_configure() {
132 ${S}/configure ${EXTRA_OECONF}
133}
134do_configure[cleandirs] += "${B}"
135
136do_install () {
137 export STRIP=""
138 oe_runmake 'DESTDIR=${D}' install
139
140 # If we built the guest agent, also install startup/udev rules
141 if [ -e "${D}${bindir}/qemu-ga" ]; then
142 install -d ${D}${sysconfdir}/init.d/
143 install -m 0755 ${WORKDIR}/qemu-guest-agent.init ${D}${sysconfdir}/init.d/qemu-guest-agent
144 sed -i 's:@bindir@:${bindir}:' ${D}${sysconfdir}/init.d/qemu-guest-agent
145
146 install -d ${D}${sysconfdir}/udev/rules.d/
147 install -m 0644 ${WORKDIR}/qemu-guest-agent.udev ${D}${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules
148
149 install -d ${D}${systemd_unitdir}/system/
150 install -m 0644 ${S}/contrib/systemd/qemu-guest-agent.service ${D}${systemd_unitdir}/system
151 sed -i -e 's,-/usr/bin/,-${bindir}/,g' ${D}${systemd_unitdir}/system/qemu-guest-agent.service
152 fi
153 # ELF binary /usr/share/qemu/s390-netboot.img has relocations in .text
154 rm ${D}${datadir}/qemu/s390-netboot.img -f
155 # ELF binary /usr/share/qemu/s390-ccw.img has relocations in .text [textrel]
156 rm ${D}${datadir}/qemu/s390-ccw.img -f
157}
158
159# The following fragment will create a wrapper for qemu-mips user emulation
160# binary in order to work around a segmentation fault issue. Basically, by
161# default, the reserved virtual address space for 32-on-64 bit is set to 4GB.
162# This will trigger a MMU access fault in the virtual CPU. With this change,
163# the qemu-mips works fine.
164# IMPORTANT: This piece needs to be removed once the root cause is fixed!
165do_install:append() {
166 if [ -e "${D}/${bindir}/qemu-mips" ]; then
167 create_wrapper ${D}/${bindir}/qemu-mips \
168 QEMU_RESERVED_VA=0x0
169 fi
170}
171# END of qemu-mips workaround
172
173# Disable kvm/virgl/mesa on targets that do not support it
174PACKAGECONFIG:remove:darwin = "kvm virglrenderer epoxy gtk+"
175PACKAGECONFIG:remove:mingw32 = "kvm virglrenderer epoxy gtk+"
176
177PACKAGECONFIG[sdl] = "--enable-sdl,--disable-sdl,libsdl2"
178PACKAGECONFIG[png] = "--enable-png,--disable-png,libpng"
179PACKAGECONFIG[virtfs] = "--enable-virtfs --enable-attr --enable-cap-ng,--disable-virtfs,libcap-ng attr,"
180PACKAGECONFIG[aio] = "--enable-linux-aio,--disable-linux-aio,libaio,"
181PACKAGECONFIG[uring] = "--enable-linux-io-uring,--disable-linux-io-uring,liburing"
182PACKAGECONFIG[xen] = "--enable-xen,--disable-xen,xen-tools,xen-tools-libxenstore xen-tools-libxenctrl xen-tools-libxenguest"
183PACKAGECONFIG[vnc-sasl] = "--enable-vnc --enable-vnc-sasl,--disable-vnc-sasl,cyrus-sasl,"
184PACKAGECONFIG[vnc-jpeg] = "--enable-vnc --enable-vnc-jpeg,--disable-vnc-jpeg,jpeg,"
185PACKAGECONFIG[libcurl] = "--enable-curl,--disable-curl,curl,"
186PACKAGECONFIG[nss] = "--enable-smartcard,--disable-smartcard,nss,"
187PACKAGECONFIG[curses] = "--enable-curses,--disable-curses,ncurses,"
188PACKAGECONFIG[gtk+] = "--enable-gtk,--disable-gtk,gtk+3 gettext-native"
189PACKAGECONFIG[vte] = "--enable-vte,--disable-vte,vte gettext-native"
190PACKAGECONFIG[libcap-ng] = "--enable-cap-ng,--disable-cap-ng,libcap-ng,"
191PACKAGECONFIG[ssh] = "--enable-libssh,--disable-libssh,libssh,"
192PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt,"
193PACKAGECONFIG[nettle] = "--enable-nettle,--disable-nettle,nettle"
194PACKAGECONFIG[libusb] = "--enable-libusb,--disable-libusb,libusb1"
195PACKAGECONFIG[fdt] = "--enable-fdt,--disable-fdt,dtc"
196PACKAGECONFIG[alsa] = "--audio-drv-list=default,,alsa-lib"
197PACKAGECONFIG[epoxy] = "--enable-opengl,--disable-opengl,libepoxy"
198PACKAGECONFIG[lzo] = "--enable-lzo,--disable-lzo,lzo"
199PACKAGECONFIG[dax] = "--enable-libdaxctl,--disable-libdaxctl,ndctl"
200PACKAGECONFIG[numa] = "--enable-numa,--disable-numa,numactl"
201PACKAGECONFIG[gnutls] = "--enable-gnutls,--disable-gnutls,gnutls"
202PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2"
203PACKAGECONFIG[libiscsi] = "--enable-libiscsi,--disable-libiscsi"
204PACKAGECONFIG[kvm] = "--enable-kvm,--disable-kvm"
205PACKAGECONFIG[virglrenderer] = "--enable-virglrenderer,--disable-virglrenderer,virglrenderer"
206# spice will be in meta-networking layer
207PACKAGECONFIG[spice] = "--enable-spice,--disable-spice,spice"
208# usbredir will be in meta-networking layer
209PACKAGECONFIG[dbus-display] = "--enable-dbus-display,--disable-dbus-display,glib-2.0-native,dbus"
210PACKAGECONFIG[usb-redir] = "--enable-usb-redir,--disable-usb-redir,usbredir"
211PACKAGECONFIG[snappy] = "--enable-snappy,--disable-snappy,snappy"
212PACKAGECONFIG[glusterfs] = "--enable-glusterfs,--disable-glusterfs,glusterfs"
213PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon"
214PACKAGECONFIG[libudev] = "--enable-libudev,--disable-libudev,udev"
215PACKAGECONFIG[attr] = "--enable-attr,--disable-attr,attr,"
216PACKAGECONFIG[rbd] = "--enable-rbd,--disable-rbd,ceph,ceph"
217PACKAGECONFIG[vhost] = "--enable-vhost-net,--disable-vhost-net,,"
218PACKAGECONFIG[ust] = "--enable-trace-backends=ust,,lttng-ust,"
219PACKAGECONFIG[pie] = "--enable-pie,--disable-pie,,"
220PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp"
221# libnfs is currently provided by meta-kodi
222PACKAGECONFIG[libnfs] = "--enable-libnfs,--disable-libnfs,libnfs"
223PACKAGECONFIG[pmem] = "--enable-libpmem,--disable-libpmem,pmdk"
224PACKAGECONFIG[pulseaudio] = "--enable-pa,--disable-pa,pulseaudio"
225PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux"
226PACKAGECONFIG[bpf] = "--enable-bpf,--disable-bpf,libbpf"
227PACKAGECONFIG[capstone] = "--enable-capstone,--disable-capstone"
228PACKAGECONFIG[rdma] = "--enable-rdma,--disable-rdma"
229PACKAGECONFIG[vde] = "--enable-vde,--disable-vde"
230PACKAGECONFIG[fuse] = "--enable-fuse --enable-fuse-lseek,--disable-fuse --disable-fuse-lseek,fuse3"
231PACKAGECONFIG[slirp] = "--enable-slirp,--disable-slirp,libslirp"
232PACKAGECONFIG[brlapi] = "--enable-brlapi,--disable-brlapi"
233PACKAGECONFIG[jack] = "--enable-jack,--disable-jack,jack,"
234PACKAGECONFIG[debuginfo] = "--enable-libdw,--disable-libdw,elfutils"
235
236INSANE_SKIP:${PN}-common = "arch"
237
238FILES:${PN} += "${datadir}/icons"
239
240# For user who want to install all arch packages
241PACKAGES =+ "${PN}-common"
242RDEPENDS:${PN} += "${PN}-common"
243
244ALLOW_EMPTY:${PN} = "1"
245FILES:${PN} = ""
246
247FILES:${PN}-common = "${bindir}/* ${includedir}/* ${libexecdir}/* ${datadir}/* ${localstatedir}"
248
249PACKAGES_DYNAMIC += "^${PN}-user-.* ^${PN}-system-.*"
250
251PACKAGESPLITFUNCS =+ "split_qemu_packages"
252
253python split_qemu_packages () {
254 archdir = d.expand('${bindir}/')
255 subpackages = do_split_packages(d, archdir, r'^qemu-system-(.*)$', '${PN}-system-%s', 'QEMU full system emulation binaries(%s)' , prepend=True, extra_depends='${PN}-common')
256
257 subpackages += do_split_packages(d, archdir, r'^qemu-((?!system|edid|ga|img|io|nbd|pr-helper|storage-daemon).*)$', '${PN}-user-%s', 'QEMU full user emulation binaries(%s)' , prepend=True, extra_depends='${PN}-common')
258 if subpackages:
259 d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(subpackages))
260 mipspackage = d.getVar('PN') + "-user-mips"
261 if mipspackage in ' '.join(subpackages):
262 d.appendVar('RDEPENDS:' + mipspackage, ' ' + d.getVar("MLPREFIX") + 'bash')
263}
264
265# Put the guest agent in a separate package
266PACKAGES =+ "${PN}-guest-agent"
267SUMMARY:${PN}-guest-agent = "QEMU guest agent"
268FILES:${PN}-guest-agent += " \
269 ${bindir}/qemu-ga \
270 ${sysconfdir}/udev/rules.d/60-qemu-guest-agent.rules \
271 ${sysconfdir}/init.d/qemu-guest-agent \
272 ${systemd_unitdir}/system/qemu-guest-agent.service \
273"
274
275INITSCRIPT_PACKAGES = "${PN}-guest-agent"
276INITSCRIPT_NAME:${PN}-guest-agent = "qemu-guest-agent"
277INITSCRIPT_PARAMS:${PN}-guest-agent = "defaults"
278
279SYSTEMD_PACKAGES = "${PN}-guest-agent"
280SYSTEMD_SERVICE:${PN}-guest-agent = "qemu-guest-agent.service"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch
new file mode 100644
index 00000000..c6550801
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch
@@ -0,0 +1,33 @@
1From de64af82950a6908f9407dfc92b83c17e2af3eab Mon Sep 17 00:00:00 2001
2From: Jason Wessel <jason.wessel@windriver.com>
3Date: Fri, 28 Mar 2014 17:42:43 +0800
4Subject: [PATCH 01/12] qemu: Add addition environment space to boot loader
5 qemu-system-mips
6
7Upstream-Status: Inappropriate - OE uses deep paths
8
9If you create a project with very long directory names like 128 characters
10deep and use NFS, the kernel arguments will be truncated. The kernel will
11accept longer strings such as 1024 bytes, but the qemu boot loader defaulted
12to only 256 bytes. This patch expands the limit.
13
14Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
15Signed-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
21Index: qemu-8.0.0/hw/mips/malta.c
22===================================================================
23--- qemu-8.0.0.orig/hw/mips/malta.c
24+++ qemu-8.0.0/hw/mips/malta.c
25@@ -64,7 +64,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
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch
new file mode 100644
index 00000000..ceae67be
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch
@@ -0,0 +1,355 @@
1From 71f14902256e3c3529710b713e1ea43100bf4c40 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 17 Dec 2022 08:37:46 -0800
4Subject: [PATCH 2/2] linux-user: Replace use of lfs64 related functions and
5 macros
6
7Builds defines -D_FILE_OFFSET_BITS=64 which makes the original functions
8anf macros behave same as their 64 suffixed counterparts. This also
9helps in compiling with latest musl C library, where these macros and
10functions are no more available under _GNU_SOURCE feature macro
11
12Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2022-12/msg02841.html]
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Cc: Laurent Vivier <laurent@vivier.eu>
15---
16 linux-user/syscall.c | 153 +++++++++++--------------------------------
17 1 file changed, 39 insertions(+), 114 deletions(-)
18
19Index: qemu-8.0.0/linux-user/syscall.c
20===================================================================
21--- qemu-8.0.0.orig/linux-user/syscall.c
22+++ qemu-8.0.0/linux-user/syscall.c
23@@ -761,8 +761,8 @@ safe_syscall6(ssize_t, copy_file_range,
24 */
25 #define safe_ioctl(...) safe_syscall(__NR_ioctl, __VA_ARGS__)
26 /* Similarly for fcntl. Note that callers must always:
27- * pass the F_GETLK64 etc constants rather than the unsuffixed F_GETLK
28- * use the flock64 struct rather than unsuffixed flock
29+ * pass the F_GETLK etc constants rather than the unsuffixed F_GETLK
30+ * use the flock struct rather than unsuffixed flock
31 * This will then work and use a 64-bit offset for both 32-bit and 64-bit hosts.
32 */
33 #ifdef __NR_fcntl64
34@@ -6813,13 +6813,13 @@ static int target_to_host_fcntl_cmd(int
35 ret = cmd;
36 break;
37 case TARGET_F_GETLK:
38- ret = F_GETLK64;
39+ ret = F_GETLK;
40 break;
41 case TARGET_F_SETLK:
42- ret = F_SETLK64;
43+ ret = F_SETLK;
44 break;
45 case TARGET_F_SETLKW:
46- ret = F_SETLKW64;
47+ ret = F_SETLKW;
48 break;
49 case TARGET_F_GETOWN:
50 ret = F_GETOWN;
51@@ -6833,17 +6833,6 @@ static int target_to_host_fcntl_cmd(int
52 case TARGET_F_SETSIG:
53 ret = F_SETSIG;
54 break;
55-#if TARGET_ABI_BITS == 32
56- case TARGET_F_GETLK64:
57- ret = F_GETLK64;
58- break;
59- case TARGET_F_SETLK64:
60- ret = F_SETLK64;
61- break;
62- case TARGET_F_SETLKW64:
63- ret = F_SETLKW64;
64- break;
65-#endif
66 case TARGET_F_SETLEASE:
67 ret = F_SETLEASE;
68 break;
69@@ -6895,8 +6884,8 @@ static int target_to_host_fcntl_cmd(int
70 * them to 5, 6 and 7 before making the syscall(). Since we make the
71 * syscall directly, adjust to what is supported by the kernel.
72 */
73- if (ret >= F_GETLK64 && ret <= F_SETLKW64) {
74- ret -= F_GETLK64 - 5;
75+ if (ret >= F_GETLK && ret <= F_SETLKW) {
76+ ret -= F_GETLK - 5;
77 }
78 #endif
79
80@@ -6929,55 +6918,11 @@ static int host_to_target_flock(int type
81 return type;
82 }
83
84-static inline abi_long copy_from_user_flock(struct flock64 *fl,
85- abi_ulong target_flock_addr)
86-{
87- struct target_flock *target_fl;
88- int l_type;
89-
90- if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) {
91- return -TARGET_EFAULT;
92- }
93-
94- __get_user(l_type, &target_fl->l_type);
95- l_type = target_to_host_flock(l_type);
96- if (l_type < 0) {
97- return l_type;
98- }
99- fl->l_type = l_type;
100- __get_user(fl->l_whence, &target_fl->l_whence);
101- __get_user(fl->l_start, &target_fl->l_start);
102- __get_user(fl->l_len, &target_fl->l_len);
103- __get_user(fl->l_pid, &target_fl->l_pid);
104- unlock_user_struct(target_fl, target_flock_addr, 0);
105- return 0;
106-}
107-
108-static inline abi_long copy_to_user_flock(abi_ulong target_flock_addr,
109- const struct flock64 *fl)
110-{
111- struct target_flock *target_fl;
112- short l_type;
113-
114- if (!lock_user_struct(VERIFY_WRITE, target_fl, target_flock_addr, 0)) {
115- return -TARGET_EFAULT;
116- }
117-
118- l_type = host_to_target_flock(fl->l_type);
119- __put_user(l_type, &target_fl->l_type);
120- __put_user(fl->l_whence, &target_fl->l_whence);
121- __put_user(fl->l_start, &target_fl->l_start);
122- __put_user(fl->l_len, &target_fl->l_len);
123- __put_user(fl->l_pid, &target_fl->l_pid);
124- unlock_user_struct(target_fl, target_flock_addr, 1);
125- return 0;
126-}
127-
128-typedef abi_long from_flock64_fn(struct flock64 *fl, abi_ulong target_addr);
129-typedef abi_long to_flock64_fn(abi_ulong target_addr, const struct flock64 *fl);
130+typedef abi_long from_flock_fn(struct flock *fl, abi_ulong target_addr);
131+typedef abi_long to_flock_fn(abi_ulong target_addr, const struct flock *fl);
132
133 #if defined(TARGET_ARM) && TARGET_ABI_BITS == 32
134-struct target_oabi_flock64 {
135+struct target_oabi_flock {
136 abi_short l_type;
137 abi_short l_whence;
138 abi_llong l_start;
139@@ -6985,10 +6930,10 @@ struct target_oabi_flock64 {
140 abi_int l_pid;
141 } QEMU_PACKED;
142
143-static inline abi_long copy_from_user_oabi_flock64(struct flock64 *fl,
144+static inline abi_long copy_from_user_oabi_flock(struct flock *fl,
145 abi_ulong target_flock_addr)
146 {
147- struct target_oabi_flock64 *target_fl;
148+ struct target_oabi_flock *target_fl;
149 int l_type;
150
151 if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) {
152@@ -7009,10 +6954,10 @@ static inline abi_long copy_from_user_oa
153 return 0;
154 }
155
156-static inline abi_long copy_to_user_oabi_flock64(abi_ulong target_flock_addr,
157- const struct flock64 *fl)
158+static inline abi_long copy_to_user_oabi_flock(abi_ulong target_flock_addr,
159+ const struct flock *fl)
160 {
161- struct target_oabi_flock64 *target_fl;
162+ struct target_oabi_flock *target_fl;
163 short l_type;
164
165 if (!lock_user_struct(VERIFY_WRITE, target_fl, target_flock_addr, 0)) {
166@@ -7030,10 +6975,10 @@ static inline abi_long copy_to_user_oabi
167 }
168 #endif
169
170-static inline abi_long copy_from_user_flock64(struct flock64 *fl,
171+static inline abi_long copy_from_user_flock(struct flock *fl,
172 abi_ulong target_flock_addr)
173 {
174- struct target_flock64 *target_fl;
175+ struct target_flock *target_fl;
176 int l_type;
177
178 if (!lock_user_struct(VERIFY_READ, target_fl, target_flock_addr, 1)) {
179@@ -7054,10 +6999,10 @@ static inline abi_long copy_from_user_fl
180 return 0;
181 }
182
183-static inline abi_long copy_to_user_flock64(abi_ulong target_flock_addr,
184- const struct flock64 *fl)
185+static inline abi_long copy_to_user_flock(abi_ulong target_flock_addr,
186+ const struct flock *fl)
187 {
188- struct target_flock64 *target_fl;
189+ struct target_flock *target_fl;
190 short l_type;
191
192 if (!lock_user_struct(VERIFY_WRITE, target_fl, target_flock_addr, 0)) {
193@@ -7076,7 +7021,7 @@ static inline abi_long copy_to_user_floc
194
195 static abi_long do_fcntl(int fd, int cmd, abi_ulong arg)
196 {
197- struct flock64 fl64;
198+ struct flock fl64;
199 #ifdef F_GETOWN_EX
200 struct f_owner_ex fox;
201 struct target_f_owner_ex *target_fox;
202@@ -7089,6 +7034,7 @@ static abi_long do_fcntl(int fd, int cmd
203
204 switch(cmd) {
205 case TARGET_F_GETLK:
206+ case TARGET_F_OFD_GETLK:
207 ret = copy_from_user_flock(&fl64, arg);
208 if (ret) {
209 return ret;
210@@ -7098,32 +7044,11 @@ static abi_long do_fcntl(int fd, int cmd
211 ret = copy_to_user_flock(arg, &fl64);
212 }
213 break;
214-
215 case TARGET_F_SETLK:
216 case TARGET_F_SETLKW:
217- ret = copy_from_user_flock(&fl64, arg);
218- if (ret) {
219- return ret;
220- }
221- ret = get_errno(safe_fcntl(fd, host_cmd, &fl64));
222- break;
223-
224- case TARGET_F_GETLK64:
225- case TARGET_F_OFD_GETLK:
226- ret = copy_from_user_flock64(&fl64, arg);
227- if (ret) {
228- return ret;
229- }
230- ret = get_errno(safe_fcntl(fd, host_cmd, &fl64));
231- if (ret == 0) {
232- ret = copy_to_user_flock64(arg, &fl64);
233- }
234- break;
235- case TARGET_F_SETLK64:
236- case TARGET_F_SETLKW64:
237 case TARGET_F_OFD_SETLK:
238 case TARGET_F_OFD_SETLKW:
239- ret = copy_from_user_flock64(&fl64, arg);
240+ ret = copy_from_user_flock(&fl64, arg);
241 if (ret) {
242 return ret;
243 }
244@@ -7348,7 +7273,7 @@ static inline abi_long target_truncate64
245 arg2 = arg3;
246 arg3 = arg4;
247 }
248- return get_errno(truncate64(arg1, target_offset64(arg2, arg3)));
249+ return get_errno(truncate(arg1, target_offset64(arg2, arg3)));
250 }
251 #endif
252
253@@ -7362,7 +7287,7 @@ static inline abi_long target_ftruncate6
254 arg2 = arg3;
255 arg3 = arg4;
256 }
257- return get_errno(ftruncate64(arg1, target_offset64(arg2, arg3)));
258+ return get_errno(ftruncate(arg1, target_offset64(arg2, arg3)));
259 }
260 #endif
261
262@@ -8598,7 +8523,7 @@ static int do_getdents(abi_long dirfd, a
263 void *tdirp;
264 int hlen, hoff, toff;
265 int hreclen, treclen;
266- off64_t prev_diroff = 0;
267+ off_t prev_diroff = 0;
268
269 hdirp = g_try_malloc(count);
270 if (!hdirp) {
271@@ -8651,7 +8576,7 @@ static int do_getdents(abi_long dirfd, a
272 * Return what we have, resetting the file pointer to the
273 * location of the first record not returned.
274 */
275- lseek64(dirfd, prev_diroff, SEEK_SET);
276+ lseek(dirfd, prev_diroff, SEEK_SET);
277 break;
278 }
279
280@@ -8685,7 +8610,7 @@ static int do_getdents64(abi_long dirfd,
281 void *tdirp;
282 int hlen, hoff, toff;
283 int hreclen, treclen;
284- off64_t prev_diroff = 0;
285+ off_t prev_diroff = 0;
286
287 hdirp = g_try_malloc(count);
288 if (!hdirp) {
289@@ -8727,7 +8652,7 @@ static int do_getdents64(abi_long dirfd,
290 * Return what we have, resetting the file pointer to the
291 * location of the first record not returned.
292 */
293- lseek64(dirfd, prev_diroff, SEEK_SET);
294+ lseek(dirfd, prev_diroff, SEEK_SET);
295 break;
296 }
297
298@@ -11158,7 +11083,7 @@ static abi_long do_syscall1(CPUArchState
299 return -TARGET_EFAULT;
300 }
301 }
302- ret = get_errno(pread64(arg1, p, arg3, target_offset64(arg4, arg5)));
303+ ret = get_errno(pread(arg1, p, arg3, target_offset64(arg4, arg5)));
304 unlock_user(p, arg2, ret);
305 return ret;
306 case TARGET_NR_pwrite64:
307@@ -11175,7 +11100,7 @@ static abi_long do_syscall1(CPUArchState
308 return -TARGET_EFAULT;
309 }
310 }
311- ret = get_errno(pwrite64(arg1, p, arg3, target_offset64(arg4, arg5)));
312+ ret = get_errno(pwrite(arg1, p, arg3, target_offset64(arg4, arg5)));
313 unlock_user(p, arg2, 0);
314 return ret;
315 #endif
316@@ -11998,14 +11923,14 @@ static abi_long do_syscall1(CPUArchState
317 case TARGET_NR_fcntl64:
318 {
319 int cmd;
320- struct flock64 fl;
321- from_flock64_fn *copyfrom = copy_from_user_flock64;
322- to_flock64_fn *copyto = copy_to_user_flock64;
323+ struct flock fl;
324+ from_flock_fn *copyfrom = copy_from_user_flock;
325+ to_flock_fn *copyto = copy_to_user_flock;
326
327 #ifdef TARGET_ARM
328 if (!cpu_env->eabi) {
329- copyfrom = copy_from_user_oabi_flock64;
330- copyto = copy_to_user_oabi_flock64;
331+ copyfrom = copy_from_user_oabi_flock;
332+ copyto = copy_to_user_oabi_flock;
333 }
334 #endif
335
336@@ -12015,7 +11940,7 @@ static abi_long do_syscall1(CPUArchState
337 }
338
339 switch(arg2) {
340- case TARGET_F_GETLK64:
341+ case TARGET_F_GETLK:
342 ret = copyfrom(&fl, arg3);
343 if (ret) {
344 break;
345@@ -12026,8 +11951,8 @@ static abi_long do_syscall1(CPUArchState
346 }
347 break;
348
349- case TARGET_F_SETLK64:
350- case TARGET_F_SETLKW64:
351+ case TARGET_F_SETLK:
352+ case TARGET_F_SETLKW:
353 ret = copyfrom(&fl, arg3);
354 if (ret) {
355 break;
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0003-apic-fixup-fallthrough-to-PIC.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0003-apic-fixup-fallthrough-to-PIC.patch
new file mode 100644
index 00000000..e85f8202
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0003-apic-fixup-fallthrough-to-PIC.patch
@@ -0,0 +1,44 @@
1From dc2a8ccd440ee3741b61606eafed3f7e092f4312 Mon Sep 17 00:00:00 2001
2From: Mark Asselstine <mark.asselstine@windriver.com>
3Date: Tue, 26 Feb 2013 11:43:28 -0500
4Subject: [PATCH 03/12] apic: fixup fallthrough to PIC
5
6Commit 0e21e12bb311c4c1095d0269dc2ef81196ccb60a [Don't route PIC
7interrupts through the local APIC if the local APIC config says so.]
8missed a check to ensure the local APIC is enabled. Since if the local
9APIC is disabled it doesn't matter what the local APIC config says.
10
11If this check isn't done and the guest has disabled the local APIC the
12guest will receive a general protection fault, similar to what is seen
13here:
14
15https://lists.gnu.org/archive/html/qemu-devel/2012-12/msg02304.html
16
17The GPF is caused by an attempt to service interrupt 0xffffffff. This
18comes about since cpu_get_pic_interrupt() calls apic_accept_pic_intr()
19(with the local APIC disabled apic_get_interrupt() returns -1).
20apic_accept_pic_intr() returns 0 and thus the interrupt number which
21is returned from cpu_get_pic_interrupt(), and which is attempted to be
22serviced, is -1.
23
24Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
25Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg00878.html]
26Signed-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
32Index: qemu-8.0.0/hw/intc/apic.c
33===================================================================
34--- qemu-8.0.0.orig/hw/intc/apic.c
35+++ qemu-8.0.0/hw/intc/apic.c
36@@ -607,7 +607,7 @@ int apic_accept_pic_intr(DeviceState *de
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];
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch
new file mode 100644
index 00000000..f981a64a
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0004-configure-Add-pkg-config-handling-for-libgcrypt.patch
@@ -0,0 +1,29 @@
1From d8265abdce5dc2bf74b3fccdf2b7257b4f3894f0 Mon Sep 17 00:00:00 2001
2From: He Zhe <zhe.he@windriver.com>
3Date: Wed, 28 Aug 2019 19:56:28 +0800
4Subject: [PATCH 04/12] configure: Add pkg-config handling for libgcrypt
5
6libgcrypt may also be controlled by pkg-config, this patch adds pkg-config
7handling for libgcrypt.
8
9Upstream-Status: Denied [https://lists.nongnu.org/archive/html/qemu-devel/2019-08/msg06333.html]
10
11Signed-off-by: He Zhe <zhe.he@windriver.com>
12
13---
14 meson.build | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17Index: qemu-8.1.0/meson.build
18===================================================================
19--- qemu-8.1.0.orig/meson.build
20+++ qemu-8.1.0/meson.build
21@@ -1481,7 +1481,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 # Debian has removed -lgpg-error from libgcrypt-config
29 # as it "spreads unnecessary dependencies" which in
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0005-qemu-Do-not-include-file-if-not-exists.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0005-qemu-Do-not-include-file-if-not-exists.patch
new file mode 100644
index 00000000..38aa4c3b
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0005-qemu-Do-not-include-file-if-not-exists.patch
@@ -0,0 +1,32 @@
1From f39e7bfc5ed07b5ecaeb705c4eae4855ca120d47 Mon Sep 17 00:00:00 2001
2From: Oleksiy Obitotskyy <oobitots@cisco.com>
3Date: Wed, 25 Mar 2020 21:21:35 +0200
4Subject: [PATCH 05/12] qemu: Do not include file if not exists
5
6Script configure checks for if_alg.h and check failed but
7if_alg.h still included.
8
9Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2020-03/msg07188.html]
10Signed-off-by: Oleksiy Obitotskyy <oobitots@cisco.com>
11
12[update patch context]
13Signed-off-by: Sakib Sajal <sakib.sajal@windriver.com>
14
15---
16 linux-user/syscall.c | 2 ++
17 1 file changed, 2 insertions(+)
18
19Index: qemu-8.0.0/linux-user/syscall.c
20===================================================================
21--- qemu-8.0.0.orig/linux-user/syscall.c
22+++ qemu-8.0.0/linux-user/syscall.c
23@@ -115,7 +115,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
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch
new file mode 100644
index 00000000..5d1d7c68
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch
@@ -0,0 +1,49 @@
1From 375cae3dd6151ef33cae8f243f6a2c2da6c0c356 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Fri, 8 Jan 2021 17:27:06 +0000
4Subject: [PATCH 06/12] qemu: Add some user space mmap tweaks to address musl
5 32 bit
6
7When using qemu-i386 to build qemux86 webkitgtk on musl, it sits in an
8infinite loop of mremap calls of ever decreasing/increasing addresses.
9
10I suspect something in the musl memory allocation code loops indefinitely
11if it only sees ENOMEM and only exits when it hits EFAULT.
12
13According to the docs, trying to mremap outside the address space
14can/should return EFAULT and changing this allows the build to succeed.
15
16A better return value for the other cases of invalid addresses is EINVAL
17rather than ENOMEM so adjust the other part of the test to this.
18
19Upstream-Status: Submitted [https://lists.gnu.org/archive/html/qemu-devel/2021-01/msg01355.html]
20Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org
21
22---
23 linux-user/mmap.c | 10 +++++++---
24 1 file changed, 7 insertions(+), 3 deletions(-)
25
26Index: qemu-8.0.0/linux-user/mmap.c
27===================================================================
28--- qemu-8.0.0.orig/linux-user/mmap.c
29+++ qemu-8.0.0/linux-user/mmap.c
30@@ -776,12 +776,16 @@ abi_long target_mremap(abi_ulong old_add
31 int prot;
32 void *host_addr;
33
34- if (!guest_range_valid_untagged(old_addr, old_size) ||
35- ((flags & MREMAP_FIXED) &&
36+ if (!guest_range_valid_untagged(old_addr, old_size)) {
37+ errno = EFAULT;
38+ return -1;
39+ }
40+
41+ if (((flags & MREMAP_FIXED) &&
42 !guest_range_valid_untagged(new_addr, new_size)) ||
43 ((flags & MREMAP_MAYMOVE) == 0 &&
44 !guest_range_valid_untagged(old_addr, new_size))) {
45- errno = ENOMEM;
46+ errno = EINVAL;
47 return -1;
48 }
49
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0007-qemu-Determinism-fixes.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0007-qemu-Determinism-fixes.patch
new file mode 100644
index 00000000..d3f965e0
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0007-qemu-Determinism-fixes.patch
@@ -0,0 +1,31 @@
1From 50bab5c2605b609ea7ea154f57a9be96d656725a Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Mon, 1 Mar 2021 13:00:47 +0000
4Subject: [PATCH 07/12] qemu: Determinism fixes
5
6When sources are included within debug information, a couple of areas of the
7qemu build are not reproducible due to either full buildpaths or timestamps.
8
9Replace the full paths with relative ones. I couldn't figure out how to get
10meson to pass relative paths but we can fix that in the script.
11
12Upstream-Status: Pending [some version of all/part of this may be accepted]
13RP 2021/3/1
14
15---
16 scripts/decodetree.py | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19Index: qemu-8.0.0/scripts/decodetree.py
20===================================================================
21--- qemu-8.0.0.orig/scripts/decodetree.py
22+++ qemu-8.0.0/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()
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch
new file mode 100644
index 00000000..a84364cc
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0008-tests-meson.build-use-relative-path-to-refer-to-file.patch
@@ -0,0 +1,41 @@
1From 2bf9388b801d4389e2d57e95a7897bfc1c42786e Mon Sep 17 00:00:00 2001
2From: Changqing Li <changqing.li@windriver.com>
3Date: Thu, 14 Jan 2021 06:33:04 +0000
4Subject: [PATCH 08/12] tests/meson.build: use relative path to refer to files
5
6Fix error like:
7Fatal error: can't create tests/ptimer-test.p/..._qemu-5.2.0_hw_core_ptimer.c.o: File name too long
8
9when build path is too long, use meson.source_root() will make this
10filename too long. Fixed by using relative path to refer to files
11
12Upstream-Status: Submitted [send to qemu-devel]
13
14Signed-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
20Index: qemu-8.0.0/tests/unit/meson.build
21===================================================================
22--- qemu-8.0.0.orig/tests/unit/meson.build
23+++ qemu-8.0.0/tests/unit/meson.build
24@@ -46,7 +46,7 @@ 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-interval-tree': [],
32 'test-xs-node': [qom],
33@@ -136,7 +136,7 @@ if have_system
34 'test-util-sockets': ['socket-helpers.c'],
35 'test-base64': [],
36 'test-bufferiszero': [],
37- 'test-smp-parse': [qom, meson.project_source_root() / 'hw/core/machine-smp.c'],
38+ 'test-smp-parse': [qom, '../../hw/core/machine-smp.c'],
39 'test-vmstate': [migration, io],
40 'test-yank': ['socket-helpers.c', qom, io, chardev]
41 }
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch
new file mode 100644
index 00000000..4de6cc24
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch
@@ -0,0 +1,46 @@
1From ebf4bb2f51da83af0c61480414cfa156f7308b34 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 21 Mar 2022 10:09:38 -0700
4Subject: [PATCH 09/12] Define MAP_SYNC and MAP_SHARED_VALIDATE on needed linux
5 systems
6
7linux only wires MAP_SYNC and MAP_SHARED_VALIDATE for architectures
8which include asm-generic/mman.h and mips/powerpc are not including this
9file in linux/mman.h, therefore these should be defined for such
10architectures on Linux as well. This fixes build on mips/musl/linux
11
12Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/qemu-devel/2022-03/msg05298.html]
13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14Cc: Zhang Yi <yi.z.zhang@linux.intel.com>
15Cc: Michael S. Tsirkin <mst@redhat.com>
16
17---
18 util/mmap-alloc.c | 10 +++++++---
19 1 file changed, 7 insertions(+), 3 deletions(-)
20
21Index: qemu-8.0.0/util/mmap-alloc.c
22===================================================================
23--- qemu-8.0.0.orig/util/mmap-alloc.c
24+++ qemu-8.0.0/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"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch
new file mode 100644
index 00000000..6caf35b6
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch
@@ -0,0 +1,40 @@
1CVE: CVE-2022-1050
2Upstream-Status: Submitted [https://lore.kernel.org/qemu-devel/20220403095234.2210-1-yuval.shaia.ml@gmail.com/]
3Signed-off-by: Ross Burton <ross.burton@arm.com>
4
5From dbdef95c272e8f3ec037c3db4197c66002e30995 Mon Sep 17 00:00:00 2001
6From: Yuval Shaia <yuval.shaia.ml@gmail.com>
7Date: Sun, 3 Apr 2022 12:52:34 +0300
8Subject: [PATCH] hw/pvrdma: Protect against buggy or malicious guest driver
9
10Guest driver might execute HW commands when shared buffers are not yet
11allocated.
12This could happen on purpose (malicious guest) or because of some other
13guest/host address mapping error.
14We need to protect againts such case.
15
16Fixes: CVE-2022-1050
17
18Reported-by: Raven <wxhusst@gmail.com>
19Signed-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
24Index: qemu-8.0.0/hw/rdma/vmw/pvrdma_cmd.c
25===================================================================
26--- qemu-8.0.0.orig/hw/rdma/vmw/pvrdma_cmd.c
27+++ qemu-8.0.0/hw/rdma/vmw/pvrdma_cmd.c
28@@ -782,6 +782,12 @@ int pvrdma_exec_cmd(PVRDMADev *dev)
29 goto out;
30 }
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");
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/cross.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/cross.patch
new file mode 100644
index 00000000..112eb925
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/cross.patch
@@ -0,0 +1,38 @@
1From 76c3fc4c87231bed32974ebbbdb5079cff45a6b7 Mon Sep 17 00:00:00 2001
2From: Richard Purdie <richard.purdie@linuxfoundation.org>
3Date: Tue, 5 Jan 2021 23:00:14 +0000
4Subject: [PATCH 12/12] qemu: Upgrade 5.1.0->5.2.0
5
6We need to be able to trigger configure's cross code but we don't want
7to set cross_prefix as it does other things we don't want. Patch things
8so we can do what we need in the target config case.
9
10Upstream-Status: Inappropriate [may be rewritten in a way upstream may accept?]
11Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
12
13---
14 configure | 4 ----
15 1 file changed, 4 deletions(-)
16
17Index: qemu-8.0.0/configure
18===================================================================
19--- qemu-8.0.0.orig/configure
20+++ qemu-8.0.0/configure
21@@ -2590,7 +2590,6 @@ if test "$skip_meson" = no; then
22 echo "widl = [$(meson_quote $widl)]" >> $cross
23 echo "windres = [$(meson_quote $windres)]" >> $cross
24 echo "windmc = [$(meson_quote $windmc)]" >> $cross
25- if test "$cross_compile" = "yes"; then
26 cross_arg="--cross-file config-meson.cross"
27 echo "[host_machine]" >> $cross
28 echo "system = '$targetos'" >> $cross
29@@ -2608,9 +2607,6 @@ if test "$skip_meson" = no; then
30 else
31 echo "endian = 'little'" >> $cross
32 fi
33- else
34- cross_arg="--native-file config-meson.cross"
35- fi
36 mv $cross config-meson.cross
37
38 rm -rf meson-private meson-info meson-logs
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/fixedmeson.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/fixedmeson.patch
new file mode 100644
index 00000000..0cbaea07
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/fixedmeson.patch
@@ -0,0 +1,20 @@
1Upstream-Status: Inappropriate [workaround, would need a real fix for upstream]
2
3Index: qemu-8.1.0/configure
4===================================================================
5--- qemu-8.1.0.orig/configure
6+++ qemu-8.1.0/configure
7@@ -1032,12 +1032,7 @@ then
8 exit 1
9 fi
10
11-# At this point, we expect Meson to be installed and available.
12-# We expect mkvenv or pip to have created pyvenv/bin/meson for us.
13-# We ignore PATH completely here: we want to use the venv's Meson
14-# *exclusively*.
15-
16-meson="$(cd pyvenv/bin; pwd)/meson"
17+meson=`which meson`
18
19 # Conditionally ensure Sphinx is installed.
20
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/fixmips.patch b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/fixmips.patch
new file mode 100644
index 00000000..01546d10
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/fixmips.patch
@@ -0,0 +1,18 @@
1Patch to fix mips boot hangs where virtio appears broken. Patch under discussion upstream.
2Regression is introduced by other fixes to 8.1.0 to get x86 boots working.
3
4Upstream-Status: Pending [https://lore.kernel.org/qemu-devel/6c956b90-5a13-db96-9c02-9834a512fe6f@linaro.org/]
5
6Index: qemu-8.1.0/softmmu/physmem.c
7===================================================================
8--- qemu-8.1.0.orig/softmmu/physmem.c
9+++ qemu-8.1.0/softmmu/physmem.c
10@@ -2517,7 +2517,7 @@ static void tcg_commit(MemoryListener *l
11 * That said, the listener is also called during realize, before
12 * all of the tcg machinery for run-on is initialized: thus halt_cond.
13 */
14- if (cpu->halt_cond) {
15+ if (cpu->halt_cond && !qemu_cpu_is_self(cpu)) {
16 async_run_on_cpu(cpu, tcg_commit_cpu, RUN_ON_CPU_HOST_PTR(cpuas));
17 } else {
18 tcg_commit_cpu(cpu, RUN_ON_CPU_HOST_PTR(cpuas));
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/powerpc_rom.bin b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/powerpc_rom.bin
new file mode 100644
index 00000000..c4044296
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/powerpc_rom.bin
Binary files differ
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/qemu-guest-agent.init b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/qemu-guest-agent.init
new file mode 100644
index 00000000..5ebaadde
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/qemu-guest-agent.init
@@ -0,0 +1,75 @@
1# SPDX-License-Identifier: GPL-2.0-only
2# Initially written by: Michael Tokarev <mjt@tls.msk.ru>
3# For QEMU Debian downstream package
4
5set -e
6
7. /etc/init.d/functions
8
9PATH=/sbin:/usr/sbin:/bin:/usr/bin
10DESC="QEMU Guest Agent"
11NAME=qemu-ga
12DAEMON=@bindir@/$NAME
13PIDFILE=/var/run/$NAME.pid
14
15# config
16DAEMON_ARGS=""
17# default transport
18TRANSPORT=virtio-serial:/dev/virtio-ports/org.qemu.guest_agent.0
19NO_START=0
20
21test ! -r /etc/default/qemu-guest-agent || . /etc/default/qemu-guest-agent
22test "$NO_START" = "0" || exit 0
23test -x "$DAEMON" || exit 0
24
25#
26# Function that checks whenever system has necessary environment
27# It also splits $TRANSPORT into $method and $path
28#
29do_check_transport() {
30 method=${TRANSPORT%%:*};
31 path=${TRANSPORT#*:}
32 case "$method" in
33 virtio-serial | isa-serial)
34 if [ ! -e "$path" ]; then
35 echo "$NAME: transport endpoint not found, not starting"
36 return 1
37 fi
38 ;;
39 esac
40}
41
42case "$1" in
43 start)
44 do_check_transport || exit 0
45 echo -n "Starting $DESC: "
46 start-stop-daemon -S -p $PIDFILE -x "$DAEMON" -- \
47 $DAEMON_ARGS -d -m "$method" -p "$path"
48 echo "$NAME."
49 ;;
50 stop)
51 echo -n "Stopping $DESC: "
52 start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
53 echo "$NAME."
54 ;;
55 status)
56 status "$DAEMON"
57 exit $?
58 ;;
59 restart|force-reload)
60 do_check_transport || exit 0
61 echo -n "Restarting $DESC: "
62 start-stop-daemon -K -x "$DAEMON" -p $PIDFILE
63 sleep 1
64 start-stop-daemon -S -p $PIDFILE -x "$DAEMON" -- \
65 $DAEMON_ARGS -d -m "$method" -p "$path"
66 echo "$NAME."
67 ;;
68 *)
69 N=/etc/init.d/$NAME
70 echo "Usage: $N {start|stop|status|restart|force-reload}" >&2
71 exit 1
72 ;;
73esac
74
75exit 0
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/qemu-guest-agent.udev b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/qemu-guest-agent.udev
new file mode 100644
index 00000000..47097057
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/qemu-guest-agent.udev
@@ -0,0 +1,2 @@
1SUBSYSTEM=="virtio-ports", ATTR{name}=="org.qemu.guest_agent.0", \
2 TAG+="systemd", ENV{SYSTEMD_WANTS}="qemu-guest-agent.service"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/run-ptest b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/run-ptest
new file mode 100644
index 00000000..f9a4e8fb
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-8.1/run-ptest
@@ -0,0 +1,13 @@
1#!/bin/sh
2#
3#This script is used to run qemu test suites
4#
5
6ptestdir=$(dirname "$(readlink -f "$0")")
7export SRC_PATH=$ptestdir
8
9cd $ptestdir/tests
10tests=$(find . -name "test-*" ! -name "*.p")
11for f in $tests; do
12 $f | sed '/^ok/ s/ok/PASS:/g'
13done
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb
index d837b9a5..2db8c778 100644
--- a/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-devicetrees_2024.1.bb
@@ -2,5 +2,5 @@
2require qemu-devicetrees.inc 2require qemu-devicetrees.inc
3 3
4BRANCH ?= "master" 4BRANCH ?= "master"
5SRCREV ?= "a1810b130c115b003d80c825eebdf0cb9ea3a2a6" 5SRCREV ?= "41ac2b04e8c52ed3935b0ba2f132ed49cf7c05fe"
6 6
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-native-8.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-native-8.1.inc
new file mode 100644
index 00000000..22fa9685
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-native-8.1.inc
@@ -0,0 +1,7 @@
1require qemu-8.1.inc
2
3inherit native
4
5EXTRA_OEMAKE:append = " LD='${LD}' AR='${AR}' OBJCOPY='${OBJCOPY}' LDFLAGS='${LDFLAGS}'"
6
7LDFLAGS:append = " -fuse-ld=bfd"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-targets-8.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-targets-8.1.inc
new file mode 100644
index 00000000..24f9a039
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-targets-8.1.inc
@@ -0,0 +1,28 @@
1# possible arch values are:
2# aarch64 arm armeb alpha cris i386 x86_64 m68k microblaze
3# mips mipsel mips64 mips64el ppc ppc64 ppc64abi32 ppcemb
4# riscv32 riscv64 sparc sparc32 sparc32plus
5
6def get_qemu_target_list(d):
7 import bb
8 archs = d.getVar('QEMU_TARGETS').split()
9 tos = d.getVar('HOST_OS')
10 softmmuonly = ""
11 for arch in ['ppcemb', 'lm32']:
12 if arch in archs:
13 softmmuonly += arch + "-softmmu,"
14 archs.remove(arch)
15 linuxuseronly = ""
16 for arch in ['armeb', 'alpha', 'ppc64abi32', 'ppc64le', 'sparc32plus', 'aarch64_be']:
17 if arch in archs:
18 linuxuseronly += arch + "-linux-user,"
19 archs.remove(arch)
20 if 'linux' not in tos:
21 return softmmuonly + ''.join([arch + "-softmmu" + "," for arch in archs]).rstrip(',')
22 return softmmuonly + linuxuseronly + ''.join([arch + "-linux-user" + "," + arch + "-softmmu" + "," for arch in archs]).rstrip(',')
23
24def get_qemu_usermode_target_list(d):
25 return ",".join(filter(lambda i: "-linux-user" in i, get_qemu_target_list(d).split(',')))
26
27def get_qemu_system_target_list(d):
28 return ",".join(filter(lambda i: "-linux-user" not in i, get_qemu_target_list(d).split(',')))
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-2024.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-2024.1.inc
index 009450fd..45a61dbd 100644
--- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-2024.1.inc
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-2024.1.inc
@@ -1,3 +1,3 @@
1XILINX_QEMU_VERSION = "v7.1.0" 1XILINX_QEMU_VERSION = "v8.1.0"
2BRANCH = "master" 2BRANCH = "master"
3SRCREV = "928f27d17acdc23c158ba223ba85b9df9eea7dc5" 3SRCREV = "df72119ac8c34a8a0a72d0ca68d987613e2b8fcd"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc
new file mode 100644
index 00000000..8a94a350
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-8.1.inc
@@ -0,0 +1,78 @@
1SUMMARY = "Xilinx's fork of a fast open source processor emulator"
2HOMEPAGE = "https://github.com/xilinx/qemu/"
3
4# This qemu fork is NOT compatible with running on a 32-bit system
5# See: https://github.com/Xilinx/qemu/issues/35
6COMPATIBLE_HOST:arm = "null"
7
8# x86_64 is needed to build nativesdks
9QEMU_TARGETS = "aarch64 arm microblaze microblazeel x86_64"
10
11LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
12 file://COPYING.LIB;endline=24;md5=8c5efda6cf1e1b03dcfd0e6c0d271c7f"
13
14FILESEXTRAPATHS:prepend := "${THISDIR}/qemu-xilinx-8.1.0:"
15
16PV = "${XILINX_QEMU_VERSION}-xilinx-v${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[1] or ''}+git${SRCPV}"
17REPO ?= "gitsm://github.com/Xilinx/qemu.git;protocol=https"
18
19BRANCHARG = "${@['nobranch=1', 'branch=${BRANCH}'][d.getVar('BRANCH', True) != '']}"
20SRC_URI = "${REPO};${BRANCHARG};name=qemu"
21SRCREV_qemu = "${SRCREV}"
22SRCREV_FORMAT = "qemu"
23
24FILESEXTRAPATHS:append := ":${THISDIR}/qemu-8.1"
25
26# Deal with the broken --disable-download
27SRCREV_berkeley-softfloat-3 = "b64af41c3276f97f0e181920400ee056b9c88037"
28SRCREV_berkeley-testfloat-3 = "40619cbb3bf32872df8c53cc457039229428a263"
29SRCREV_dtc = "b6910bec11614980a21e46fbccc35934b671bd81"
30SRCREV_keycodemapdb = "f5772a62ec52591ff6870b7e8ef32482371f22c6"
31SRCREV_libvfio-user = "0b28d205572c80b568a1003db2c8f37ca333e4d7"
32SRCREV_slirp = "26be815b86e8d49add8c9a8b320239b9594ff03d"
33SRC_URI += "\
34 git://gitlab.com/qemu-project/berkeley-softfloat-3;protocol=https;nobranch=1;destsuffix=git/subprojects/berkeley-softfloat-3;name=berkeley-softfloat-3 \
35 git://gitlab.com/qemu-project/berkeley-testfloat-3;protocol=https;nobranch=1;destsuffix=git/subprojects/berkeley-testfloat-3;name=berkeley-testfloat-3 \
36 git://gitlab.com/qemu-project/dtc.git;protocol=https;nobranch=1;destsuffix=git/subprojects/dtc;name=dtc \
37 git://gitlab.com/qemu-project/keycodemapdb.git;protocol=https;nobranch=1;destsuffix=git/subprojects/keycodemapdb;name=keycodemapdb \
38 git://gitlab.com/qemu-project/libvfio-user.git;protocol=https;nobranch=1;destsuffix=git/subprojects/libvfio-user;name=libvfio-user \
39 git://gitlab.freedesktop.org/slirp/libslirp;protocol=https;nobranch=1;destsuffix=git/subprojects/slirp;name=slirp \
40"
41
42# Configure meson for disable-download
43do_configure:prepend() {
44 cp ${S}/subprojects/packagefiles/berkeley-softfloat-3/* ${S}/subprojects/berkeley-softfloat-3/.
45 cp ${S}/subprojects/packagefiles/berkeley-testfloat-3/* ${S}/subprojects/berkeley-testfloat-3/.
46}
47
48
49# Keep this in sync with the main YP QEMU integration
50SRC_URI += "\
51 file://powerpc_rom.bin \
52 file://run-ptest \
53 file://0001-qemu-Add-addition-environment-space-to-boot-loader-q.patch \
54 file://0003-apic-fixup-fallthrough-to-PIC.patch \
55 file://0004-configure-Add-pkg-config-handling-for-libgcrypt.patch \
56 file://0005-qemu-Do-not-include-file-if-not-exists.patch \
57 file://0006-qemu-Add-some-user-space-mmap-tweaks-to-address-musl.patch \
58 file://0007-qemu-Determinism-fixes.patch \
59 file://0008-tests-meson.build-use-relative-path-to-refer-to-file.patch \
60 file://0009-Define-MAP_SYNC-and-MAP_SHARED_VALIDATE-on-needed-li.patch \
61 file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \
62 file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \
63 file://fixedmeson.patch \
64 file://qemu-guest-agent.init \
65 file://qemu-guest-agent.udev \
66 "
67
68# Patch doesn't apply to 8.1.0
69# file://fixmips.patch
70
71S = "${WORKDIR}/git"
72
73# Based on qemu settings in poky/meta/conf/distro/include/no-static-libs.inc
74DISABLE_STATIC:pn-qemu-xilinx = ""
75DISABLE_STATIC:pn-qemu-xilinx-native = ""
76DISABLE_STATIC:pn-nativesdk-qemu-xilinx = ""
77DISABLE_STATIC:pn-qemu-xilinx-system-native = ""
78
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native-8.1.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native-8.1.inc
new file mode 100644
index 00000000..ad00453f
--- /dev/null
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native-8.1.inc
@@ -0,0 +1,2 @@
1require qemu-native-8.1.inc
2require qemu-xilinx-8.1.inc
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc
deleted file mode 100644
index b22ab432..00000000
--- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native.inc
+++ /dev/null
@@ -1,11 +0,0 @@
1require recipes-devtools/qemu/qemu-native.inc
2require qemu-xilinx.inc
3
4DEPENDS = "glib-2.0-native zlib-native ninja-native meson-native"
5
6SRC_URI:remove = "file://0012-fix-libcap-header-issue-on-some-distro.patch"
7SRC_URI:remove = "file://0013-cpus.c-Add-error-messages-when-qemi_cpu_kick_thread-.patch"
8
9do_install:append(){
10 rm -rf ${D}${datadir}/icons
11}
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2024.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2024.1.bb
index 77a32ff6..ffcf064b 100644
--- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2024.1.bb
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-native_2024.1.bb
@@ -1,9 +1,11 @@
1BPN = "qemu-xilinx"
2
3DEPENDS = "glib-2.0-native zlib-native ninja-native meson-native"
4
1require qemu-xilinx-2024.1.inc 5require qemu-xilinx-2024.1.inc
2require qemu-xilinx-native-7.1.inc 6require qemu-xilinx-native-8.1.inc
3require qemu-native-alt.inc 7require qemu-native-alt.inc
4 8
5BPN = "qemu-xilinx" 9EXTRA_OECONF:append = " --target-list=${@get_qemu_usermode_target_list(d)} --disable-tools --disable-install-blobs --disable-guest-agent"
6
7EXTRA_OECONF:append = " --target-list=${@get_qemu_usermode_target_list(d)} --disable-tools --disable-blobs --disable-guest-agent"
8 10
9PACKAGECONFIG ??= "pie" 11PACKAGECONFIG ??= "pie"
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2024.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2024.1.bb
index 354c8dc3..eafa2c36 100644
--- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2024.1.bb
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx-system-native_2024.1.bb
@@ -1,23 +1,34 @@
1BPN = "qemu-xilinx"
2
3inherit python3-dir
4
1require qemu-system-native-alt.inc 5require qemu-system-native-alt.inc
2require qemu-xilinx-2024.1.inc 6require qemu-xilinx-2024.1.inc
3require qemu-xilinx-native-7.1.inc 7require qemu-xilinx-native-8.1.inc
4 8
5PROVIDES = "qemu-system-native" 9# As some of the files installed by qemu-native and qemu-system-native
10# are the same, we depend on qemu-native to get the full installation set
11# and avoid file clashes
12DEPENDS = "glib-2.0-native zlib-native pixman-native qemu-native bison-native meson-native ninja-native"
13
14DEPENDS += "qemu-xilinx-multiarch-helper-native"
6 15
7EXTRA_OECONF:append = " --target-list=${@get_qemu_system_target_list(d)}" 16EXTRA_OECONF:append = " --target-list=${@get_qemu_system_target_list(d)}"
8 17
9PACKAGECONFIG ??= "fdt alsa kvm gcrypt pie slirp" 18PACKAGECONFIG ??= "fdt alsa kvm pie slirp png gcrypt \
19 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \
20"
10 21
22# Handle distros such as CentOS 5 32-bit that do not have kvm support
11PACKAGECONFIG:remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}" 23PACKAGECONFIG:remove = "${@'kvm' if not os.path.exists('/usr/include/linux/kvm.h') else ''}"
12 24
13DEPENDS += "pixman-native qemu-xilinx-native bison-native ninja-native meson-native"
14DEPENDS += "qemu-xilinx-multiarch-helper-native"
15
16do_install:append() { 25do_install:append() {
26 install -Dm 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu-xilinx
27
17 # The following is also installed by qemu-native 28 # The following is also installed by qemu-native
18 rm -f ${D}${datadir}/qemu/trace-events-all 29 rm -f ${D}${datadir}/qemu-xilinx/trace-events-all
19 rm -rf ${D}${datadir}/qemu/keymaps 30 rm -rf ${D}${datadir}/qemu-xilinx/keymaps
20 rm -rf ${D}${datadir}/icons 31 rm -rf ${D}${datadir}/icons/
21 rm -rf ${D}${includedir}/qemu-plugin.h 32 rm -rf ${D}${includedir}/qemu-plugin.h
22 33
23 # Install qmp.py to be used with testimage 34 # Install qmp.py to be used with testimage
diff --git a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2024.1.bb b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2024.1.bb
index 7d7bea80..cff60bd6 100644
--- a/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2024.1.bb
+++ b/meta-xilinx-core/recipes-devtools/qemu/qemu-xilinx_2024.1.bb
@@ -1,6 +1,8 @@
1BBCLASSEXTEND = "nativesdk"
2
1require qemu-xilinx-2024.1.inc 3require qemu-xilinx-2024.1.inc
2require recipes-devtools/qemu/qemu.inc 4require qemu-8.1.inc
3require qemu-xilinx-7.1.inc 5require qemu-xilinx-8.1.inc
4require qemu-alt.inc 6require qemu-alt.inc
5 7
6# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific 8# Links to libmali-xlnx, so it becomes MACHINE_ARCH specific
@@ -10,17 +12,27 @@ MALI_PACKAGE_ARCH = "${@'${MACHINE_ARCH}' if d.getVar('PREFERRED_PROVIDER_virtua
10PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH" 12PACKAGE_ARCH[vardepsexclude] = "MALI_PACKAGE_ARCH"
11PACKAGE_ARCH:class-target = "${@bb.utils.contains_any('DEPENDS', 'libepoxy virglrenderer', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}" 13PACKAGE_ARCH:class-target = "${@bb.utils.contains_any('DEPENDS', 'libepoxy virglrenderer', '${MALI_PACKAGE_ARCH}', '${DEFAULT_PACKAGE_ARCH}', d)}"
12 14
13BBCLASSEXTEND = "nativesdk"
14 15
15RDEPENDS:${PN}:class-target += "bash" 16DEPENDS = "glib-2.0 zlib pixman bison-native ninja-native meson-native"
17
18DEPENDS:append:libc-musl = " libucontext"
16 19
17PROVIDES:class-nativesdk = "nativesdk-qemu" 20CFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', '', '-DEGL_NO_X11=1', d)}"
18RPROVIDES:${PN}:class-nativesdk = "nativesdk-qemu" 21
22RDEPENDS:${PN}-common:class-target += "bash"
19 23
20EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}" 24EXTRA_OECONF:append:class-target = " --target-list=${@get_qemu_target_list(d)}"
21EXTRA_OECONF:append:class-nativesdk = " --target-list=${@get_qemu_target_list(d)}"
22EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}" 25EXTRA_OECONF:append:class-target:mipsarcho32 = "${@bb.utils.contains('BBEXTENDCURR', 'multilib', ' --disable-capstone', '', d)}"
26EXTRA_OECONF:append:class-nativesdk = " --target-list=${@get_qemu_target_list(d)}"
23 27
24do_install:append:class-nativesdk() { 28PACKAGECONFIG ??= " \
25 ${@bb.utils.contains('PACKAGECONFIG', 'gtk+', 'make_qemu_wrapper', '', d)} 29 fdt sdl kvm pie slirp gcrypt \
26} 30 ${@bb.utils.filter('DISTRO_FEATURES', 'alsa pulseaudio xen', d)} \
31 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \
32 ${@bb.utils.filter('DISTRO_FEATURES', 'seccomp', d)} \
33"
34PACKAGECONFIG:class-nativesdk ??= "fdt sdl kvm pie slirp gcrypt \
35 ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'virglrenderer epoxy', '', d)} \
36"
37# ppc32 hosts are no longer supported in qemu
38COMPATIBLE_HOST:powerpc = "null"