pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/emulators



Module Name:    pkgsrc
Committed By:   nia
Date:           Sun Mar  2 12:45:47 UTC 2025

Modified Files:
        pkgsrc/emulators: Makefile
Added Files:
        pkgsrc/emulators/haxm: DESCR Makefile PLIST distinfo
        pkgsrc/emulators/haxm/files: haxm-mknod haxm-modload.in haxm-modunload
        pkgsrc/emulators/haxm/patches: patch-include_netbsd_hax__netbsd.h
            patch-platforms_netbsd_hax__entry.c
        pkgsrc/emulators/qemu7: DESCR Makefile PLIST distinfo options.mk
        pkgsrc/emulators/qemu7/files: Makefile.multinode-NetBSD
            hw-mips-mipssim_virtio.c
        pkgsrc/emulators/qemu7/patches: patch-audio_jackaudio.c
            patch-backends_tpm_tpm__ioctl.h patch-hw-mips-Kconfig
            patch-hw-mips-mipssim.c patch-hw_display_omap__dss.c
            patch-hw_mips_meson.build patch-hw_net_etraxfs__eth.c
            patch-hw_net_xilinx__axienet.c patch-hw_rtc_mc146818rtc.c
            patch-hw_scsi_scsi-disk.c patch-hw_usb_dev-mtp.c patch-meson.build
            patch-meson_mesonbuild_linkers_linkers.py
            patch-roms_u-boot-sam460ex_Makefile
            patch-target_arm_translate-sve.c patch-target_i386_cpu.c
            patch-target_i386_meson.build patch-target_sparc_translate.c
            patch-util_coroutine-ucontext.c patch-util_osdep.c

Log Message:
Re-import qemu7 stable branch with HAXM support.


To generate a diff of this commit:
cvs rdiff -u -r1.368 -r1.369 pkgsrc/emulators/Makefile
cvs rdiff -u -r0 -r1.3 pkgsrc/emulators/haxm/DESCR
cvs rdiff -u -r0 -r1.23 pkgsrc/emulators/haxm/Makefile
cvs rdiff -u -r0 -r1.4 pkgsrc/emulators/haxm/PLIST
cvs rdiff -u -r0 -r1.15 pkgsrc/emulators/haxm/distinfo
cvs rdiff -u -r0 -r1.4 pkgsrc/emulators/haxm/files/haxm-mknod \
    pkgsrc/emulators/haxm/files/haxm-modload.in
cvs rdiff -u -r0 -r1.3 pkgsrc/emulators/haxm/files/haxm-modunload
cvs rdiff -u -r0 -r1.3 \
    pkgsrc/emulators/haxm/patches/patch-include_netbsd_hax__netbsd.h
cvs rdiff -u -r0 -r1.5 \
    pkgsrc/emulators/haxm/patches/patch-platforms_netbsd_hax__entry.c
cvs rdiff -u -r0 -r1.1 pkgsrc/emulators/qemu7/DESCR \
    pkgsrc/emulators/qemu7/Makefile pkgsrc/emulators/qemu7/PLIST \
    pkgsrc/emulators/qemu7/distinfo pkgsrc/emulators/qemu7/options.mk
cvs rdiff -u -r0 -r1.1 pkgsrc/emulators/qemu7/files/Makefile.multinode-NetBSD \
    pkgsrc/emulators/qemu7/files/hw-mips-mipssim_virtio.c
cvs rdiff -u -r0 -r1.1 pkgsrc/emulators/qemu7/patches/patch-audio_jackaudio.c \
    pkgsrc/emulators/qemu7/patches/patch-backends_tpm_tpm__ioctl.h \
    pkgsrc/emulators/qemu7/patches/patch-hw-mips-Kconfig \
    pkgsrc/emulators/qemu7/patches/patch-hw-mips-mipssim.c \
    pkgsrc/emulators/qemu7/patches/patch-hw_display_omap__dss.c \
    pkgsrc/emulators/qemu7/patches/patch-hw_mips_meson.build \
    pkgsrc/emulators/qemu7/patches/patch-hw_net_etraxfs__eth.c \
    pkgsrc/emulators/qemu7/patches/patch-hw_net_xilinx__axienet.c \
    pkgsrc/emulators/qemu7/patches/patch-hw_rtc_mc146818rtc.c \
    pkgsrc/emulators/qemu7/patches/patch-hw_scsi_scsi-disk.c \
    pkgsrc/emulators/qemu7/patches/patch-hw_usb_dev-mtp.c \
    pkgsrc/emulators/qemu7/patches/patch-meson.build \
    pkgsrc/emulators/qemu7/patches/patch-meson_mesonbuild_linkers_linkers.py \
    pkgsrc/emulators/qemu7/patches/patch-roms_u-boot-sam460ex_Makefile \
    pkgsrc/emulators/qemu7/patches/patch-target_arm_translate-sve.c \
    pkgsrc/emulators/qemu7/patches/patch-target_i386_cpu.c \
    pkgsrc/emulators/qemu7/patches/patch-target_i386_meson.build \
    pkgsrc/emulators/qemu7/patches/patch-target_sparc_translate.c \
    pkgsrc/emulators/qemu7/patches/patch-util_coroutine-ucontext.c \
    pkgsrc/emulators/qemu7/patches/patch-util_osdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/emulators/Makefile
diff -u pkgsrc/emulators/Makefile:1.368 pkgsrc/emulators/Makefile:1.369
--- pkgsrc/emulators/Makefile:1.368     Fri Jan 31 10:48:25 2025
+++ pkgsrc/emulators/Makefile   Sun Mar  2 12:45:45 2025
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.368 2025/01/31 10:48:25 micha Exp $
+# $NetBSD: Makefile,v 1.369 2025/03/02 12:45:45 nia Exp $
 #
 
 COMMENT=       Emulators for other machines and systems
@@ -95,6 +95,7 @@ SUBDIR+=      gpsp-rpi
 SUBDIR+=       gxemul
 SUBDIR+=       handy_sdl
 SUBDIR+=       hatari
+SUBDIR+=       haxm
 SUBDIR+=       hercules
 SUBDIR+=       hercules-images
 SUBDIR+=       hercules4sdl
@@ -185,6 +186,7 @@ SUBDIR+=    picodrive
 SUBDIR+=       py-keystone
 SUBDIR+=       py-unicorn
 SUBDIR+=       qemu
+SUBDIR+=       qemu7
 SUBDIR+=       quasi88
 SUBDIR+=       raine
 SUBDIR+=       realboy

Added files:

Index: pkgsrc/emulators/haxm/DESCR
diff -u /dev/null pkgsrc/emulators/haxm/DESCR:1.3
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/DESCR Sun Mar  2 12:45:47 2025
@@ -0,0 +1,9 @@
+HAXM is a cross-platform hardware-assisted virtualization engine (hypervisor),
+widely used as an accelerator for Android Emulator and QEMU. It has always
+supported running on Windows and macOS, and has been ported to other host
+operating systems as well, such as Linux and NetBSD.
+
+HAXM runs as a kernel-mode driver on the host operating system, and provides a
+KVM-like interface to user space, thereby enabling applications like QEMU to
+utilize the hardware virtualization capabilities built into modern Intel CPUs,
+namely Intel Virtualization Technology.

Index: pkgsrc/emulators/haxm/Makefile
diff -u /dev/null pkgsrc/emulators/haxm/Makefile:1.23
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/Makefile      Sun Mar  2 12:45:47 2025
@@ -0,0 +1,68 @@
+# $NetBSD: Makefile,v 1.23 2025/03/02 12:45:47 nia Exp $
+
+DISTNAME=      haxm-7.8.0
+CATEGORIES=    emulators
+MASTER_SITES=  ${MASTER_SITE_GITHUB:=intel/}
+GITHUB_TAG=    v${PKGVERSION_NOREV}
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://github.com/intel/haxm/
+COMMENT=       Intel Hardware Accelerated Execution Manager
+LICENSE=       modified-bsd
+
+ONLY_FOR_PLATFORM=     NetBSD-*-x86_64
+OSVERSION_SPECIFIC=    YES
+USE_BSD_MAKEFILE=      YES
+
+TOOL_DEPENDS+= nasm-[0-9]*:../../devel/nasm
+
+BUILD_DIRS=    platforms/netbsd
+
+MKPIE_SUPPORTED=       no
+.include "../../mk/bsd.prefs.mk"
+
+BUILDLINK_PASSTHRU_DIRS+=      ${BSDSRCDIR}/sys
+
+MAKE_FLAGS+=   S=${BSDSRCDIR}/sys
+
+BUILD_DEFS+=   BSDSRCDIR
+
+.if !exists(${BSDSRCDIR}/sys)
+PKG_FAIL_REASON+=      "BSDSRCDIR/sys specifies non-existing directory ${BSDSRCDIR}/sys"
+.endif
+
+.include "../../mk/compiler.mk"
+
+MAKE_FLAGS+=   NOCLANGERROR=1
+MAKE_FLAGS+=   NOGCCERROR=1
+
+KMOD=          haxm.kmod
+KMODULEDIR=    stand/${MACHINE}/${OS_VERSION}/modules/haxm
+
+INSTALLATION_DIRS+=    sbin            # auxiliary scripts
+INSTALLATION_DIRS+=    ${KMODULEDIR}
+
+INSTALL_UNSTRIPPED=    yes # Kernel linker needs unstripped module
+
+PLIST_SUBST+=  MACHINE=${MACHINE}
+
+pre-configure:
+.for file in haxm-mknod haxm-modunload
+       ${CP} ${FILESDIR}/${file} ${WRKSRC}
+.endfor
+       ${SED} \
+               -e 's|@PREFIX@|${PREFIX}|g' \
+               -e 's|@MACHINE@|${MACHINE}|g' \
+               -e 's|@OS_VERSION@|${OS_VERSION}|g' \
+               ${FILESDIR}/haxm-modload.in > ${WRKSRC}/haxm-modload
+
+do-install:
+       ${RUN} cd ${WRKSRC}/platforms/netbsd && \
+               ${INSTALL_PROGRAM} ${KMOD} ${DESTDIR}${PREFIX}/${KMODULEDIR}
+.for file in haxm-modload haxm-modunload haxm-mknod
+       ${RUN} cd ${WRKSRC} && \
+               ${INSTALL_SCRIPT} ${file} ${DESTDIR}${PREFIX}/sbin
+.endfor
+
+
+.include "../../mk/bsd.pkg.mk"

Index: pkgsrc/emulators/haxm/PLIST
diff -u /dev/null pkgsrc/emulators/haxm/PLIST:1.4
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/PLIST Sun Mar  2 12:45:47 2025
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.4 2025/03/02 12:45:47 nia Exp $
+sbin/haxm-mknod
+sbin/haxm-modload
+sbin/haxm-modunload
+stand/${MACHINE}/${OS_VERSION}/modules/haxm/haxm.kmod

Index: pkgsrc/emulators/haxm/distinfo
diff -u /dev/null pkgsrc/emulators/haxm/distinfo:1.15
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/distinfo      Sun Mar  2 12:45:47 2025
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.15 2025/03/02 12:45:47 nia Exp $
+
+BLAKE2s (haxm-7.8.0.tar.gz) = e36adb5175a79d9a5038cf8d4dc1deb58205e377689fa2f3f5dbb7fd6e53b624
+SHA512 (haxm-7.8.0.tar.gz) = 403d1e2346885630d2ca58515bca8cc4cb0c8a4a30d22257101272f1dca352256b155dc051e4d665b5ddd3bd9a3692bd6d1a849f35cb9a3b8046a4c7d2c57960
+Size (haxm-7.8.0.tar.gz) = 364804 bytes
+SHA1 (patch-include_netbsd_hax__netbsd.h) = d1210e10e0f425ea7fb08f9aa8485128bc55c64b
+SHA1 (patch-platforms_netbsd_hax__entry.c) = 7ce2042644a11c7aaabf51fec2e582db63053df1

Index: pkgsrc/emulators/haxm/files/haxm-mknod
diff -u /dev/null pkgsrc/emulators/haxm/files/haxm-mknod:1.4
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/files/haxm-mknod      Sun Mar  2 12:45:47 2025
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+if [ -e /dev/HAX ]; then
+       echo "ERR: HAXM devices have been already created"
+       exit 1
+fi
+
+echo "*** Creating HAX devices ***"
+mknod /dev/HAX c 348 0
+mkdir /dev/hax_vm
+for i in `seq 0 7`; do mkdir /dev/hax_vm0$i; done
+for i in `seq 0 7`; do mknod /dev/hax_vm/vm0$i c 349 $i; done
+
+echo "*** Creating VCPU Nodes ***"
+i=0
+while [ $i -lt 128 ]; do
+        vm=$(echo "$i/16"|bc)
+        vcpu=$(echo "$i%16"|bc)
+        echo "i=$i vm=$vm vcpu=$vcpu"
+        cmd=$(printf "mknod /dev/hax_vm%02d/vcpu%02d c 350 %d" $vm $vcpu $i)
+        $cmd
+        let "i+=1"
+done
+
+echo "*** Done ****"
Index: pkgsrc/emulators/haxm/files/haxm-modload.in
diff -u /dev/null pkgsrc/emulators/haxm/files/haxm-modload.in:1.4
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/files/haxm-modload.in Sun Mar  2 12:45:47 2025
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+modload @PREFIX@/stand/@MACHINE@/@OS_VERSION@/modules/haxm/haxm.kmod

Index: pkgsrc/emulators/haxm/files/haxm-modunload
diff -u /dev/null pkgsrc/emulators/haxm/files/haxm-modunload:1.3
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/files/haxm-modunload  Sun Mar  2 12:45:47 2025
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+modunload haxm

Index: pkgsrc/emulators/haxm/patches/patch-include_netbsd_hax__netbsd.h
diff -u /dev/null pkgsrc/emulators/haxm/patches/patch-include_netbsd_hax__netbsd.h:1.3
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/patches/patch-include_netbsd_hax__netbsd.h    Sun Mar  2 12:45:47 2025
@@ -0,0 +1,17 @@
+$NetBSD: patch-include_netbsd_hax__netbsd.h,v 1.3 2025/03/02 12:45:47 nia Exp $
+
+* Upstream master branch resolves this problem in another way.
+  Please remove this in next update (after 7.7.0).
+
+--- include/netbsd/hax_netbsd.h.orig   2021-05-24 08:15:13.000000000 +0000
++++ include/netbsd/hax_netbsd.h
+@@ -34,6 +34,9 @@
+ 
+ #define HAX_RAM_ENTRY_SIZE 0x4000000
+ 
++#define min(a,b)  (((a)<(b))?(a):(b))
++#define max(a,b)  (((a)>(b))?(a):(b))
++
+ hax_spinlock *hax_spinlock_alloc_init(void);
+ void hax_spinlock_free(hax_spinlock *lock);
+ void hax_spin_lock(hax_spinlock *lock);

Index: pkgsrc/emulators/haxm/patches/patch-platforms_netbsd_hax__entry.c
diff -u /dev/null pkgsrc/emulators/haxm/patches/patch-platforms_netbsd_hax__entry.c:1.5
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/haxm/patches/patch-platforms_netbsd_hax__entry.c   Sun Mar  2 12:45:47 2025
@@ -0,0 +1,17 @@
+$NetBSD: patch-platforms_netbsd_hax__entry.c,v 1.5 2025/03/02 12:45:47 nia Exp $
+
+Fix builds on NetBSD >= 9.99.96.
+
+--- platforms/netbsd/hax_entry.c.orig  2021-05-24 08:15:13.000000000 +0000
++++ platforms/netbsd/hax_entry.c
+@@ -32,6 +32,10 @@
+ #include <sys/types.h>
+ #include <sys/conf.h>
+ #include <sys/device.h>
++#if __NetBSD_Version__ >= 999009600
++/* Needs dv_xname from struct device */
++#include <sys/device_impl.h>
++#endif
+ #include <sys/module.h>
+ #include <sys/cpu.h>
+ 

Index: pkgsrc/emulators/qemu7/DESCR
diff -u /dev/null pkgsrc/emulators/qemu7/DESCR:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/DESCR        Sun Mar  2 12:45:45 2025
@@ -0,0 +1,8 @@
+QEMU is an open source machine emulator and virtualizer.
+
+QEMU supports full-system emulation, to run operating systems for any
+machine, on any supported architecture. Virtualization can be
+accelerated to achieve near-native performance. Certain targets
+also support user-mode emulation.
+
+This is stable branch 7.x and retains support for HAXM acceleration.
Index: pkgsrc/emulators/qemu7/Makefile
diff -u /dev/null pkgsrc/emulators/qemu7/Makefile:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/Makefile     Sun Mar  2 12:45:45 2025
@@ -0,0 +1,208 @@
+# $NetBSD: Makefile,v 1.1 2025/03/02 12:45:45 nia Exp $
+
+DISTNAME=      qemu-7.2.16
+CATEGORIES=    emulators
+MASTER_SITES=  https://download.qemu.org/
+EXTRACT_SUFX=  .tar.xz
+
+MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=      https://www.qemu.org/
+COMMENT=       Machine emulator and virtualizer
+LICENSE=       gnu-gpl-v2 AND gnu-lgpl-v2.1 AND mit AND modified-bsd
+
+TOOL_DEPENDS+= ninja-build-[0-9]*:../../devel/ninja-build
+
+USE_CURSES=            resize_term wide
+USE_LANGUAGES+=                c c++
+USE_TOOLS+=            bison flex makeinfo perl:build pod2man pkg-config
+UNLIMIT_RESOURCES=     datasize
+HAS_CONFIGURE=         yes
+
+# https://github.com/qemu/qemu/commit/56208a0d473c6db263cc333c787ca48b502d72ab
+GCC_REQD+=             7
+
+PYTHON_VERSIONS_INCOMPATIBLE=  27
+
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-sphinx-[0-9]*:../../textproc/py-sphinx
+TOOL_DEPENDS+=         ${PYPKGPREFIX}-sphinx-rtd-theme>=0.4.3:../../textproc/py-sphinx-rtd-theme
+CONFIGURE_ARGS+=       --sphinx-build=${PREFIX}/bin/sphinx-build-${PYVERSSUFFIX}
+
+.include "options.mk"
+
+.include "../../mk/bsd.prefs.mk"
+
+# When upgrading Qemu, you need to determine if this PALcode binary for
+# the Alpha emulator needs to be re-built.  If it does not, then you do
+# not need to bump the version of this PALcode binary blob (which is
+# supplied as a separate distfile).  Contact thorpej@ for details.
+PALCODE_CLIPPER=       palcode-clipper-qemu-5.2.0nb8
+
+DISTFILES=             ${DEFAULT_DISTFILES}
+DISTFILES+=            ${PALCODE_CLIPPER}
+SITES.${PALCODE_CLIPPER}= http://ftp.NetBSD.org/pub/NetBSD/arch/alpha/qemu/
+
+CONFIGURE_ARGS+=       --prefix=${PREFIX}
+CONFIGURE_ARGS+=       --interp-prefix=${PREFIX}/share/qemu
+CONFIGURE_ARGS+=       --sysconfdir=${PKG_SYSCONFDIR}
+CONFIGURE_ARGS+=       --python=${PYTHONBIN}
+CONFIGURE_ARGS+=       --smbd=${PREFIX}/sbin/smbd
+CONFIGURE_ARGS+=       --mandir=${PREFIX}/${PKGMANDIR}
+CONFIGURE_ARGS+=       --enable-curses
+CONFIGURE_ARGS+=       --enable-docs
+CONFIGURE_ENV+=                mansuffix=/${PKGMANDIR}
+
+.if ${PKGSRC_USE_SSP:Uno:tl} != "no"
+# do not add flags to everything
+SSP_SUPPORTED=         no
+CONFIGURE_ARGS+=       --enable-stack-protector
+.endif
+
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-aarch64
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-alpha
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-arm
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-cris
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-hppa
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-i386
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-m68k
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-microblaze
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-microblazeel
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-mips
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-mips64
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-mips64el
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-mipsel
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-nios2
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-or1k
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-ppc
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-ppc64
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-riscv32
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-riscv64
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-s390x
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-sh4
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-sh4eb
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-sparc
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-sparc64
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-tricore
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-x86_64
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-xtensa
+NOT_PAX_MPROTECT_SAFE+=        bin/qemu-system-xtensaeb
+
+PKG_SYSCONFSUBDIR=     qemu
+
+INSTALLATION_DIRS=     ${PKGMANDIR}/man1 share/doc/qemu
+
+.include "../../mk/oss.buildlink3.mk"
+
+.if ${OSS_TYPE} != "none"
+SUBST_CLASSES+=                oss
+SUBST_STAGE.oss=       pre-configure
+SUBST_MESSAGE.oss=     Correcting the path to the OSS device.
+SUBST_FILES.oss+=      audio/ossaudio.c
+SUBST_SED.oss+=                -e "s,/dev/dsp,${DEVOSSAUDIO},g"
+.endif
+
+UE_ARCHS+=             aarch64 aarch64_be
+UE_ARCHS+=             alpha arm armeb cris
+UE_ARCHS+=             hexagon hppa
+UE_ARCHS+=             i386
+UE_ARCHS+=             loongarch64
+UE_ARCHS+=             m68k microblaze microblazeel
+UE_ARCHS+=             mips mips64 mips64el mipsel mipsn32 mipsn32el
+UE_ARCHS+=             nios2
+UE_ARCHS+=             or1k ppc ppc64 ppc64le
+UE_ARCHS+=             riscv32 riscv64
+UE_ARCHS+=             s390x sh4 sh4eb sparc sparc32plus sparc64
+UE_ARCHS+=             x86_64 xtensa xtensaeb
+
+.if ${OPSYS} == "NetBSD"
+PLIST.nbd=                     yes
+.  if !exists(/usr/include/machine/trap.h)     \
+       || "1"=="1"     # XXX usermode emulation is broken
+CONFIGURE_ARGS+=               --disable-bsd-user
+.  else
+CONFIGURE_ARGS+=               --enable-bsd-user
+USER_EMUL=                     i386 x86_64
+.  endif
+.elif ${OPSYS:M*BSD} || ${OPSYS} == "DragonFly"
+USER_EMUL=                     i386 x86_64
+PLIST.nbd=                     yes
+.elif ${OPSYS} == "Darwin"
+USER_EMUL=
+CONFIGURE_ARGS+=               --disable-bsd-user
+PLIST.nbd=                     yes
+.elif ${OPSYS} == "Linux"
+USER_EMUL=                     ${UE_ARCHS}
+PLIST.bridge-helper=           yes
+PLIST.ga=                      yes
+PLIST.nbd=                     yes
+PLIST.pr-helper=               yes
+.elif ${MACHINE_PLATFORM:MSunOS-5.11-*}
+PLIST.ga=                      yes
+PLIST.nbd=                     yes
+CONFIGURE_ARGS+=               --disable-coroutine-pool
+.endif
+
+PLIST_VARS+=           plugins
+.if ${OPSYS} != "SunOS"
+PLIST.plugins=         yes
+CONFIGURE_ARGS+=       --enable-plugins
+.else
+CONFIGURE_ARGS+=       --disable-plugins
+.endif
+
+PLIST_VARS+=           ${UE_ARCHS} bridge-helper ga keymap nbd pr-helper
+.for pvar in ${USER_EMUL}
+PLIST.${pvar}=         yes
+.endfor
+
+# different versions of Sphinx generate different static files
+PLIST_SRC=     PLIST ${WRKDIR}/PLIST.STATIC
+
+PRINT_PLIST_AWK+=      /\/_static\// { next; }
+
+TEST_TARGET=           check
+
+PYTHON_FOR_BUILD_ONLY= tool
+
+post-extract:
+       cp ${WRKDIR}/${PALCODE_CLIPPER} ${WRKSRC}/pc-bios/palcode-clipper
+       cp ${FILESDIR}/hw-mips-mipssim_virtio.c ${WRKSRC}/hw/mips/mipssim_virtio.c
+
+do-build:
+       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+               ninja -j ${_MAKE_JOBS_N:U1} -C build
+
+do-install:
+       cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${INSTALL_ENV} \
+               ninja -j ${_MAKE_JOBS_N:U1} -C build install
+
+# Some dependencies aren't correct and this tries to be re-made on install,
+# failing due to configure bugs.
+post-build:
+       ${TOUCH} ${WRKSRC}/config-host.mak
+
+post-install:
+       ${INSTALL_DATA} ${FILESDIR}/Makefile.multinode-NetBSD \
+               ${DESTDIR}${PREFIX}/share/doc/qemu/
+       ${RM} -f ${DESTDIR}${PREFIX}/share/doc/qemu/interop/.buildinfo
+       ${RM} -f ${DESTDIR}${PREFIX}/share/doc/qemu/specs/.buildinfo
+       ${RM} -f ${WRKDIR}/PLIST.STATIC
+       cd ${DESTDIR}${PREFIX} && \
+       ${FIND} share/doc/qemu -path '*/_static/*' -type f -print > ${WRKDIR}/PLIST.STATIC
+
+.include "../../archivers/lzo/buildlink3.mk"
+.include "../../archivers/zstd/buildlink3.mk"
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../devel/snappy/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../graphics/hicolor-icon-theme/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../lang/python/tool.mk"
+.include "../../net/libslirp/buildlink3.mk"
+.include "../../security/libgcrypt/buildlink3.mk"
+.include "../../sysutils/dtc/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../x11/pixman/buildlink3.mk"
+.include "../../mk/curses.buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
Index: pkgsrc/emulators/qemu7/PLIST
diff -u /dev/null pkgsrc/emulators/qemu7/PLIST:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/PLIST        Sun Mar  2 12:45:45 2025
@@ -0,0 +1,439 @@
+@comment $NetBSD: PLIST,v 1.1 2025/03/02 12:45:45 nia Exp $
+bin/elf2dmp
+${PLIST.aarch64}bin/qemu-aarch64
+${PLIST.aarch64_be}bin/qemu-aarch64_be
+${PLIST.alpha}bin/qemu-alpha
+${PLIST.arm}bin/qemu-arm
+${PLIST.armeb}bin/qemu-armeb
+${PLIST.cris}bin/qemu-cris
+bin/qemu-edid
+${PLIST.ga}bin/qemu-ga
+${PLIST.hexagon}bin/qemu-hexagon
+${PLIST.hppa}bin/qemu-hppa
+${PLIST.i386}bin/qemu-i386
+bin/qemu-img
+bin/qemu-io
+${PLIST.keymap}bin/qemu-keymap
+${PLIST.loongarch64}bin/qemu-loongarch64
+${PLIST.m68k}bin/qemu-m68k
+${PLIST.microblaze}bin/qemu-microblaze
+${PLIST.microblazeel}bin/qemu-microblazeel
+${PLIST.mips}bin/qemu-mips
+${PLIST.mips64}bin/qemu-mips64
+${PLIST.mips64el}bin/qemu-mips64el
+${PLIST.mipsel}bin/qemu-mipsel
+${PLIST.mipsn32}bin/qemu-mipsn32
+${PLIST.mipsn32el}bin/qemu-mipsn32el
+${PLIST.nbd}bin/qemu-nbd
+${PLIST.nios2}bin/qemu-nios2
+${PLIST.or1k}bin/qemu-or1k
+${PLIST.ppc}bin/qemu-ppc
+${PLIST.ppc64}bin/qemu-ppc64
+${PLIST.ppc64le}bin/qemu-ppc64le
+${PLIST.pr-helper}bin/qemu-pr-helper
+${PLIST.riscv32}bin/qemu-riscv32
+${PLIST.riscv64}bin/qemu-riscv64
+${PLIST.s390x}bin/qemu-s390x
+${PLIST.sh4}bin/qemu-sh4
+${PLIST.sh4eb}bin/qemu-sh4eb
+${PLIST.sparc}bin/qemu-sparc
+${PLIST.sparc32plus}bin/qemu-sparc32plus
+${PLIST.sparc64}bin/qemu-sparc64
+bin/qemu-storage-daemon
+bin/qemu-system-aarch64
+bin/qemu-system-alpha
+bin/qemu-system-arm
+bin/qemu-system-avr
+bin/qemu-system-cris
+bin/qemu-system-hppa
+bin/qemu-system-i386
+bin/qemu-system-loongarch64
+bin/qemu-system-m68k
+bin/qemu-system-microblaze
+bin/qemu-system-microblazeel
+bin/qemu-system-mips
+bin/qemu-system-mips64
+bin/qemu-system-mips64el
+bin/qemu-system-mipsel
+bin/qemu-system-nios2
+bin/qemu-system-or1k
+bin/qemu-system-ppc
+bin/qemu-system-ppc64
+bin/qemu-system-riscv32
+bin/qemu-system-riscv64
+bin/qemu-system-rx
+bin/qemu-system-s390x
+bin/qemu-system-sh4
+bin/qemu-system-sh4eb
+bin/qemu-system-sparc
+bin/qemu-system-sparc64
+bin/qemu-system-tricore
+bin/qemu-system-x86_64
+bin/qemu-system-xtensa
+bin/qemu-system-xtensaeb
+${PLIST.x86_64}bin/qemu-x86_64
+${PLIST.xtensa}bin/qemu-xtensa
+${PLIST.xtensaeb}bin/qemu-xtensaeb
+${PLIST.plugins}include/qemu-plugin.h
+${PLIST.bridge-helper}libexec/qemu-bridge-helper
+${PLIST.virtfs-proxy-helper}libexec/virtfs-proxy-helper
+man/man1/qemu-img.1
+man/man1/qemu-storage-daemon.1
+man/man1/qemu.1
+${PLIST.virtfs-proxy-helper}man/man1/virtfs-proxy-helper.1
+man/man7/qemu-block-drivers.7
+man/man7/qemu-cpu-models.7
+${PLIST.ga}man/man7/qemu-ga-ref.7
+man/man7/qemu-qmp-ref.7
+man/man7/qemu-storage-daemon-qmp-ref.7
+${PLIST.ga}man/man8/qemu-ga.8
+man/man8/qemu-nbd.8
+man/man8/qemu-pr-helper.8
+share/applications/qemu.desktop
+share/doc/qemu/.buildinfo
+share/doc/qemu/Makefile.multinode-NetBSD
+share/doc/qemu/about/build-platforms.html
+share/doc/qemu/about/deprecated.html
+share/doc/qemu/about/index.html
+share/doc/qemu/about/license.html
+share/doc/qemu/about/removed-features.html
+share/doc/qemu/dbus-dbusindex.html
+share/doc/qemu/devel/acpi-bits.html
+share/doc/qemu/devel/atomics.html
+share/doc/qemu/devel/bitops.html
+share/doc/qemu/devel/block-coroutine-wrapper.html
+share/doc/qemu/devel/build-system.html
+share/doc/qemu/devel/ci.html
+share/doc/qemu/devel/clocks.html
+share/doc/qemu/devel/code-of-conduct.html
+share/doc/qemu/devel/conflict-resolution.html
+share/doc/qemu/devel/control-flow-integrity.html
+share/doc/qemu/devel/decodetree.html
+share/doc/qemu/devel/ebpf_rss.html
+share/doc/qemu/devel/fuzzing.html
+share/doc/qemu/devel/index-api.html
+share/doc/qemu/devel/index-build.html
+share/doc/qemu/devel/index-internals.html
+share/doc/qemu/devel/index-process.html
+share/doc/qemu/devel/index-tcg.html
+share/doc/qemu/devel/index.html
+share/doc/qemu/devel/kconfig.html
+share/doc/qemu/devel/loads-stores.html
+share/doc/qemu/devel/maintainers.html
+share/doc/qemu/devel/memory.html
+share/doc/qemu/devel/migration.html
+share/doc/qemu/devel/modules.html
+share/doc/qemu/devel/multi-process.html
+share/doc/qemu/devel/multi-thread-tcg.html
+share/doc/qemu/devel/qapi-code-gen.html
+share/doc/qemu/devel/qgraph.html
+share/doc/qemu/devel/qom.html
+share/doc/qemu/devel/qtest.html
+share/doc/qemu/devel/replay.html
+share/doc/qemu/devel/reset.html
+share/doc/qemu/devel/s390-dasd-ipl.html
+share/doc/qemu/devel/secure-coding-practices.html
+share/doc/qemu/devel/stable-process.html
+share/doc/qemu/devel/style.html
+share/doc/qemu/devel/submitting-a-patch.html
+share/doc/qemu/devel/submitting-a-pull-request.html
+share/doc/qemu/devel/tcg-icount.html
+share/doc/qemu/devel/tcg-plugins.html
+share/doc/qemu/devel/tcg.html
+share/doc/qemu/devel/testing.html
+share/doc/qemu/devel/tracing.html
+share/doc/qemu/devel/trivial-patches.html
+share/doc/qemu/devel/ui.html
+share/doc/qemu/devel/vfio-migration.html
+share/doc/qemu/devel/virtio-backends.html
+share/doc/qemu/devel/writing-monitor-commands.html
+share/doc/qemu/genindex.html
+share/doc/qemu/index.html
+share/doc/qemu/interop/barrier.html
+share/doc/qemu/interop/bitmaps.html
+share/doc/qemu/interop/dbus-display.html
+share/doc/qemu/interop/dbus-vmstate.html
+share/doc/qemu/interop/dbus.html
+share/doc/qemu/interop/index.html
+share/doc/qemu/interop/live-block-operations.html
+share/doc/qemu/interop/pr-helper.html
+share/doc/qemu/interop/qemu-ga-ref.html
+share/doc/qemu/interop/qemu-ga.html
+share/doc/qemu/interop/qemu-qmp-ref.html
+share/doc/qemu/interop/qemu-storage-daemon-qmp-ref.html
+share/doc/qemu/interop/vhost-user-gpu.html
+share/doc/qemu/interop/vhost-user.html
+share/doc/qemu/interop/vhost-vdpa.html
+share/doc/qemu/interop/virtio-balloon-stats.html
+share/doc/qemu/objects.inv
+share/doc/qemu/search.html
+share/doc/qemu/searchindex.js
+share/doc/qemu/specs/acpi_cpu_hotplug.html
+share/doc/qemu/specs/acpi_erst.html
+share/doc/qemu/specs/acpi_hest_ghes.html
+share/doc/qemu/specs/acpi_hw_reduced_hotplug.html
+share/doc/qemu/specs/acpi_mem_hotplug.html
+share/doc/qemu/specs/acpi_nvdimm.html
+share/doc/qemu/specs/acpi_pci_hotplug.html
+share/doc/qemu/specs/fw_cfg.html
+share/doc/qemu/specs/index.html
+share/doc/qemu/specs/ppc-spapr-hcalls.html
+share/doc/qemu/specs/ppc-spapr-hotplug.html
+share/doc/qemu/specs/ppc-spapr-numa.html
+share/doc/qemu/specs/ppc-spapr-uv-hcalls.html
+share/doc/qemu/specs/ppc-spapr-xive.html
+share/doc/qemu/specs/ppc-xive.html
+share/doc/qemu/specs/sev-guest-firmware.html
+share/doc/qemu/specs/tpm.html
+share/doc/qemu/system/arm/aspeed.html
+share/doc/qemu/system/arm/collie.html
+share/doc/qemu/system/arm/cpu-features.html
+share/doc/qemu/system/arm/cubieboard.html
+share/doc/qemu/system/arm/digic.html
+share/doc/qemu/system/arm/emcraft-sf2.html
+share/doc/qemu/system/arm/emulation.html
+share/doc/qemu/system/arm/gumstix.html
+share/doc/qemu/system/arm/highbank.html
+share/doc/qemu/system/arm/imx25-pdk.html
+share/doc/qemu/system/arm/integratorcp.html
+share/doc/qemu/system/arm/kzm.html
+share/doc/qemu/system/arm/mainstone.html
+share/doc/qemu/system/arm/mps2.html
+share/doc/qemu/system/arm/musca.html
+share/doc/qemu/system/arm/musicpal.html
+share/doc/qemu/system/arm/nrf.html
+share/doc/qemu/system/arm/nseries.html
+share/doc/qemu/system/arm/nuvoton.html
+share/doc/qemu/system/arm/orangepi.html
+share/doc/qemu/system/arm/palm.html
+share/doc/qemu/system/arm/raspi.html
+share/doc/qemu/system/arm/realview.html
+share/doc/qemu/system/arm/sabrelite.html
+share/doc/qemu/system/arm/sbsa.html
+share/doc/qemu/system/arm/stellaris.html
+share/doc/qemu/system/arm/stm32.html
+share/doc/qemu/system/arm/sx1.html
+share/doc/qemu/system/arm/versatile.html
+share/doc/qemu/system/arm/vexpress.html
+share/doc/qemu/system/arm/virt.html
+share/doc/qemu/system/arm/xlnx-versal-virt.html
+share/doc/qemu/system/arm/xscale.html
+share/doc/qemu/system/authz.html
+share/doc/qemu/system/barrier.html
+share/doc/qemu/system/bootindex.html
+share/doc/qemu/system/confidential-guest-support.html
+share/doc/qemu/system/cpu-hotplug.html
+share/doc/qemu/system/device-emulation.html
+share/doc/qemu/system/devices/can.html
+share/doc/qemu/system/devices/canokey.html
+share/doc/qemu/system/devices/ccid.html
+share/doc/qemu/system/devices/cxl.html
+share/doc/qemu/system/devices/ivshmem.html
+share/doc/qemu/system/devices/net.html
+share/doc/qemu/system/devices/nvme.html
+share/doc/qemu/system/devices/usb.html
+share/doc/qemu/system/devices/vhost-user-rng.html
+share/doc/qemu/system/devices/vhost-user.html
+share/doc/qemu/system/devices/virtio-pmem.html
+share/doc/qemu/system/gdb.html
+share/doc/qemu/system/generic-loader.html
+share/doc/qemu/system/guest-loader.html
+share/doc/qemu/system/i386/amd-memory-encryption.html
+share/doc/qemu/system/i386/cpu.html
+share/doc/qemu/system/i386/hyperv.html
+share/doc/qemu/system/i386/kvm-pv.html
+share/doc/qemu/system/i386/microvm.html
+share/doc/qemu/system/i386/pc.html
+share/doc/qemu/system/i386/sgx.html
+share/doc/qemu/system/images.html
+share/doc/qemu/system/index.html
+share/doc/qemu/system/invocation.html
+share/doc/qemu/system/keys.html
+share/doc/qemu/system/linuxboot.html
+share/doc/qemu/system/loongarch/loongson3.html
+share/doc/qemu/system/managed-startup.html
+share/doc/qemu/system/monitor.html
+share/doc/qemu/system/multi-process.html
+share/doc/qemu/system/mux-chardev.html
+share/doc/qemu/system/openrisc/cpu-features.html
+share/doc/qemu/system/openrisc/emulation.html
+share/doc/qemu/system/openrisc/or1k-sim.html
+share/doc/qemu/system/openrisc/virt.html
+share/doc/qemu/system/ppc/embedded.html
+share/doc/qemu/system/ppc/powermac.html
+share/doc/qemu/system/ppc/powernv.html
+share/doc/qemu/system/ppc/ppce500.html
+share/doc/qemu/system/ppc/prep.html
+share/doc/qemu/system/ppc/pseries.html
+share/doc/qemu/system/pr-manager.html
+share/doc/qemu/system/qemu-block-drivers.html
+share/doc/qemu/system/qemu-cpu-models.html
+share/doc/qemu/system/qemu-manpage.html
+share/doc/qemu/system/quickstart.html
+share/doc/qemu/system/replay.html
+share/doc/qemu/system/riscv/microchip-icicle-kit.html
+share/doc/qemu/system/riscv/shakti-c.html
+share/doc/qemu/system/riscv/sifive_u.html
+share/doc/qemu/system/riscv/virt.html
+share/doc/qemu/system/s390x/3270.html
+share/doc/qemu/system/s390x/bootdevices.html
+share/doc/qemu/system/s390x/css.html
+share/doc/qemu/system/s390x/protvirt.html
+share/doc/qemu/system/s390x/vfio-ap.html
+share/doc/qemu/system/s390x/vfio-ccw.html
+share/doc/qemu/system/secrets.html
+share/doc/qemu/system/security.html
+share/doc/qemu/system/target-arm.html
+share/doc/qemu/system/target-avr.html
+share/doc/qemu/system/target-i386.html
+share/doc/qemu/system/target-m68k.html
+share/doc/qemu/system/target-mips.html
+share/doc/qemu/system/target-openrisc.html
+share/doc/qemu/system/target-ppc.html
+share/doc/qemu/system/target-riscv.html
+share/doc/qemu/system/target-rx.html
+share/doc/qemu/system/target-s390x.html
+share/doc/qemu/system/target-sparc.html
+share/doc/qemu/system/target-sparc64.html
+share/doc/qemu/system/target-xtensa.html
+share/doc/qemu/system/targets.html
+share/doc/qemu/system/tls.html
+share/doc/qemu/system/virtio-net-failover.html
+share/doc/qemu/system/vnc-security.html
+share/doc/qemu/tools/index.html
+share/doc/qemu/tools/qemu-img.html
+share/doc/qemu/tools/qemu-nbd.html
+share/doc/qemu/tools/qemu-pr-helper.html
+share/doc/qemu/tools/qemu-storage-daemon.html
+share/doc/qemu/tools/qemu-trace-stap.html
+share/doc/qemu/tools/virtfs-proxy-helper.html
+share/doc/qemu/tools/virtiofsd.html
+share/doc/qemu/user/index.html
+share/doc/qemu/user/main.html
+share/icons/hicolor/128x128/apps/qemu.png
+share/icons/hicolor/16x16/apps/qemu.png
+share/icons/hicolor/24x24/apps/qemu.png
+share/icons/hicolor/256x256/apps/qemu.png
+share/icons/hicolor/32x32/apps/qemu.bmp
+share/icons/hicolor/32x32/apps/qemu.png
+share/icons/hicolor/48x48/apps/qemu.png
+share/icons/hicolor/512x512/apps/qemu.png
+share/icons/hicolor/64x64/apps/qemu.png
+share/icons/hicolor/scalable/apps/qemu.svg
+${PLIST.gtk}share/locale/bg/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/de_DE/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/fr_FR/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/hu/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/it/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/sv/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/tr/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/uk/LC_MESSAGES/qemu.mo
+${PLIST.gtk}share/locale/zh_CN/LC_MESSAGES/qemu.mo
+share/qemu/QEMU,cgthree.bin
+share/qemu/QEMU,tcx.bin
+share/qemu/bamboo.dtb
+share/qemu/bios-256k.bin
+share/qemu/bios-microvm.bin
+share/qemu/bios.bin
+share/qemu/canyonlands.dtb
+share/qemu/edk2-aarch64-code.fd
+share/qemu/edk2-arm-code.fd
+share/qemu/edk2-arm-vars.fd
+share/qemu/edk2-i386-code.fd
+share/qemu/edk2-i386-secure-code.fd
+share/qemu/edk2-i386-vars.fd
+share/qemu/edk2-licenses.txt
+share/qemu/edk2-x86_64-code.fd
+share/qemu/edk2-x86_64-secure-code.fd
+share/qemu/efi-e1000.rom
+share/qemu/efi-e1000e.rom
+share/qemu/efi-eepro100.rom
+share/qemu/efi-ne2k_pci.rom
+share/qemu/efi-pcnet.rom
+share/qemu/efi-rtl8139.rom
+share/qemu/efi-virtio.rom
+share/qemu/efi-vmxnet3.rom
+share/qemu/firmware/50-edk2-i386-secure.json
+share/qemu/firmware/50-edk2-x86_64-secure.json
+share/qemu/firmware/60-edk2-aarch64.json
+share/qemu/firmware/60-edk2-arm.json
+share/qemu/firmware/60-edk2-i386.json
+share/qemu/firmware/60-edk2-x86_64.json
+share/qemu/hppa-firmware.img
+share/qemu/keymaps/ar
+share/qemu/keymaps/bepo
+share/qemu/keymaps/cz
+share/qemu/keymaps/da
+share/qemu/keymaps/de
+share/qemu/keymaps/de-ch
+share/qemu/keymaps/en-gb
+share/qemu/keymaps/en-us
+share/qemu/keymaps/es
+share/qemu/keymaps/et
+share/qemu/keymaps/fi
+share/qemu/keymaps/fo
+share/qemu/keymaps/fr
+share/qemu/keymaps/fr-be
+share/qemu/keymaps/fr-ca
+share/qemu/keymaps/fr-ch
+share/qemu/keymaps/hr
+share/qemu/keymaps/hu
+share/qemu/keymaps/is
+share/qemu/keymaps/it
+share/qemu/keymaps/ja
+share/qemu/keymaps/lt
+share/qemu/keymaps/lv
+share/qemu/keymaps/mk
+share/qemu/keymaps/nl
+share/qemu/keymaps/no
+share/qemu/keymaps/pl
+share/qemu/keymaps/pt
+share/qemu/keymaps/pt-br
+share/qemu/keymaps/ru
+share/qemu/keymaps/sl
+share/qemu/keymaps/sv
+share/qemu/keymaps/th
+share/qemu/keymaps/tr
+share/qemu/kvmvapic.bin
+share/qemu/linuxboot.bin
+share/qemu/linuxboot_dma.bin
+share/qemu/multiboot.bin
+share/qemu/multiboot_dma.bin
+share/qemu/npcm7xx_bootrom.bin
+share/qemu/openbios-ppc
+share/qemu/openbios-sparc32
+share/qemu/openbios-sparc64
+share/qemu/opensbi-riscv32-generic-fw_dynamic.bin
+share/qemu/opensbi-riscv64-generic-fw_dynamic.bin
+share/qemu/palcode-clipper
+share/qemu/petalogix-ml605.dtb
+share/qemu/petalogix-s3adsp1800.dtb
+share/qemu/pvh.bin
+share/qemu/pxe-e1000.rom
+share/qemu/pxe-eepro100.rom
+share/qemu/pxe-ne2k_pci.rom
+share/qemu/pxe-pcnet.rom
+share/qemu/pxe-rtl8139.rom
+share/qemu/pxe-virtio.rom
+share/qemu/qboot.rom
+share/qemu/qemu-nsis.bmp
+share/qemu/qemu_vga.ndrv
+share/qemu/s390-ccw.img
+share/qemu/s390-netboot.img
+share/qemu/sgabios.bin
+share/qemu/skiboot.lid
+share/qemu/slof.bin
+share/qemu/trace-events-all
+share/qemu/u-boot-sam460-20100605.bin
+share/qemu/u-boot.e500
+share/qemu/vgabios-ati.bin
+share/qemu/vgabios-bochs-display.bin
+share/qemu/vgabios-cirrus.bin
+share/qemu/vgabios-qxl.bin
+share/qemu/vgabios-ramfb.bin
+share/qemu/vgabios-stdvga.bin
+share/qemu/vgabios-virtio.bin
+share/qemu/vgabios-vmware.bin
+share/qemu/vgabios.bin
+share/qemu/vof-nvram.bin
+share/qemu/vof.bin
Index: pkgsrc/emulators/qemu7/distinfo
diff -u /dev/null pkgsrc/emulators/qemu7/distinfo:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/distinfo     Sun Mar  2 12:45:45 2025
@@ -0,0 +1,28 @@
+$NetBSD: distinfo,v 1.1 2025/03/02 12:45:45 nia Exp $
+
+BLAKE2s (palcode-clipper-qemu-5.2.0nb8) = d388c896a80c1cc3d4785c8434d6688bbcfd54c28f7252ce550ab162a0bba321
+SHA512 (palcode-clipper-qemu-5.2.0nb8) = 33695d6001d86a19793a92d5e31775607c4dfc9ab9eea019ea6c4d543a2e11e8c07f83cca4934811a13ef829b528737ea37d9d2aaf66cba6f2746d44d2aa0b43
+Size (palcode-clipper-qemu-5.2.0nb8) = 159808 bytes
+BLAKE2s (qemu-7.2.16.tar.xz) = a7df9c5ce513308e0f69290b72531df01c29b6cea809e83cb6e5f6ebed29168d
+SHA512 (qemu-7.2.16.tar.xz) = 75623733f39396222e549498fd5dbbc1430593033f7480aa3a34c7e1c765eb5f7776d8827ee47b4b9c52cc1061232637742a8e31c5e5a9019945171d0c65ca7e
+Size (qemu-7.2.16.tar.xz) = 124427328 bytes
+SHA1 (patch-audio_jackaudio.c) = 771c2779e565242a500adc0223ef6b1ae5b2b91f
+SHA1 (patch-backends_tpm_tpm__ioctl.h) = 5e18e0c9d0581386e0100a566694b3e631618585
+SHA1 (patch-hw-mips-Kconfig) = 1e40f8265196e60d4f97ec50073025a3906ef754
+SHA1 (patch-hw-mips-mipssim.c) = 17696dacab62cb5ac4cd949a11ce120f5e1a3906
+SHA1 (patch-hw_display_omap__dss.c) = 68f6f5e86335114de64b397959a2238de84fcde2
+SHA1 (patch-hw_mips_meson.build) = a19ba2014e090dacda13f2eb1dd986b5134de710
+SHA1 (patch-hw_net_etraxfs__eth.c) = e5dd1661d60dbcd27b332403e0843500ba9544bc
+SHA1 (patch-hw_net_xilinx__axienet.c) = ebcd2676d64ce6f31e4a8c976d4fdf530ad5e8b7
+SHA1 (patch-hw_rtc_mc146818rtc.c) = cc7a3b28010966b65b7a16db756226ac2669f310
+SHA1 (patch-hw_scsi_scsi-disk.c) = fdbf2f962a6dcb1a115a7f8a5b8790ff9295fb33
+SHA1 (patch-hw_usb_dev-mtp.c) = f148a3ad6d72eb29f85684316af5fb219ddaeb71
+SHA1 (patch-meson.build) = 67fcc428b1953a63e4c0aa32ac1d41ec234a2462
+SHA1 (patch-meson_mesonbuild_linkers_linkers.py) = 842b01f543c99c66630df8450f71ab9fc422ff32
+SHA1 (patch-roms_u-boot-sam460ex_Makefile) = 3a1bbf19b1422c10ebdd819eb0b711fafc78e2f2
+SHA1 (patch-target_arm_translate-sve.c) = f5909d20ea6f04bbc4a0d61d79f795bac24d6d86
+SHA1 (patch-target_i386_cpu.c) = afa8a2f83399b2d142709322eb88d1112f1547e4
+SHA1 (patch-target_i386_meson.build) = 0ef0636dd68e5eeb9a2a34473e2a24bf3c141c0f
+SHA1 (patch-target_sparc_translate.c) = 7ec2add2fd808facb48b9a66ccc345599251bf76
+SHA1 (patch-util_coroutine-ucontext.c) = 890767e1f034b34f4aad6c791745fc0b151b8e3c
+SHA1 (patch-util_osdep.c) = 1e5bcde7be23792f487334d35797869bff686d25
Index: pkgsrc/emulators/qemu7/options.mk
diff -u /dev/null pkgsrc/emulators/qemu7/options.mk:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/options.mk   Sun Mar  2 12:45:45 2025
@@ -0,0 +1,115 @@
+# $NetBSD: options.mk,v 1.1 2025/03/02 12:45:45 nia Exp $
+
+PKG_OPTIONS_VAR=       PKG_OPTIONS.qemu
+PKG_SUPPORTED_OPTIONS= debug-info gtk3 iscsi jack sdl
+PKG_SUPPORTED_OPTIONS+=        jemalloc
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if ${OPSYS} == "Linux" || ${OPSYS} == "NetBSD" || \
+    ${OPSYS} == "SunOS"
+PKG_SUPPORTED_OPTIONS+=        iscsi spice
+PKG_SUGGESTED_OPTIONS+=        iscsi spice
+.endif
+
+.if ${OPSYS} == "Linux"
+PKG_SUPPORTED_OPTIONS+=        virtfs-proxy-helper
+.endif
+
+.if ${OPSYS} != "Darwin"
+# NetBSD<9.0 does not have EGL support in native X11,
+# so the QEMU OpenGL display driver cannot build.
+.  include "../../graphics/MesaLib/features.mk"
+.  if !empty(MESALIB_SUPPORTS_EGL:M[Yy][Ee][Ss])
+PKG_SUPPORTED_OPTIONS+=        opengl
+PKG_SUGGESTED_OPTIONS+=        opengl sdl
+.  else
+PKG_SUGGESTED_OPTIONS+=        sdl
+.  endif
+.endif
+
+.if ${OPSYS} != "SunOS"
+PKG_SUGGESTED_OPTIONS+=        jemalloc
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+PLIST_VARS+=           gtk keymap virtfs-proxy-helper
+
+.if !empty(PKG_OPTIONS:Mjack)
+CONFIGURE_ARGS+=       --enable-jack
+.include "../../audio/jack/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --disable-jack
+.endif
+
+.if !empty(PKG_OPTIONS:Mdebug-info)
+CONFIGURE_ARGS+=       --enable-debug-info
+.else
+CONFIGURE_ARGS+=       --disable-debug-info
+.endif
+
+.if !empty(PKG_OPTIONS:Mgtk3)
+PLIST.gtk=             yes
+CONFIGURE_ARGS+=       --enable-gtk
+.include "../../x11/gtk3/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --disable-gtk
+.endif
+
+.if !empty(PKG_OPTIONS:Mopengl)
+CONFIGURE_ARGS+=       --enable-opengl
+.include "../../graphics/MesaLib/buildlink3.mk"
+.include "../../graphics/libepoxy/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --disable-opengl
+.endif
+
+.if !empty(PKG_OPTIONS:Msdl)
+CONFIGURE_ARGS+=       --enable-sdl
+.include "../../devel/SDL2/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --disable-sdl
+.endif
+
+# On Darwin, qemu uses Cocoa
+.if ${OPSYS} != "Darwin"
+.  if !empty(PKG_OPTIONS:Mgtk3) || \
+    !empty(PKG_OPTIONS:Mopengl) || !empty(PKG_OPTIONS:Msdl)
+PLIST.keymap=          yes
+.include "../../x11/libxkbcommon/buildlink3.mk"
+.  else
+CONFIGURE_ARGS+=       --disable-xkbcommon
+.  endif
+.endif
+
+# NB to successfully build virtfs-proxy-helper, the upstream Linux
+# header/development libraries for libcap and libattr must be installed.
+.if ${OPSYS} == "Linux" && !empty(PKG_OPTIONS:Mvirtfs-proxy-helper)
+PLIST.virtfs-proxy-helper=     yes
+CONFIGURE_ARGS+=               --enable-virtfs
+.elif ${OPSYS} == "Darwin"
+CONFIGURE_ARGS+=               --enable-virtfs
+.else
+CONFIGURE_ARGS+=               --disable-virtfs
+.endif
+
+.if !empty(PKG_OPTIONS:Mspice)
+CONFIGURE_ARGS+=       --enable-spice
+.include "../../sysutils/spice-protocol/buildlink3.mk"
+.include "../../sysutils/spice-server/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --disable-spice
+.endif
+
+.if !empty(PKG_OPTIONS:Miscsi)
+CONFIGURE_ARGS+=       --enable-libiscsi
+.include "../../net/libiscsi/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=       --disable-libiscsi
+.endif
+
+.if !empty(PKG_OPTIONS:Mjemalloc)
+CONFIGURE_ARGS+=       --enable-jemalloc
+.include "../../devel/jemalloc/buildlink3.mk"
+.endif

Index: pkgsrc/emulators/qemu7/files/Makefile.multinode-NetBSD
diff -u /dev/null pkgsrc/emulators/qemu7/files/Makefile.multinode-NetBSD:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/files/Makefile.multinode-NetBSD      Sun Mar  2 12:45:46 2025
@@ -0,0 +1,59 @@
+# $Id: Makefile.multinode-NetBSD,v 1.1 2025/03/02 12:45:46 nia Exp $
+# Source: http://mail-index.NetBSD.org/netbsd-help/2005/03/25/0005.html
+#
+# Starts up two qemu instances and networks bridges them to the local
+# ethernet (ETHER_IF}.  Works best with NetBSD configured to use serial
+# consoles in DISK[12]
+#
+# Usage:
+#      sudo make netbsd1
+#      sudo make netbsd2
+#
+#  - Hubert Feyrer <hubert%feyrer.de@localhost>
+#
+
+#NETBSD_NOGFX=
+NETBSD_NOGFX=          -nographic
+
+ETHER_IF=      tlp0
+QEMU_RAM=      20
+DISK1=         harddisk.netbsd1
+DISK2=         harddisk.netbsd2
+
+
+all: netbsd1 netbsd2
+
+netbsd1: bridge 
+       ifconfig tap1 create up      || echo tap1: already there
+       brconfig bridge0 add tap1 up || echo tap1: already on bridge0
+       brconfig bridge0 -learn tap1 # real hub mode, step 1b
+       brconfig bridge0 flush  # real hub more, step 2
+       qemu \  
+               -m ${QEMU_RAM} \
+               ${NETBSD_NOGFX} \
+               -boot c \
+               -net tap,fd=3,ifname=tap1 3<>/dev/tap1 \
+               -net nic,macaddr=de:ad:be:ef:00:01 \
+               ${DISK1}
+       brconfig bridge0 delete tap1 
+       ifconfig tap1 destroy
+
+netbsd2: bridge
+       ifconfig tap2 create up      || echo tap2: already there
+       brconfig bridge0 add tap2 up || echo tap2: already on bridge0
+       brconfig bridge0 -learn tap2 # real hub mode, step 1c
+       brconfig bridge0 flush       # real hub mode, step 2
+       qemu \
+               -m ${QEMU_RAM} \
+               ${NETBSD_NOGFX} \
+               -boot c \
+               -net tap,fd=3,ifname=tap2 3<>/dev/tap2 \
+               -net nic,macaddr=de:ad:be:ef:00:02 \
+               ${DISK2}
+       brconfig bridge0 delete tap2
+       ifconfig tap2 destroy
+       
+bridge:
+       ifconfig bridge0 create   || echo bridge0: already there
+       brconfig bridge0 add ${ETHER_IF} || echo bridge0: ${ETHER_IF} already there
+       brconfig bridge0 -learn ${ETHER_IF} # real hub mode, step 1a
Index: pkgsrc/emulators/qemu7/files/hw-mips-mipssim_virtio.c
diff -u /dev/null pkgsrc/emulators/qemu7/files/hw-mips-mipssim_virtio.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/files/hw-mips-mipssim_virtio.c       Sun Mar  2 12:45:46 2025
@@ -0,0 +1,114 @@
+/*
+ * QEMU/mipssim-virtio extension emulation
+ *
+ * Emulates a very simple machine model similar to the one used by the
+ * proprietary MIPS emulator extended by a virtio device. The purpose is to
+ * have a better virt platform in anticipation to a readl `virt' platform for
+ * MIPS.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Reinoud Zandijk.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "qemu/osdep.h"
+#include "qapi/error.h"
+#include "cpu.h"
+#include "hw/mips/mips.h"
+#include "hw/mips/cpudevs.h"
+#include "hw/char/serial.h"
+#include "hw/isa/isa.h"
+#include "net/net.h"
+#include "sysemu/sysemu.h"
+#include "hw/boards.h"
+#include "hw/mips/bios.h"
+#include "hw/loader.h"
+#include "hw/or-irq.h"
+#include "elf.h"
+#include "hw/sysbus.h"
+#include "hw/qdev-properties.h"
+#include "exec/address-spaces.h"
+#include "qemu/error-report.h"
+#include "sysemu/qtest.h"
+#include "sysemu/reset.h"
+#include "hw/virtio/virtio-mmio.h"
+
+#define NUM_VIRTIO_TRANSPORTS   32
+#define VIRTIO_STRIDE           512
+
+#define DEV_SPACING             0x10000                /* space devices every 64k */
+#define ISA_BASE                0x1fd00000
+#define        VIRTIO_MMIO_BASE        (ISA_BASE + DEV_SPACING)
+
+extern void mips_mipssim_init(MachineState *machine);
+
+static void
+mips_mipssim_virtio_init(MachineState *machine)
+{
+    DeviceState *virtio_orgate;
+    MIPSCPU *cpu;
+    CPUMIPSState *env;
+
+    /* initialise parent */
+    mips_mipssim_init(machine);
+
+    cpu = MIPS_CPU(qemu_get_cpu(0));
+    env = &cpu->env;
+
+    /*
+     * TODO: in newer versions, we might need to adjust the cpu clock when its
+     * set in mips_mipssim_init()
+     */
+
+    /*
+     * virtio extention; register 32 virtio devices just after the ISA space
+     * at 0x1fd10000 with stride of 512 bytes as per i386s microvm target.
+     * register these devices in reverse order (see comments in hw/arm/virt.c)
+     */
+    virtio_orgate = DEVICE(object_new(TYPE_OR_IRQ));
+    object_property_set_int(OBJECT(virtio_orgate),
+         "num-lines", NUM_VIRTIO_TRANSPORTS, &error_fatal);
+    qdev_realize_and_unref(virtio_orgate, NULL, &error_fatal);
+
+    for (int i = NUM_VIRTIO_TRANSPORTS - 1; i >= 0; i--) {
+        sysbus_create_simple("virtio-mmio",
+            VIRTIO_MMIO_BASE + i * VIRTIO_STRIDE,
+            qdev_get_gpio_in(virtio_orgate, i));
+    }
+    qdev_connect_gpio_out(DEVICE(virtio_orgate), 0, env->irq[3]);
+}
+
+static void mips_mipssim_virtio_machine_init(MachineClass *mc)
+{
+    mc->desc = "MIPS MIPSsim platform with virtio";
+    mc->init = mips_mipssim_virtio_init;
+#ifdef TARGET_MIPS64
+    mc->default_cpu_type = MIPS_CPU_TYPE_NAME("5Kf");
+#else
+    mc->default_cpu_type = MIPS_CPU_TYPE_NAME("24Kf");
+#endif
+    mc->default_ram_id = "mips_mipssim.ram";
+}
+
+DEFINE_MACHINE("mipssim-virtio", mips_mipssim_virtio_machine_init)
+

Index: pkgsrc/emulators/qemu7/patches/patch-audio_jackaudio.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-audio_jackaudio.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-audio_jackaudio.c      Sun Mar  2 12:45:46 2025
@@ -0,0 +1,20 @@
+$NetBSD: patch-audio_jackaudio.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Teach it about NetBSD's and macOS' pthread_setname_np.
+
+--- audio/jackaudio.c.orig     2021-12-14 20:42:02.000000000 +0000
++++ audio/jackaudio.c
+@@ -631,7 +631,13 @@ static int qjack_thread_creator(jack_nat
+     }
+ 
+     /* set the name of the thread */
++#ifdef __NetBSD__
++    pthread_setname_np(*thread, "%s", (void *)"jack-client");
++#elif __APPLE__
++    pthread_setname_np("jack-client");
++#else
+     pthread_setname_np(*thread, "jack-client");
++#endif
+ 
+     return ret;
+ }
Index: pkgsrc/emulators/qemu7/patches/patch-backends_tpm_tpm__ioctl.h
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-backends_tpm_tpm__ioctl.h:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-backends_tpm_tpm__ioctl.h      Sun Mar  2 12:45:46 2025
@@ -0,0 +1,16 @@
+$NetBSD: patch-backends_tpm_tpm__ioctl.h,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+SunOS needs filio.h for _IO*() macros.
+
+--- backends/tpm/tpm_ioctl.h.orig      2022-12-14 16:28:45.000000000 +0000
++++ backends/tpm/tpm_ioctl.h
+@@ -14,6 +14,9 @@
+ 
+ #include <stdint.h>
+ #include <sys/types.h>
++#ifdef __sun
++#include <sys/filio.h>
++#endif
+ #ifndef _WIN32
+ #include <sys/uio.h>
+ #include <sys/ioctl.h>
Index: pkgsrc/emulators/qemu7/patches/patch-hw-mips-Kconfig
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw-mips-Kconfig:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw-mips-Kconfig        Sun Mar  2 12:45:46 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-hw-mips-Kconfig,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Qemu MIPS target MIPSSIM adding VirtIO devices for development purposes.
+
+--- hw/mips/Kconfig.orig       2020-08-11 19:17:15.000000000 +0000
++++ hw/mips/Kconfig
+@@ -20,6 +20,8 @@ config MIPSSIM
+     select ISA_BUS
+     select SERIAL_ISA
+     select MIPSNET
++    select VIRTIO_MMIO
++    select OR_IRQ
+ 
+ config JAZZ
+     bool
Index: pkgsrc/emulators/qemu7/patches/patch-hw-mips-mipssim.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw-mips-mipssim.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw-mips-mipssim.c      Sun Mar  2 12:45:46 2025
@@ -0,0 +1,77 @@
+$NetBSD: patch-hw-mips-mipssim.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Qemu MIPS target MIPSSIM adding VirtIO devices for development purposes.
+
+--- hw/mips/mipssim.c.orig     2021-08-04 16:29:07.000000000 +0000
++++ hw/mips/mipssim.c
+@@ -39,12 +39,20 @@
+ #include "hw/boards.h"
+ #include "hw/mips/bios.h"
+ #include "hw/loader.h"
++#include "hw/or-irq.h"
+ #include "elf.h"
+ #include "hw/sysbus.h"
+ #include "hw/qdev-properties.h"
+ #include "qemu/error-report.h"
+ #include "sysemu/qtest.h"
+ #include "sysemu/reset.h"
++#include "hw/virtio/virtio-mmio.h"
++
++#define NUM_VIRTIO_TRANSPORTS 32
++
++#define DEV_SPACING           0x10000         /* space devices every 64k */
++#define ISA_BASE              0x1fd00000
++#define       VIRTIO_MMIO_BASE        (ISA_BASE + DEV_SPACING)
+ 
+ static struct _loaderparams {
+     int ram_size;
+@@ -135,7 +143,7 @@ static void mipsnet_init(int base, qemu_
+                                 sysbus_mmio_get_region(s, 0));
+ }
+ 
+-static void
++void
+ mips_mipssim_init(MachineState *machine)
+ {
+     const char *kernel_filename = machine->kernel_filename;
+@@ -146,6 +154,7 @@ mips_mipssim_init(MachineState *machine)
+     MemoryRegion *isa = g_new(MemoryRegion, 1);
+     MemoryRegion *bios = g_new(MemoryRegion, 1);
+     Clock *cpuclk;
++    DeviceState *virtio_orgate;
+     MIPSCPU *cpu;
+     CPUMIPSState *env;
+     ResetData *reset_info;
+@@ -208,7 +217,7 @@ mips_mipssim_init(MachineState *machine)
+     /* Register 64 KB of ISA IO space at 0x1fd00000. */
+     memory_region_init_alias(isa, NULL, "isa_mmio",
+                              get_system_io(), 0, 0x00010000);
+-    memory_region_add_subregion(get_system_memory(), 0x1fd00000, isa);
++    memory_region_add_subregion(get_system_memory(), ISA_BASE, isa);
+ 
+     /*
+      * A single 16450 sits at offset 0x3f8. It is attached to
+@@ -229,6 +238,23 @@ mips_mipssim_init(MachineState *machine)
+     if (nd_table[0].used)
+         /* MIPSnet uses the MIPS CPU INT0, which is interrupt 2. */
+         mipsnet_init(0x4200, env->irq[2], &nd_table[0]);
++
++    /*
++     * virtio extention; register 32 virtio devices just after the ISA space
++     * at 0x1fd10000 with stride of 512 bytes as per i386s microvm target.
++     * register these devices in reverse order (see comments in hw/arm/virt.c)
++     */
++    virtio_orgate = DEVICE(object_new(TYPE_OR_IRQ));
++    object_property_set_int(OBJECT(virtio_orgate),
++         "num-lines", NUM_VIRTIO_TRANSPORTS, &error_fatal);
++    qdev_realize_and_unref(virtio_orgate, NULL, &error_fatal);
++
++    for (int i = NUM_VIRTIO_TRANSPORTS - 1; i >= 0; i--) {
++        sysbus_create_simple("virtio-mmio",
++            0x1fd10000 + i * 512,
++            qdev_get_gpio_in(virtio_orgate, i));
++    }
++    qdev_connect_gpio_out(DEVICE(virtio_orgate), 0, env->irq[3]);
+ }
+ 
+ static void mips_mipssim_machine_init(MachineClass *mc)
Index: pkgsrc/emulators/qemu7/patches/patch-hw_display_omap__dss.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw_display_omap__dss.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw_display_omap__dss.c Sun Mar  2 12:45:46 2025
@@ -0,0 +1,30 @@
+$NetBSD: patch-hw_display_omap__dss.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h>
+(PR lib/43832: ssp causes common names to be defines)
+
+--- hw/display/omap_dss.c.orig 2022-12-14 16:28:45.000000000 +0000
++++ hw/display/omap_dss.c
+@@ -798,18 +798,18 @@ static void omap_rfbi_write(void *opaque
+         break;
+     case 0x58:  /* RFBI_READ */
+         if ((s->rfbi.control & (1 << 2)) && s->rfbi.chip[0])
+-            s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 1);
++            s->rfbi.rxbuf = (*s->rfbi.chip[0]->read)(s->rfbi.chip[0]->opaque, 1);
+         else if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1])
+-            s->rfbi.rxbuf = s->rfbi.chip[1]->read(s->rfbi.chip[1]->opaque, 1);
++            s->rfbi.rxbuf = (*s->rfbi.chip[1]->read)(s->rfbi.chip[1]->opaque, 1);
+         if (!-- s->rfbi.pixels)
+             omap_rfbi_transfer_stop(s);
+         break;
+ 
+     case 0x5c:  /* RFBI_STATUS */
+         if ((s->rfbi.control & (1 << 2)) && s->rfbi.chip[0])
+-            s->rfbi.rxbuf = s->rfbi.chip[0]->read(s->rfbi.chip[0]->opaque, 0);
++            s->rfbi.rxbuf = (*s->rfbi.chip[0]->read)(s->rfbi.chip[0]->opaque, 0);
+         else if ((s->rfbi.control & (1 << 3)) && s->rfbi.chip[1])
+-            s->rfbi.rxbuf = s->rfbi.chip[1]->read(s->rfbi.chip[1]->opaque, 0);
++            s->rfbi.rxbuf = (*s->rfbi.chip[1]->read)(s->rfbi.chip[1]->opaque, 0);
+         if (!-- s->rfbi.pixels)
+             omap_rfbi_transfer_stop(s);
+         break;
Index: pkgsrc/emulators/qemu7/patches/patch-hw_mips_meson.build
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw_mips_meson.build:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw_mips_meson.build    Sun Mar  2 12:45:46 2025
@@ -0,0 +1,15 @@
+$NetBSD: patch-hw_mips_meson.build,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Qemu MIPS target MIPSSIM adding VirtIO devices for development purposes.
+
+--- hw/mips/meson.build.orig   2021-08-04 16:29:07.000000000 +0000
++++ hw/mips/meson.build
+@@ -7,7 +7,7 @@ mips_ss.add(when: 'CONFIG_MIPS_CPS', if_
+ 
+ if 'CONFIG_TCG' in config_all
+ mips_ss.add(when: 'CONFIG_JAZZ', if_true: files('jazz.c'))
+-mips_ss.add(when: 'CONFIG_MIPSSIM', if_true: files('mipssim.c'))
++mips_ss.add(when: 'CONFIG_MIPSSIM', if_true: files('mipssim.c', 'mipssim_virtio.c'))
+ mips_ss.add(when: 'CONFIG_FULOONG', if_true: files('fuloong2e.c'))
+ mips_ss.add(when: 'CONFIG_MIPS_BOSTON', if_true: [files('boston.c'), fdt])
+ endif
Index: pkgsrc/emulators/qemu7/patches/patch-hw_net_etraxfs__eth.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw_net_etraxfs__eth.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw_net_etraxfs__eth.c  Sun Mar  2 12:45:46 2025
@@ -0,0 +1,25 @@
+$NetBSD: patch-hw_net_etraxfs__eth.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h>
+(PR lib/43832: ssp causes common names to be defines)
+
+--- hw/net/etraxfs_eth.c.orig  2013-11-27 22:15:55.000000000 +0000
++++ hw/net/etraxfs_eth.c
+@@ -185,7 +185,7 @@ static void mdio_read_req(struct qemu_md
+ 
+     phy = bus->devs[bus->addr];
+     if (phy && phy->read) {
+-        bus->data = phy->read(phy, bus->req);
++        bus->data = (*phy->read)(phy, bus->req);
+     } else {
+         bus->data = 0xffff;
+     }
+@@ -364,7 +364,7 @@ static void eth_validate_duplex(ETRAXFSE
+     int new_mm = 0;
+ 
+     phy = eth->mdio_bus.devs[eth->phyaddr];
+-    phy_duplex = !!(phy->read(phy, 18) & (1 << 11));
++    phy_duplex = !!((*phy->read)(phy, 18) & (1 << 11));
+     mac_duplex = !!(eth->regs[RW_REC_CTRL] & 128);
+ 
+     if (mac_duplex != phy_duplex) {
Index: pkgsrc/emulators/qemu7/patches/patch-hw_net_xilinx__axienet.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw_net_xilinx__axienet.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw_net_xilinx__axienet.c       Sun Mar  2 12:45:46 2025
@@ -0,0 +1,16 @@
+$NetBSD: patch-hw_net_xilinx__axienet.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h>
+(PR lib/43832: ssp causes common names to be defines)
+
+--- hw/net/xilinx_axienet.c.orig       2013-11-27 22:15:55.000000000 +0000
++++ hw/net/xilinx_axienet.c
+@@ -207,7 +207,7 @@ static uint16_t mdio_read_req(struct MDI
+ 
+     phy = bus->devs[addr];
+     if (phy && phy->read) {
+-        data = phy->read(phy, reg);
++        data = (*phy->read)(phy, reg);
+     } else {
+         data = 0xffff;
+     }
Index: pkgsrc/emulators/qemu7/patches/patch-hw_rtc_mc146818rtc.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw_rtc_mc146818rtc.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw_rtc_mc146818rtc.c   Sun Mar  2 12:45:46 2025
@@ -0,0 +1,32 @@
+$NetBSD: patch-hw_rtc_mc146818rtc.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Ensure the periodic timer is started as soon as the device is realized,
+and follow the real hardware's lead of updating the PF bit in REG_C even
+if it's not going to result in raising an interrupt.
+
+--- hw/rtc/mc146818rtc.c.orig  2020-10-01 00:56:55.574093880 +0000
++++ hw/rtc/mc146818rtc.c       2020-10-01 00:58:40.326479896 +0000
+@@ -155,9 +155,15 @@ static uint32_t rtc_periodic_clock_ticks
+ {
+     int period_code;
+ 
++#if 0
++    /*
++     * Real hardware sets the PF bit rergardless if it actually
++     * raises an interrupt.
++     */
+     if (!(s->cmos_data[RTC_REG_B] & REG_B_PIE)) {
+         return 0;
+      }
++#endif
+ 
+     period_code = s->cmos_data[RTC_REG_A] & 0x0f;
+ 
+@@ -944,6 +950,7 @@ static void rtc_realizefn(DeviceState *d
+     }
+ 
+     s->periodic_timer = timer_new_ns(rtc_clock, rtc_periodic_timer, s);
++    periodic_timer_update(s, qemu_clock_get_ns(rtc_clock), 0, true);
+     s->update_timer = timer_new_ns(rtc_clock, rtc_update_timer, s);
+     check_update_timer(s);
+ 
Index: pkgsrc/emulators/qemu7/patches/patch-hw_scsi_scsi-disk.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw_scsi_scsi-disk.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw_scsi_scsi-disk.c    Sun Mar  2 12:45:46 2025
@@ -0,0 +1,50 @@
+$NetBSD: patch-hw_scsi_scsi-disk.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Fill in more of SCSI disk block size reports to guest. Allows use of
+sector sizes outside range of 256 to 32768.
+
+--- hw/scsi/scsi-disk.c.orig   2020-08-11 19:17:15.000000000 +0000
++++ hw/scsi/scsi-disk.c
+@@ -1293,9 +1293,9 @@ static int scsi_disk_emulate_mode_sense(
+         p[2] = (nb_sectors >> 8) & 0xff;
+         p[3] = nb_sectors & 0xff;
+         p[4] = 0; /* reserved */
+-        p[5] = 0; /* bytes 5-7 are the sector size in bytes */
+-        p[6] = s->qdev.blocksize >> 8;
+-        p[7] = 0;
++        p[5] = (s->qdev.blocksize >> 16) & 0xff; /* bytes 5-7 are the sector size in bytes */
++        p[6] = (s->qdev.blocksize >> 8) & 0xff;
++        p[7] = s->qdev.blocksize & 0xff;
+         p += 8;
+     }
+ 
+@@ -1993,10 +1993,10 @@ static int32_t scsi_disk_emulate_command
+         outbuf[1] = (nb_sectors >> 16) & 0xff;
+         outbuf[2] = (nb_sectors >> 8) & 0xff;
+         outbuf[3] = nb_sectors & 0xff;
+-        outbuf[4] = 0;
+-        outbuf[5] = 0;
+-        outbuf[6] = s->qdev.blocksize >> 8;
+-        outbuf[7] = 0;
++        outbuf[4] = (s->qdev.blocksize >> 24) & 0xff;;
++        outbuf[5] = (s->qdev.blocksize >> 16) & 0xff;
++        outbuf[6] = (s->qdev.blocksize >> 8) & 0xff;
++        outbuf[7] = s->qdev.blocksize & 0xff;;
+         break;
+     case REQUEST_SENSE:
+         /* Just return "NO SENSE".  */
+@@ -2062,10 +2062,10 @@ static int32_t scsi_disk_emulate_command
+             outbuf[5] = (nb_sectors >> 16) & 0xff;
+             outbuf[6] = (nb_sectors >> 8) & 0xff;
+             outbuf[7] = nb_sectors & 0xff;
+-            outbuf[8] = 0;
+-            outbuf[9] = 0;
+-            outbuf[10] = s->qdev.blocksize >> 8;
+-            outbuf[11] = 0;
++            outbuf[8] = (s->qdev.blocksize >> 24) & 0xff;
++            outbuf[9] = (s->qdev.blocksize >> 16) & 0xff;
++            outbuf[10] = (s->qdev.blocksize >> 8) & 0xff;
++            outbuf[11] = s->qdev.blocksize & 0xff;
+             outbuf[12] = 0;
+             outbuf[13] = get_physical_block_exp(&s->qdev.conf);
+ 
Index: pkgsrc/emulators/qemu7/patches/patch-hw_usb_dev-mtp.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-hw_usb_dev-mtp.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-hw_usb_dev-mtp.c       Sun Mar  2 12:45:46 2025
@@ -0,0 +1,27 @@
+$NetBSD: patch-hw_usb_dev-mtp.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Various build fixes for SunOS.
+
+--- hw/usb/dev-mtp.c.orig      2020-12-08 16:59:44.000000000 +0000
++++ hw/usb/dev-mtp.c
+@@ -30,6 +30,10 @@
+ #include "qemu/units.h"
+ #include "qom/object.h"
+ 
++#ifndef NAME_MAX
++#define NAME_MAX 255
++#endif
++
+ /* ----------------------------------------------------------------------- */
+ 
+ enum mtp_container_type {
+@@ -618,6 +622,9 @@ static void usb_mtp_object_readdir(MTPSt
+     }
+     o->have_children = true;
+ 
++#ifndef O_DIRECTORY
++#define O_DIRECTORY   0
++#endif
+     fd = open(o->path, O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW);
+     if (fd < 0) {
+         return;
Index: pkgsrc/emulators/qemu7/patches/patch-meson.build
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-meson.build:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-meson.build    Sun Mar  2 12:45:46 2025
@@ -0,0 +1,26 @@
+$NetBSD: patch-meson.build,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+* Detect iconv in libc properly for pkgsrc (pkgsrc removes -liconv)
+  to fix qemu-system-aarch64 link.
+* Detect curses (non-ncurses{,w} too)
+
+--- meson.build.orig   2022-04-19 19:10:27.000000000 +0000
++++ meson.build
+@@ -768,7 +768,7 @@ if have_system and get_option('curses').
+       has_curses_h = cc.has_header('curses.h', args: curses_compile_args)
+     endif
+     if has_curses_h
+-      curses_libname_list = (targetos == 'windows' ? ['pdcurses'] : ['ncursesw', 'cursesw'])
++      curses_libname_list = (targetos == 'windows' ? ['pdcurses'] : ['ncursesw', 'cursesw', 'curses'])
+       foreach curses_libname : curses_libname_list
+         libcurses = cc.find_library(curses_libname,
+                                     required: false,
+@@ -786,7 +786,7 @@ if have_system and get_option('curses').
+     endif
+   endif
+   if get_option('iconv').allowed()
+-    foreach link_args : [ ['-liconv'], [] ]
++    foreach link_args : [ [], ['-liconv'] ]
+       # Programs will be linked with glib and this will bring in libiconv on FreeBSD.
+       # We need to use libiconv if available because mixing libiconv's headers with
+       # the system libc does not work.
Index: pkgsrc/emulators/qemu7/patches/patch-meson_mesonbuild_linkers_linkers.py
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-meson_mesonbuild_linkers_linkers.py:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-meson_mesonbuild_linkers_linkers.py    Sun Mar  2 12:45:46 2025
@@ -0,0 +1,16 @@
+$NetBSD: patch-meson_mesonbuild_linkers_linkers.py,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+qemu ships its own version of meson for some strange reason so we need to
+apply the same patch here too to avoid thin archives.
+
+--- meson/mesonbuild/linkers/linkers.py.orig   2022-12-14 16:29:34.000000000 +0000
++++ meson/mesonbuild/linkers/linkers.py
+@@ -197,7 +197,7 @@ class ArLinker(ArLikeLinker):
+         thinargs = ''
+         if '[D]' in stdo:
+             stdargs += 'D'
+-        if '[T]' in stdo:
++        if '[T]' in stdo and not mesonlib.is_sunos():
+             thinargs = 'T'
+         self.std_args = [stdargs]
+         self.std_thin_args = [stdargs + thinargs]
Index: pkgsrc/emulators/qemu7/patches/patch-roms_u-boot-sam460ex_Makefile
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-roms_u-boot-sam460ex_Makefile:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-roms_u-boot-sam460ex_Makefile  Sun Mar  2 12:45:46 2025
@@ -0,0 +1,32 @@
+$NetBSD: patch-roms_u-boot-sam460ex_Makefile,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Fix unportable test(1) operator.
+
+--- roms/u-boot-sam460ex/Makefile.orig 2020-12-08 17:00:58.000000000 +0000
++++ roms/u-boot-sam460ex/Makefile
+@@ -2189,10 +2189,10 @@ M5475GFE_config :      unconfig
+       if [ "$${CODE}" != "0" ] ; then \
+               echo "#define CONFIG_SYS_NOR1SZ $${CODE}" >> $(obj)include/config.h ; \
+       fi; \
+-      if [ "$${VID}" == "1" ] ; then \
++      if [ "$${VID}" = "1" ] ; then \
+               echo "#define CONFIG_SYS_VIDEO" >> $(obj)include/config.h ; \
+       fi; \
+-      if [ "$${USB}" == "1" ] ; then \
++      if [ "$${USB}" = "1" ] ; then \
+               echo "#define CONFIG_SYS_USBCTRL" >> $(obj)include/config.h ; \
+       fi
+       @$(MKCONFIG) -a M5475EVB m68k mcf547x_8x m547xevb freescale
+@@ -2224,10 +2224,10 @@ M5485HFE_config :      unconfig
+       if [ "$${CODE}" != "0" ] ; then \
+               echo "#define CONFIG_SYS_NOR1SZ $${CODE}" >> $(obj)include/config.h ; \
+       fi; \
+-      if [ "$${VID}" == "1" ] ; then \
++      if [ "$${VID}" = "1" ] ; then \
+               echo "#define CONFIG_SYS_VIDEO" >> $(obj)include/config.h ; \
+       fi; \
+-      if [ "$${USB}" == "1" ] ; then \
++      if [ "$${USB}" = "1" ] ; then \
+               echo "#define CONFIG_SYS_USBCTRL" >> $(obj)include/config.h ; \
+       fi
+       @$(MKCONFIG) -a M5485EVB m68k mcf547x_8x m548xevb freescale
Index: pkgsrc/emulators/qemu7/patches/patch-target_arm_translate-sve.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-target_arm_translate-sve.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-target_arm_translate-sve.c     Sun Mar  2 12:45:46 2025
@@ -0,0 +1,16 @@
+$NetBSD: patch-target_arm_translate-sve.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Avoid FSCALE define, notably on SunOS.
+
+--- target/arm/translate-sve.c.orig    2022-08-30 16:41:57.000000000 +0000
++++ target/arm/translate-sve.c
+@@ -3988,6 +3988,9 @@ TRANS_FEAT_NONSTREAMING(FTSMUL, aa64_sve
+     };                                                          \
+     TRANS_FEAT(NAME, FEAT, gen_gvec_fpst_arg_zpzz, name##_zpzz_fns[a->esz], a)
+ 
++#ifdef FSCALE
++#undef FSCALE
++#endif
+ DO_ZPZZ_FP(FADD_zpzz, aa64_sve, sve_fadd)
+ DO_ZPZZ_FP(FSUB_zpzz, aa64_sve, sve_fsub)
+ DO_ZPZZ_FP(FMUL_zpzz, aa64_sve, sve_fmul)
Index: pkgsrc/emulators/qemu7/patches/patch-target_i386_cpu.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-target_i386_cpu.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-target_i386_cpu.c      Sun Mar  2 12:45:46 2025
@@ -0,0 +1,33 @@
+$NetBSD: patch-target_i386_cpu.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Permit to use `-cpu host' with NVMM.
+
+--- target/i386/cpu.c.orig     2022-08-30 16:41:57.000000000 +0000
++++ target/i386/cpu.c
+@@ -26,6 +26,7 @@
+ #include "tcg/helper-tcg.h"
+ #include "sysemu/reset.h"
+ #include "sysemu/hvf.h"
++#include "sysemu/nvmm.h"
+ #include "kvm/kvm_i386.h"
+ #include "sev.h"
+ #include "qapi/error.h"
+@@ -1486,7 +1487,7 @@ static uint32_t xsave_area_size(uint64_t
+ 
+ static inline bool accel_uses_host_cpuid(void)
+ {
+-    return kvm_enabled() || hvf_enabled();
++    return kvm_enabled() || hvf_enabled() || nvmm_enabled();
+ }
+ 
+ static inline uint64_t x86_cpu_xsave_xcr0_components(X86CPU *cpu)
+@@ -6476,7 +6477,8 @@ static void x86_cpu_realizefn(DeviceStat
+ 
+     if (xcc->host_cpuid_required && !accel_uses_host_cpuid()) {
+         g_autofree char *name = x86_cpu_class_get_model_name(xcc);
+-        error_setg(&local_err, "CPU model '%s' requires KVM or HVF", name);
++        error_setg(&local_err,
++                 "CPU model '%s' requires KVM or HVF or NVMM", name);
+         goto out;
+     }
+ 
Index: pkgsrc/emulators/qemu7/patches/patch-target_i386_meson.build
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-target_i386_meson.build:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-target_i386_meson.build        Sun Mar  2 12:45:46 2025
@@ -0,0 +1,14 @@
+$NetBSD: patch-target_i386_meson.build,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Permit to use `-cpu host' with NVMM.
+
+--- target/i386/meson.build.orig       2022-04-19 19:10:27.000000000 +0000
++++ target/i386/meson.build
+@@ -11,6 +11,7 @@ i386_ss.add(when: 'CONFIG_SEV', if_true:
+ # x86 cpu type
+ i386_ss.add(when: 'CONFIG_KVM', if_true: files('host-cpu.c'))
+ i386_ss.add(when: 'CONFIG_HVF', if_true: files('host-cpu.c'))
++i386_ss.add(when: 'CONFIG_NVMM', if_true: files('host-cpu.c'))
+ 
+ i386_softmmu_ss = ss.source_set()
+ i386_softmmu_ss.add(files(
Index: pkgsrc/emulators/qemu7/patches/patch-target_sparc_translate.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-target_sparc_translate.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-target_sparc_translate.c       Sun Mar  2 12:45:46 2025
@@ -0,0 +1,24 @@
+$NetBSD: patch-target_sparc_translate.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Patch from upstream (not integrated there yet) to work around %pc/%npc
+being set to invalid values via ptrace, triggered by the NetBSD ptrace
+ATF tests. Real hardware seems to hardcode the lower bits to zero too.
+
+--- target/sparc/translate.c.orig      2020-08-11 21:17:15.000000000 +0200
++++ target/sparc/translate.c   2020-11-02 18:04:50.507211101 +0100
+@@ -4525,6 +4525,7 @@
+ 
+                                     r_tsptr = tcg_temp_new_ptr();
+                                     gen_load_trap_state_at_tl(r_tsptr, cpu_env);
++                                    tcg_gen_andi_tl(cpu_tmp0, cpu_tmp0, ~3);
+                                     tcg_gen_st_tl(cpu_tmp0, r_tsptr,
+                                                   offsetof(trap_state, tpc));
+                                     tcg_temp_free_ptr(r_tsptr);
+@@ -4536,6 +4537,7 @@
+ 
+                                     r_tsptr = tcg_temp_new_ptr();
+                                     gen_load_trap_state_at_tl(r_tsptr, cpu_env);
++                                    tcg_gen_andi_tl(cpu_tmp0, cpu_tmp0, ~3);
+                                     tcg_gen_st_tl(cpu_tmp0, r_tsptr,
+                                                   offsetof(trap_state, tnpc));
+                                     tcg_temp_free_ptr(r_tsptr);
Index: pkgsrc/emulators/qemu7/patches/patch-util_coroutine-ucontext.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-util_coroutine-ucontext.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-util_coroutine-ucontext.c      Sun Mar  2 12:45:46 2025
@@ -0,0 +1,19 @@
+$NetBSD: patch-util_coroutine-ucontext.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+https://github.com/omniosorg/omnios-extra/blob/master/build/qemu/patches/0008-Temporary-coroutine-patch-pending-illumos-15206.patch
+
+--- util/coroutine-ucontext.c.orig     2022-12-14 16:28:45.000000000 +0000
++++ util/coroutine-ucontext.c
+@@ -305,6 +305,12 @@ qemu_coroutine_switch(Coroutine *from_,
+ 
+     ret = sigsetjmp(from->env, 0);
+     if (ret == 0) {
++#if defined(__sun)
++#define SIGJMP2UCONTEXT(x) ((ucontext_t *)P2ROUNDUP((uintptr_t)(x),  sizeof (upad128_t)))
++        ucontext_t *f = SIGJMP2UCONTEXT(from->env);
++        ucontext_t *t = SIGJMP2UCONTEXT(to->env);
++        t->uc_mcontext.gregs[REG_FSBASE] = f->uc_mcontext.gregs[REG_FSBASE];
++#endif
+         start_switch_fiber_asan(action, &fake_stack_save, to->stack,
+                                 to->stack_size);
+         start_switch_fiber_tsan(&fake_stack_save,
Index: pkgsrc/emulators/qemu7/patches/patch-util_osdep.c
diff -u /dev/null pkgsrc/emulators/qemu7/patches/patch-util_osdep.c:1.1
--- /dev/null   Sun Mar  2 12:45:47 2025
+++ pkgsrc/emulators/qemu7/patches/patch-util_osdep.c   Sun Mar  2 12:45:46 2025
@@ -0,0 +1,18 @@
+$NetBSD: patch-util_osdep.c,v 1.1 2025/03/02 12:45:46 nia Exp $
+
+Don't use OFD locking on SunOS.
+https://github.com/omniosorg/omnios-extra/blob/master/build/qemu/patches/0002-illumos-OFD-locking-must-span-the-entire-file.patch
+
+--- util/osdep.c.orig  2022-12-14 16:28:45.000000000 +0000
++++ util/osdep.c
+@@ -31,6 +31,10 @@
+ #include "qemu/hw-version.h"
+ #include "monitor/monitor.h"
+ 
++#if defined(__sun)
++#undef F_OFD_SETLK
++#endif
++
+ static const char *hw_version = QEMU_HW_VERSION;
+ 
+ int socket_set_cork(int fd, int v)



Home | Main Index | Thread Index | Old Index