pkgsrc-WIP-changes archive

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

Import qemu-2.8.1 as wip/qemu-git.



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Apr 25 14:28:09 2017 +0200
Changeset:	def362a53d7651aec41a2b63cc78294386aa2d2f

Added Files:
	qemu-git/DESCR
	qemu-git/Makefile
	qemu-git/PLIST
	qemu-git/PLIST.Linux
	qemu-git/distinfo
	qemu-git/files/Makefile.multinode-NetBSD
	qemu-git/options.mk
	qemu-git/patches/patch-Makefile.objs
	qemu-git/patches/patch-configure
	qemu-git/patches/patch-default-configs_pci.mak
	qemu-git/patches/patch-disas_libvixl_vixl_a64_disasm-a64.cc
	qemu-git/patches/patch-disas_libvixl_vixl_utils.h
	qemu-git/patches/patch-ef
	qemu-git/patches/patch-et
	qemu-git/patches/patch-hw_display_omap__dss.c
	qemu-git/patches/patch-hw_misc_ivshmem.c
	qemu-git/patches/patch-hw_net_etraxfs__eth.c
	qemu-git/patches/patch-hw_net_xilinx__axienet.c
	qemu-git/patches/patch-hw_ppc_mac__newworld.c
	qemu-git/patches/patch-hw_ppc_mac__oldworld.c
	qemu-git/patches/patch-memory.c
	qemu-git/patches/patch-scripts_qemu-binfmt-conf.sh
	qemu-git/patches/patch-slirp_tcp__subr.c
	qemu-git/patches/patch-target-i386_bpt__helper.c
	qemu-git/patches/patch-target-i386_helper.h
	qemu-git/patches/patch-target-i386_translate.c
	qemu-git/patches/patch-tests_Makefile.include

Log Message:
Import qemu-2.8.1 as wip/qemu-git.

QEMU is a FAST! processor emulator using dynamic translation to achieve
good emulation speed, QEMU has two operating modes:

    * Full system emulation. In this mode, QEMU emulates a full system
      (for example a PC), including a processor and various peripherals.
      It can be used to launch different Operating Systems without rebooting
      the PC or to debug system code.
    * User mode emulation (Linux host only). In this mode, QEMU can launch
      Linux processes compiled for one CPU on another CPU. It can be used
      to launch the Wine Windows API emulator or to ease cross-compilation
      and cross-debugging.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=def362a53d7651aec41a2b63cc78294386aa2d2f

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

diffstat:
 qemu-git/DESCR                                     |  11 ++
 qemu-git/Makefile                                  | 152 ++++++++++++++++++++
 qemu-git/PLIST                                     | 154 +++++++++++++++++++++
 qemu-git/PLIST.Linux                               |   8 ++
 qemu-git/distinfo                                  |  26 ++++
 qemu-git/files/Makefile.multinode-NetBSD           |  59 ++++++++
 qemu-git/options.mk                                |  37 +++++
 qemu-git/patches/patch-Makefile.objs               |  15 ++
 qemu-git/patches/patch-configure                   | 108 +++++++++++++++
 qemu-git/patches/patch-default-configs_pci.mak     |  11 ++
 .../patch-disas_libvixl_vixl_a64_disasm-a64.cc     |  16 +++
 qemu-git/patches/patch-disas_libvixl_vixl_utils.h  |  19 +++
 qemu-git/patches/patch-ef                          |  16 +++
 qemu-git/patches/patch-et                          |  12 ++
 qemu-git/patches/patch-hw_display_omap__dss.c      |  30 ++++
 qemu-git/patches/patch-hw_misc_ivshmem.c           |  14 ++
 qemu-git/patches/patch-hw_net_etraxfs__eth.c       |  25 ++++
 qemu-git/patches/patch-hw_net_xilinx__axienet.c    |  16 +++
 qemu-git/patches/patch-hw_ppc_mac__newworld.c      |  38 +++++
 qemu-git/patches/patch-hw_ppc_mac__oldworld.c      |  38 +++++
 qemu-git/patches/patch-memory.c                    |  13 ++
 qemu-git/patches/patch-scripts_qemu-binfmt-conf.sh |  21 +++
 qemu-git/patches/patch-slirp_tcp__subr.c           |  13 ++
 qemu-git/patches/patch-target-i386_bpt__helper.c   |  31 +++++
 qemu-git/patches/patch-target-i386_helper.h        |  25 ++++
 qemu-git/patches/patch-target-i386_translate.c     |  93 +++++++++++++
 qemu-git/patches/patch-tests_Makefile.include      |  17 +++
 27 files changed, 1018 insertions(+)

diffs:
diff --git a/qemu-git/DESCR b/qemu-git/DESCR
new file mode 100644
index 0000000000..d939711a26
--- /dev/null
+++ b/qemu-git/DESCR
@@ -0,0 +1,11 @@
+QEMU is a FAST! processor emulator using dynamic translation to achieve
+good emulation speed, QEMU has two operating modes:
+
+    * Full system emulation. In this mode, QEMU emulates a full system
+      (for example a PC), including a processor and various peripherals.
+      It can be used to launch different Operating Systems without rebooting
+      the PC or to debug system code.
+    * User mode emulation (Linux host only). In this mode, QEMU can launch
+      Linux processes compiled for one CPU on another CPU. It can be used
+      to launch the Wine Windows API emulator or to ease cross-compilation
+      and cross-debugging.
diff --git a/qemu-git/Makefile b/qemu-git/Makefile
new file mode 100644
index 0000000000..2013b37ad1
--- /dev/null
+++ b/qemu-git/Makefile
@@ -0,0 +1,152 @@
+# $NetBSD: Makefile,v 1.167 2017/04/07 13:32:52 ryoon Exp $
+
+DISTNAME=	qemu-2.8.1
+CATEGORIES=	emulators
+MASTER_SITES=	http://download.qemu-project.org/
+EXTRACT_SUFX=	.tar.bz2
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	http://www.qemu-project.org/
+COMMENT=	CPU emulator using dynamic translation
+LICENSE=	gnu-gpl-v2 AND gnu-lgpl-v2.1 AND mit AND modified-bsd
+
+CONFLICTS+=		qemu-bin-[0-9]*
+NOT_FOR_PLATFORM+=	NetBSD-1.[0-6]*-*
+# qemu 1 does not work on NetBSD-5; see http://gnats.netbsd.org/46565.
+NOT_FOR_PLATFORM+=	NetBSD-5*-*
+
+USE_CURSES=		resize_term wide
+USE_LANGUAGES+=		c c++
+USE_TOOLS+=		bison gmake makeinfo perl:build pkg-config
+FAKE_NCURSES=		yes
+UNLIMIT_RESOURCES=	datasize
+HAS_CONFIGURE=		yes
+
+BUILD_DEPENDS+=		texi2html-[0-9]*:../../textproc/texi2html
+
+SUBST_CLASSES+=			prefix
+SUBST_STAGE.prefix=		pre-configure
+SUBST_MESSAGE.prefix=		Setting PREFIX
+SUBST_FILES.prefix+=		configure
+SUBST_VARS.prefix+=		PREFIX
+
+.include "options.mk"
+
+.include "../../mk/bsd.prefs.mk"
+
+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-jemalloc
+CONFIGURE_ARGS+=	--disable-opengl
+CONFIGURE_ENV+=		mansuffix=/${PKGMANDIR}
+
+.if defined(PKGSRC_USE_SSP)
+# do not add flags to everything
+PKGSRC_USE_SSP=		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-i386
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-lm32
+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-moxie
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-or32
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-ppc
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-ppc64
+NOT_PAX_MPROTECT_SAFE+=	bin/qemu-system-ppcemb
+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-unicore32
+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
+
+REPLACE_PERL+=		scripts/texi2pod.pl
+
+PYTHON_VERSIONS_INCOMPATIBLE=	34 35 36 # not yet ported yet as of 2.8.0
+
+BUILDLINK_PASSTHRU_DIRS+=	/usr/lib
+BUILDLINK_PASSTHRU_RPATHDIRS+=	/usr/lib
+
+INSTALLATION_DIRS=	${PKGMANDIR}/man1 share/doc/qemu
+
+UE_ARCHS+=		alpha arm armeb cris i386 m68k microblaze mips mipsel
+UE_ARCHS+=		or32 ppc ppc64 ppc64abi32 sh4 sh4eb sparc sparc32plus
+UE_ARCHS+=		sparc64 x86_64 microblazeel s390x unicore32
+
+.if ${OPSYS} == "NetBSD"
+.  if (!empty(OS_VERSION:M5.99.*) || !empty(OS_VERSION:M[6-9].*))
+# XXX
+# i386 and x86_64 user emul require newer binutils for PROVIDE_HIDDEN()
+# http://git.qemu.org/qemu.git/commit/?id=845f2c2812d9ed24b36c02a3d06ee83aeafe8b49
+# but binutils-2.19 was enabled around 5.99.22:
+# http://cvsweb.NetBSD.org/bsdweb.cgi/src/share/mk/bsd.own.mk#rev1.594
+USER_EMUL=		i386 x86_64 sparc sparc64
+.  else
+CONFIGURE_ARGS+=	--disable-bsd-user
+USER_EMUL=
+.  endif
+PLIST.nbd=		YES
+.elif !empty(OPSYS:M*BSD) || !empty(OPSYS:MDragonFly)
+USER_EMUL=		i386 x86_64 sparc sparc64
+PLIST.nbd=		YES
+.elif !empty(OPSYS:MDarwin)
+USER_EMUL=
+CONFIGURE_ARGS+=	--disable-bsd-user
+PLIST.nbd=		YES
+.elif !empty(OPSYS:MLinux)
+USER_EMUL=		${UE_ARCHS}
+PLIST.nbd=		YES
+.elif !empty(MACHINE_PLATFORM:MSunOS-5.11-*)
+PLIST.nbd=		YES
+CONFIGURE_ARGS+=	--disable-coroutine-pool
+.endif
+
+PLIST_VARS+=		${UE_ARCHS} nbd
+.for _var_ in ${USER_EMUL}
+PLIST.${_var_}=		YES
+.endfor
+
+post-install:
+	${INSTALL_DATA} ${FILESDIR}/Makefile.multinode-NetBSD \
+		${DESTDIR}${PREFIX}/share/doc/qemu/
+
+# On Darwin, qemu uses Cocoa and CoreAudio
+.if empty(OPSYS:MDarwin)
+.include "../../mk/oss.buildlink3.mk"
+.endif
+.include "../../archivers/lzo/buildlink3.mk"
+.include "../../devel/glib2/buildlink3.mk"
+.include "../../devel/jemalloc/buildlink3.mk"
+.include "../../devel/snappy/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../lang/python/extension.mk"
+.include "../../security/libgcrypt/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"
diff --git a/qemu-git/PLIST b/qemu-git/PLIST
new file mode 100644
index 0000000000..332989f6f1
--- /dev/null
+++ b/qemu-git/PLIST
@@ -0,0 +1,154 @@
+@comment $NetBSD: PLIST,v 1.49 2017/02/27 05:19:29 adam Exp $
+${PLIST.ivshmem}bin/ivshmem-client
+${PLIST.ivshmem}bin/ivshmem-server
+${PLIST.alpha}bin/qemu-alpha
+${PLIST.arm}bin/qemu-arm
+${PLIST.armeb}bin/qemu-armeb
+${PLIST.cris}bin/qemu-cris
+bin/qemu-ga
+${PLIST.i386}bin/qemu-i386
+bin/qemu-img
+bin/qemu-io
+${PLIST.m68k}bin/qemu-m68k
+${PLIST.microblaze}bin/qemu-microblaze
+${PLIST.microblazeel}bin/qemu-microblazeel
+${PLIST.mips}bin/qemu-mips
+${PLIST.mipsel}bin/qemu-mipsel
+${PLIST.nbd}bin/qemu-nbd
+${PLIST.or32}bin/qemu-or32
+${PLIST.ppc}bin/qemu-ppc
+${PLIST.ppc64}bin/qemu-ppc64
+${PLIST.ppc64abi32}bin/qemu-ppc64abi32
+${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
+${PLIST.unicore32}bin/qemu-unicore32
+bin/qemu-system-aarch64
+bin/qemu-system-alpha
+bin/qemu-system-arm
+bin/qemu-system-cris
+bin/qemu-system-i386
+bin/qemu-system-lm32
+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-moxie
+bin/qemu-system-or32
+bin/qemu-system-ppc
+bin/qemu-system-ppc64
+bin/qemu-system-ppcemb
+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-unicore32
+bin/qemu-system-x86_64
+bin/qemu-system-xtensa
+bin/qemu-system-xtensaeb
+${PLIST.x86_64}bin/qemu-x86_64
+man/man1/qemu-img.1
+man/man1/qemu.1
+man/man8/qemu-ga.8
+man/man8/qemu-nbd.8
+share/doc/qemu/Makefile.multinode-NetBSD
+share/doc/qemu/qemu-doc.html
+share/doc/qemu/qmp-commands.txt
+${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/tr/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/acpi-dsdt.aml
+share/qemu/bamboo.dtb
+share/qemu/bios-256k.bin
+share/qemu/bios.bin
+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/keymaps/ar
+share/qemu/keymaps/bepo
+share/qemu/keymaps/common
+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/modifiers
+share/qemu/keymaps/nl
+share/qemu/keymaps/nl-be
+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/openbios-ppc
+share/qemu/openbios-sparc32
+share/qemu/openbios-sparc64
+share/qemu/palcode-clipper
+share/qemu/petalogix-ml605.dtb
+share/qemu/petalogix-s3adsp1800.dtb
+share/qemu/ppc_rom.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/qemu-icon.bmp
+share/qemu/qemu_logo_no_text.svg
+share/qemu/s390-ccw.img
+share/qemu/sgabios.bin
+share/qemu/skiboot.lid
+share/qemu/slof.bin
+share/qemu/spapr-rtas.bin
+share/qemu/trace-events-all
+share/qemu/u-boot.e500
+share/qemu/vgabios-cirrus.bin
+share/qemu/vgabios-qxl.bin
+share/qemu/vgabios-stdvga.bin
+share/qemu/vgabios-virtio.bin
+share/qemu/vgabios-vmware.bin
+share/qemu/vgabios.bin
diff --git a/qemu-git/PLIST.Linux b/qemu-git/PLIST.Linux
new file mode 100644
index 0000000000..ca5a923bb0
--- /dev/null
+++ b/qemu-git/PLIST.Linux
@@ -0,0 +1,8 @@
+@comment $NetBSD: PLIST.Linux,v 1.4 2015/12/10 02:51:05 joerg Exp $
+bin/qemu-aarch64
+bin/qemu-mips64
+bin/qemu-mips64el
+bin/qemu-mipsn32
+bin/qemu-mipsn32el
+bin/qemu-ppc64le
+libexec/qemu-bridge-helper
diff --git a/qemu-git/distinfo b/qemu-git/distinfo
new file mode 100644
index 0000000000..212cfc1f44
--- /dev/null
+++ b/qemu-git/distinfo
@@ -0,0 +1,26 @@
+$NetBSD: distinfo,v 1.124 2017/04/15 17:38:48 riastradh Exp $
+
+SHA1 (qemu-2.8.1.tar.bz2) = 224289c5e568e400920363820a0647e2aca569e7
+RMD160 (qemu-2.8.1.tar.bz2) = 93f71138d19c871195c9e0b1a7ba66275773f93a
+SHA512 (qemu-2.8.1.tar.bz2) = 0397b4029cdcb77ed053c44b3579a3f34894038e6fc6b4aa88de14515f5a78bf2f41c5e865f37111529f567c85d2f1c4deefae47dde54f76eac79410e5b2bdda
+Size (qemu-2.8.1.tar.bz2) = 28366270 bytes
+SHA1 (patch-Makefile.objs) = f40deeed5482a24369e898411bb611be418dc3ca
+SHA1 (patch-configure) = 4d6e0737cfbd9efcd02ab43c219fed0f0a1a55a9
+SHA1 (patch-default-configs_pci.mak) = 2162550a68de514c8fe9e255df88f8a0a07ee6c7
+SHA1 (patch-disas_libvixl_vixl_a64_disasm-a64.cc) = 0660a0c2d37c332fcd1e00edb2dc3c52fe179cc9
+SHA1 (patch-disas_libvixl_vixl_utils.h) = 85285473b6021f9a0d190832d03c60c4d9df6bb7
+SHA1 (patch-ef) = 98a1de2fd48638886b5d16f6a61dc72910e98b41
+SHA1 (patch-et) = e9b850ac5985cbe934b541acbfdb330cce421d50
+SHA1 (patch-hw_display_omap__dss.c) = 6b13242f28e32346bc70548c216c578d98fd3420
+SHA1 (patch-hw_misc_ivshmem.c) = c1fdc8111286f2c760512189db4a854bfc6129d0
+SHA1 (patch-hw_net_etraxfs__eth.c) = e5dd1661d60dbcd27b332403e0843500ba9544bc
+SHA1 (patch-hw_net_xilinx__axienet.c) = ebcd2676d64ce6f31e4a8c976d4fdf530ad5e8b7
+SHA1 (patch-hw_ppc_mac__newworld.c) = 5131bb6edf8b0acf6e7ed3b6bc7be962dc71eca6
+SHA1 (patch-hw_ppc_mac__oldworld.c) = b71667ab281dc23c9d971dc8754eeefc879bd1d7
+SHA1 (patch-memory.c) = 9f94de7799ef80931fb1de572e5603894f3fb328
+SHA1 (patch-scripts_qemu-binfmt-conf.sh) = a59c227e5891efe201eb2b8af15fb0832a1b20d0
+SHA1 (patch-slirp_tcp__subr.c) = f011c9dc58282e61b26017547a9884f30a6e6154
+SHA1 (patch-target-i386_bpt__helper.c) = c2aacda7cabb4dcc507e260c0d74a976733a2114
+SHA1 (patch-target-i386_helper.h) = af5316b8796f1d9bf70becea9f09245ec0e6e36c
+SHA1 (patch-target-i386_translate.c) = 837c8f348cfd6e027a6292df7d95381020f90825
+SHA1 (patch-tests_Makefile.include) = 42345d697cb2e324dccf1d68bd8d61e8001c6162
diff --git a/qemu-git/files/Makefile.multinode-NetBSD b/qemu-git/files/Makefile.multinode-NetBSD
new file mode 100644
index 0000000000..f4313832eb
--- /dev/null
+++ b/qemu-git/files/Makefile.multinode-NetBSD
@@ -0,0 +1,59 @@
+# $Id: Makefile.multinode-NetBSD,v 1.4 2012/06/07 21:23:46 ryoon 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
diff --git a/qemu-git/options.mk b/qemu-git/options.mk
new file mode 100644
index 0000000000..57ab7fd5e7
--- /dev/null
+++ b/qemu-git/options.mk
@@ -0,0 +1,37 @@
+# $NetBSD: options.mk,v 1.3 2017/02/27 05:19:29 adam Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.qemu
+PKG_SUPPORTED_OPTIONS=	gtk3 ivshmem sdl
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if empty(MACHINE_PLATFORM:MNetBSD-[5-6].*-*)
+PKG_SUGGESTED_OPTIONS+=	ivshmem
+.endif
+
+.if empty(OPSYS:MDarwin)
+PKG_SUGGESTED_OPTIONS+=	sdl
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+PLIST_VARS+=		gtk ivshmem
+
+.if !empty(PKG_OPTIONS:Mivshmem)
+PLIST.ivshmem=		yes
+.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:Msdl)
+CONFIGURE_ARGS+=	--enable-sdl
+.include "../../devel/SDL2/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--disable-sdl
+.endif
diff --git a/qemu-git/patches/patch-Makefile.objs b/qemu-git/patches/patch-Makefile.objs
new file mode 100644
index 0000000000..d2b3b5323f
--- /dev/null
+++ b/qemu-git/patches/patch-Makefile.objs
@@ -0,0 +1,15 @@
+$NetBSD: patch-Makefile.objs,v 1.2 2016/09/04 09:21:04 ryoon Exp $
+
+--- Makefile.objs.orig	2016-09-02 15:34:17.000000000 +0000
++++ Makefile.objs
+@@ -113,8 +113,10 @@ qga-vss-dll-obj-y = qga/
+ 
+ ######################################################################
+ # contrib
++ifeq ($(CONFIG_SHM_OPEN),y)
+ ivshmem-client-obj-y = contrib/ivshmem-client/
+ ivshmem-server-obj-y = contrib/ivshmem-server/
++endif
+ 
+ 
+ ######################################################################
diff --git a/qemu-git/patches/patch-configure b/qemu-git/patches/patch-configure
new file mode 100644
index 0000000000..40dda94cd1
--- /dev/null
+++ b/qemu-git/patches/patch-configure
@@ -0,0 +1,108 @@
+$NetBSD: patch-configure,v 1.18 2017/04/15 17:38:48 riastradh Exp $
+
+Don't use gld on SunOS
+Use ncursesw6-config; define NCURSES_WIDECHAR to fix building on Darwin (at least).
+add check for shm_open
+avoid bad substitution
+
+--- configure.orig	2016-12-20 20:16:44.000000000 +0000
++++ configure
+@@ -631,7 +631,6 @@ SunOS)
+   solaris="yes"
+   make="${MAKE-gmake}"
+   install="${INSTALL-ginstall}"
+-  ld="gld"
+   smbd="${SMBD-/usr/sfw/sbin/smbd}"
+   needs_libsunmath="no"
+   solarisrev=$(uname -r | cut -f2 -d.)
+@@ -2928,23 +2927,23 @@ if test "$curses" != "no" ; then
+     curses_inc_list="$($pkg_config --cflags ncurses 2>/dev/null):"
+     curses_lib_list="$($pkg_config --libs ncurses 2>/dev/null):-lpdcurses"
+   else
+-    curses_inc_list="$($pkg_config --cflags ncursesw 2>/dev/null):-I/usr/include/ncursesw:"
+-    curses_lib_list="$($pkg_config --libs ncursesw 2>/dev/null):-lncursesw:-lcursesw"
++    curses_inc_list="$(@PREFIX@/bin/ncursesw6-config --cflags 2>/dev/null):-I/usr/include/ncursesw:"
++    curses_lib_list="$(@PREFIX@/bin/ncursesw6-config --libs 2>/dev/null):-lncursesw:-lcursesw"
+   fi
+   curses_found=no
+   cat > $TMPC << EOF
+ #include <locale.h>
++#define NCURSES_WIDECHAR 1
+ #include <curses.h>
+ #include <wchar.h>
+ int main(void) {
+-  const char *s = curses_version();
+   wchar_t wch = L'w';
+   setlocale(LC_ALL, "");
+   resize_term(0, 0);
+   addwstr(L"wide chars\n");
+   addnwstr(&wch, 1);
+   add_wch(WACS_DEGREE);
+-  return s != 0;
++  return 0;
+ }
+ EOF
+   IFS=:
+@@ -3762,6 +3761,27 @@ if compile_prog "" "" ; then
+   fallocate_zero_range=yes
+ fi
+ 
++# check for shm_open
++shm_open=no
++cat > $TMPC << EOF
++#include <sys/types.h>
++#include <sys/mman.h>
++#include <fcntl.h>
++#include <stddef.h> // for NULL
++
++int main(void)
++{
++    shm_open(NULL, O_RDWR, 0644);
++    return 0;
++}
++EOF
++if compile_prog "" "" ; then
++    shm_open=yes
++elif compile_prog "" "-lrt" ; then
++    LIBS="$LIBS -lrt"
++    shm_open=yes
++fi
++
+ # check for posix_fallocate
+ posix_fallocate=no
+ cat > $TMPC << EOF
+@@ -4041,8 +4061,13 @@ fi
+ cat > $TMPC <<EOF
+ #include <signal.h>
+ #include <time.h>
++#include <sys/types.h>
++#include <sys/mman.h>
++#include <fcntl.h>
++
+ int main(void) {
+   timer_create(CLOCK_REALTIME, NULL, NULL);
++    shm_open(NULL, O_RDWR, 0644);
+   return clock_gettime(CLOCK_REALTIME, NULL);
+ }
+ EOF
+@@ -4797,7 +4822,9 @@ if test "$want_tools" = "yes" ; then
+   tools="qemu-img\$(EXESUF) qemu-io\$(EXESUF) $tools"
+   if [ "$linux" = "yes" -o "$bsd" = "yes" -o "$solaris" = "yes" ] ; then
+     tools="qemu-nbd\$(EXESUF) $tools"
+-    tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
++    if test "$shm_open" = "yes" ; then
++      tools="ivshmem-client\$(EXESUF) ivshmem-server\$(EXESUF) $tools"
++    fi
+   fi
+ fi
+ if test "$softmmu" = yes ; then
+@@ -5303,6 +5330,9 @@ fi
+ if test "$fallocate_zero_range" = "yes" ; then
+   echo "CONFIG_FALLOCATE_ZERO_RANGE=y" >> $config_host_mak
+ fi
++if [ "$shm_open" = "yes" ] ; then
++  echo "CONFIG_SHM_OPEN=y" >> $config_host_mak
++fi
+ if test "$posix_fallocate" = "yes" ; then
+   echo "CONFIG_POSIX_FALLOCATE=y" >> $config_host_mak
+ fi
diff --git a/qemu-git/patches/patch-default-configs_pci.mak b/qemu-git/patches/patch-default-configs_pci.mak
new file mode 100644
index 0000000000..0ace043226
--- /dev/null
+++ b/qemu-git/patches/patch-default-configs_pci.mak
@@ -0,0 +1,11 @@
+$NetBSD: patch-default-configs_pci.mak,v 1.2 2016/05/15 01:25:15 ryoon Exp $
+
+--- default-configs/pci.mak.orig	2016-05-11 15:56:07.000000000 +0000
++++ default-configs/pci.mak
+@@ -36,5 +36,5 @@ CONFIG_SDHCI=y
+ CONFIG_EDU=y
+ CONFIG_VGA=y
+ CONFIG_VGA_PCI=y
+-CONFIG_IVSHMEM=$(CONFIG_EVENTFD)
++CONFIG_IVSHMEM=$(CONFIG_SHM_OPEN)
+ CONFIG_ROCKER=y
diff --git a/qemu-git/patches/patch-disas_libvixl_vixl_a64_disasm-a64.cc b/qemu-git/patches/patch-disas_libvixl_vixl_a64_disasm-a64.cc
new file mode 100644
index 0000000000..c606cc02df
--- /dev/null
+++ b/qemu-git/patches/patch-disas_libvixl_vixl_a64_disasm-a64.cc
@@ -0,0 +1,16 @@
+$NetBSD: patch-disas_libvixl_vixl_a64_disasm-a64.cc,v 1.1 2017/02/27 05:19:29 adam Exp $
+
+Re-order includes, so __STDC_CONSTANT_MACROS gets defined before including stdint.h.
+
+--- disas/libvixl/vixl/a64/disasm-a64.cc.orig	2017-02-26 09:56:59.312135262 +0000
++++ disas/libvixl/vixl/a64/disasm-a64.cc
+@@ -24,8 +24,8 @@
+ // 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 <cstdlib>
+ #include "vixl/a64/disasm-a64.h"
++#include <cstdlib>
+ 
+ namespace vixl {
+ 
diff --git a/qemu-git/patches/patch-disas_libvixl_vixl_utils.h b/qemu-git/patches/patch-disas_libvixl_vixl_utils.h
new file mode 100644
index 0000000000..409dc42eda
--- /dev/null
+++ b/qemu-git/patches/patch-disas_libvixl_vixl_utils.h
@@ -0,0 +1,19 @@
+$NetBSD: patch-disas_libvixl_vixl_utils.h,v 1.1 2017/02/27 05:19:29 adam Exp $
+
+Re-order includes, so __STDC_CONSTANT_MACROS gets defined before including stdint.h.
+
+--- disas/libvixl/vixl/utils.h.orig	2017-02-26 09:55:15.839475323 +0000
++++ disas/libvixl/vixl/utils.h
+@@ -27,10 +27,10 @@
+ #ifndef VIXL_UTILS_H
+ #define VIXL_UTILS_H
+ 
+-#include <string.h>
+-#include <cmath>
+ #include "vixl/globals.h"
+ #include "vixl/compiler-intrinsics.h"
++#include <string.h>
++#include <cmath>
+ 
+ namespace vixl {
+ 
diff --git a/qemu-git/patches/patch-ef b/qemu-git/patches/patch-ef
new file mode 100644
index 0000000000..e1bd7437d1
--- /dev/null
+++ b/qemu-git/patches/patch-ef
@@ -0,0 +1,16 @@
+$NetBSD: patch-ef,v 1.8 2016/09/04 09:21:04 ryoon Exp $
+
+Avoid conflicts with SSP read() macro in NetBSD's <ssp/unistd.h>
+(PR lib/43832: ssp causes common names to be defines)
+
+--- audio/audio.c.orig	2016-09-02 15:34:17.000000000 +0000
++++ audio/audio.c
+@@ -1156,7 +1156,7 @@ int AUD_read (SWVoiceIn *sw, void *buf, 
+         return 0;
+     }
+ 
+-    return sw->hw->pcm_ops->read(sw, buf, size);
++    return (sw->hw->pcm_ops->read)(sw, buf, size);
+ }
+ 
+ int AUD_get_buffer_size_out (SWVoiceOut *sw)
diff --git a/qemu-git/patches/patch-et b/qemu-git/patches/patch-et
new file mode 100644
index 0000000000..6ce599fabb
--- /dev/null
+++ b/qemu-git/patches/patch-et
@@ -0,0 +1,12 @@
+$NetBSD: patch-et,v 1.14 2015/08/12 06:55:59 ryoon Exp $
+
+--- Makefile.orig	2015-08-11 19:11:05.000000000 +0000
++++ Makefile
+@@ -189,6 +189,7 @@ $(SRC_PATH)/pixman/configure:
+ DTC_MAKE_ARGS=-I$(SRC_PATH)/dtc VPATH=$(SRC_PATH)/dtc -C dtc V="$(V)" LIBFDT_srcdir=$(SRC_PATH)/dtc/libfdt
+ DTC_CFLAGS=$(CFLAGS) $(QEMU_CFLAGS)
+ DTC_CPPFLAGS=-I$(BUILD_DIR)/dtc -I$(SRC_PATH)/dtc -I$(SRC_PATH)/dtc/libfdt
++ARFLAGS=	-rcs
+ 
+ subdir-dtc:dtc/libfdt dtc/tests
+ 	$(call quiet-command,$(MAKE) $(DTC_MAKE_ARGS) CPPFLAGS="$(DTC_CPPFLAGS)" CFLAGS="$(DTC_CFLAGS)" LDFLAGS="$(LDFLAGS)" ARFLAGS="$(ARFLAGS)" CC="$(CC)" AR="$(AR)" LD="$(LD)" $(SUBDIR_MAKEFLAGS) libfdt/libfdt.a,)
diff --git a/qemu-git/patches/patch-hw_display_omap__dss.c b/qemu-git/patches/patch-hw_display_omap__dss.c
new file mode 100644
index 0000000000..fca1167bf3
--- /dev/null
+++ b/qemu-git/patches/patch-hw_display_omap__dss.c
@@ -0,0 +1,30 @@
+$NetBSD: patch-hw_display_omap__dss.c,v 1.2 2014/01/15 18:26:20 wiz 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	2013-11-27 22:15:55.000000000 +0000
++++ hw/display/omap_dss.c
+@@ -791,18 +791,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;
diff --git a/qemu-git/patches/patch-hw_misc_ivshmem.c b/qemu-git/patches/patch-hw_misc_ivshmem.c
new file mode 100644
index 0000000000..c1f54a557f
--- /dev/null
+++ b/qemu-git/patches/patch-hw_misc_ivshmem.c
@@ -0,0 +1,14 @@
+$NetBSD: patch-hw_misc_ivshmem.c,v 1.1 2016/05/15 01:25:15 ryoon Exp $
+
+--- hw/misc/ivshmem.c.orig	2016-05-11 15:56:09.000000000 +0000
++++ hw/misc/ivshmem.c
+@@ -567,7 +567,9 @@ static void process_msg_connect(IVShmemS
+     vector = peer->nb_eventfds++;
+ 
+     IVSHMEM_DPRINTF("eventfds[%d][%d] = %d\n", posn, vector, fd);
++#if defined(CONFIG_EVENTFD)
+     event_notifier_init_fd(&peer->eventfds[vector], fd);
++#endif
+     fcntl_setfl(fd, O_NONBLOCK); /* msix/irqfd poll non block */
+ 
+     if (posn == s->vm_id) {
diff --git a/qemu-git/patches/patch-hw_net_etraxfs__eth.c b/qemu-git/patches/patch-hw_net_etraxfs__eth.c
new file mode 100644
index 0000000000..834cf8dfb1
--- /dev/null
+++ b/qemu-git/patches/patch-hw_net_etraxfs__eth.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-hw_net_etraxfs__eth.c,v 1.3 2014/01/15 18:26:20 wiz 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) {
diff --git a/qemu-git/patches/patch-hw_net_xilinx__axienet.c b/qemu-git/patches/patch-hw_net_xilinx__axienet.c
new file mode 100644
index 0000000000..af632b972d
--- /dev/null
+++ b/qemu-git/patches/patch-hw_net_xilinx__axienet.c
@@ -0,0 +1,16 @@
+$NetBSD: patch-hw_net_xilinx__axienet.c,v 1.2 2014/01/15 18:26:20 wiz 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;
+     }
diff --git a/qemu-git/patches/patch-hw_ppc_mac__newworld.c b/qemu-git/patches/patch-hw_ppc_mac__newworld.c
new file mode 100644
index 0000000000..d0e33a1292
--- /dev/null
+++ b/qemu-git/patches/patch-hw_ppc_mac__newworld.c
@@ -0,0 +1,38 @@
+$NetBSD: patch-hw_ppc_mac__newworld.c,v 1.3 2016/05/15 01:25:15 ryoon Exp $
+
+Avoid conflicts with round_page() macro in DragonFly's <cpu/param.h>
+
+--- hw/ppc/mac_newworld.c.orig	2016-05-11 15:56:09.000000000 +0000
++++ hw/ppc/mac_newworld.c
+@@ -131,7 +131,7 @@ static uint64_t translate_kernel_address
+     return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR;
+ }
+ 
+-static hwaddr round_page(hwaddr addr)
++static hwaddr round_pageq(hwaddr addr)
+ {
+     return (addr + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;
+ }
+@@ -262,7 +262,7 @@ static void ppc_core99_init(MachineState
+         }
+         /* load initrd */
+         if (initrd_filename) {
+-            initrd_base = round_page(kernel_base + kernel_size + KERNEL_GAP);
++            initrd_base = round_pageq(kernel_base + kernel_size + KERNEL_GAP);
+             initrd_size = load_image_targphys(initrd_filename, initrd_base,
+                                               ram_size - initrd_base);
+             if (initrd_size < 0) {
+@@ -270,11 +270,11 @@ static void ppc_core99_init(MachineState
+                              initrd_filename);
+                 exit(1);
+             }
+-            cmdline_base = round_page(initrd_base + initrd_size);
++            cmdline_base = round_pageq(initrd_base + initrd_size);
+         } else {
+             initrd_base = 0;
+             initrd_size = 0;
+-            cmdline_base = round_page(kernel_base + kernel_size + KERNEL_GAP);
++            cmdline_base = round_pageq(kernel_base + kernel_size + KERNEL_GAP);
+         }
+         ppc_boot_device = 'm';
+     } else {
diff --git a/qemu-git/patches/patch-hw_ppc_mac__oldworld.c b/qemu-git/patches/patch-hw_ppc_mac__oldworld.c
new file mode 100644
index 0000000000..68ee452fa2
--- /dev/null
+++ b/qemu-git/patches/patch-hw_ppc_mac__oldworld.c
@@ -0,0 +1,38 @@
+$NetBSD: patch-hw_ppc_mac__oldworld.c,v 1.3 2016/05/15 01:25:15 ryoon Exp $
+
+Avoid conflicts with round_page() macro in DragonFly's <cpu/param.h>
+
+--- hw/ppc/mac_oldworld.c.orig	2016-05-11 15:56:09.000000000 +0000
++++ hw/ppc/mac_oldworld.c
+@@ -64,7 +64,7 @@ static uint64_t translate_kernel_address
+     return (addr & 0x0fffffff) + KERNEL_LOAD_ADDR;
+ }
+ 
+-static hwaddr round_page(hwaddr addr)
++static hwaddr round_pageq(hwaddr addr)
+ {
+     return (addr + TARGET_PAGE_SIZE - 1) & TARGET_PAGE_MASK;
+ }
+@@ -188,7 +188,7 @@ static void ppc_heathrow_init(MachineSta
+         }
+         /* load initrd */
+         if (initrd_filename) {
+-            initrd_base = round_page(kernel_base + kernel_size + KERNEL_GAP);
++            initrd_base = round_pageq(kernel_base + kernel_size + KERNEL_GAP);
+             initrd_size = load_image_targphys(initrd_filename, initrd_base,
+                                               ram_size - initrd_base);
+             if (initrd_size < 0) {
+@@ -196,11 +196,11 @@ static void ppc_heathrow_init(MachineSta
+                              initrd_filename);
+                 exit(1);
+             }
+-            cmdline_base = round_page(initrd_base + initrd_size);
++            cmdline_base = round_pageq(initrd_base + initrd_size);
+         } else {
+             initrd_base = 0;
+             initrd_size = 0;
+-            cmdline_base = round_page(kernel_base + kernel_size + KERNEL_GAP);
++            cmdline_base = round_pageq(kernel_base + kernel_size + KERNEL_GAP);
+         }
+         ppc_boot_device = 'm';
+     } else {
diff --git a/qemu-git/patches/patch-memory.c b/qemu-git/patches/patch-memory.c
new file mode 100644
index 0000000000..1d4988170f
--- /dev/null
+++ b/qemu-git/patches/patch-memory.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-memory.c,v 1.10 2016/05/15 01:25:15 ryoon Exp $
+
+--- memory.c.orig	2016-05-11 15:56:12.000000000 +0000
++++ memory.c
+@@ -431,7 +431,7 @@ static MemTxResult  memory_region_read_a
+ {
+     uint64_t tmp;
+ 
+-    tmp = mr->ops->read(mr->opaque, addr, size);
++    tmp = (mr->ops->read)(mr->opaque, addr, size);
+     if (mr->subpage) {
+         trace_memory_region_subpage_read(get_cpu_index(), mr, addr, tmp, size);
+     } else if (mr == &io_mem_notdirty) {
diff --git a/qemu-git/patches/patch-scripts_qemu-binfmt-conf.sh b/qemu-git/patches/patch-scripts_qemu-binfmt-conf.sh
new file mode 100644
index 0000000000..977deca0c3
--- /dev/null
+++ b/qemu-git/patches/patch-scripts_qemu-binfmt-conf.sh
@@ -0,0 +1,21 @@
+$NetBSD: patch-scripts_qemu-binfmt-conf.sh,v 1.1 2016/09/04 09:21:04 ryoon Exp $
+
+* POSIX shell portability
+
+--- scripts/qemu-binfmt-conf.sh.orig	2016-09-02 15:34:23.000000000 +0000
++++ scripts/qemu-binfmt-conf.sh
+@@ -279,12 +279,12 @@ while true ; do
+         shift
+         # check given cpu is in the supported CPU list
+         for cpu in ${qemu_target_list} ; do
+-            if [ "$cpu" == "$1" ] ; then
++            if [ "$cpu" = "$1" ] ; then
+                 break
+             fi
+         done
+ 
+-        if [ "$cpu" == "$1" ] ; then
++        if [ "$cpu" = "$1" ] ; then
+             qemu_target_list="$1"
+         else
+             echo "ERROR: unknown CPU \"$1\"" 1>&2
diff --git a/qemu-git/patches/patch-slirp_tcp__subr.c b/qemu-git/patches/patch-slirp_tcp__subr.c
new file mode 100644
index 0000000000..10d714fc16
--- /dev/null
+++ b/qemu-git/patches/patch-slirp_tcp__subr.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-slirp_tcp__subr.c,v 1.7 2016/05/15 01:25:15 ryoon Exp $
+
+--- slirp/tcp_subr.c.orig	2016-05-11 15:56:13.000000000 +0000
++++ slirp/tcp_subr.c
+@@ -407,6 +407,8 @@ int tcp_fconnect(struct socket *so, unsi
+     socket_set_fast_reuse(s);
+     opt = 1;
+     qemu_setsockopt(s, SOL_SOCKET, SO_OOBINLINE, &opt, sizeof(opt));
++    opt = 1;
++    qemu_setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt));
+ 
+     addr = so->fhost.ss;
+     DEBUG_CALL(" connect()ing")
diff --git a/qemu-git/patches/patch-target-i386_bpt__helper.c b/qemu-git/patches/patch-target-i386_bpt__helper.c
new file mode 100644
index 0000000000..b10e1165be
--- /dev/null
+++ b/qemu-git/patches/patch-target-i386_bpt__helper.c
@@ -0,0 +1,31 @@
+$NetBSD: patch-target-i386_bpt__helper.c,v 1.1 2017/03/04 15:11:11 spz Exp $
+
+from upstream:
+ commit c52ab08aee6f7d4717fc6b517174043126bd302f
+ Author: Doug Evans <dje%google.com@localhost>
+ Date:   Tue Dec 6 23:06:30 2016 +0000
+
+     target-i386: Fix eflags.TF/#DB handling of syscall/sysret insns
+
+     The syscall and sysret instructions behave a bit differently:
+     TF is checked after the instruction completes.
+     This allows the o/s to disable #DB at a syscall by adding TF to FMASK.
+     And then when the sysret is executed the #DB is taken "as if" the
+     syscall insn just completed.
+
+--- target-i386/bpt_helper.c.orig	2016-12-20 20:16:49.000000000 +0000
++++ target-i386/bpt_helper.c	2017-03-03 04:30:46.000000000 +0000
+@@ -244,6 +244,13 @@ void helper_single_step(CPUX86State *env
+     raise_exception(env, EXCP01_DB);
+ }
+ 
++void helper_rechecking_single_step(CPUX86State *env)
++{
++    if ((env->eflags & TF_MASK) != 0) {
++        helper_single_step(env);
++    }
++}
++
+ void helper_set_dr(CPUX86State *env, int reg, target_ulong t0)
+ {
+ #ifndef CONFIG_USER_ONLY
diff --git a/qemu-git/patches/patch-target-i386_helper.h b/qemu-git/patches/patch-target-i386_helper.h
new file mode 100644
index 0000000000..9c0396aaa7
--- /dev/null
+++ b/qemu-git/patches/patch-target-i386_helper.h
@@ -0,0 +1,25 @@
+$NetBSD: patch-target-i386_helper.h,v 1.1 2017/03/04 15:11:11 spz Exp $
+
+from upstream:
+ commit c52ab08aee6f7d4717fc6b517174043126bd302f
+ Author: Doug Evans <dje%google.com@localhost>
+ Date:   Tue Dec 6 23:06:30 2016 +0000
+
+     target-i386: Fix eflags.TF/#DB handling of syscall/sysret insns
+
+     The syscall and sysret instructions behave a bit differently:
+     TF is checked after the instruction completes.
+     This allows the o/s to disable #DB at a syscall by adding TF to FMASK.
+     And then when the sysret is executed the #DB is taken "as if" the
+     syscall insn just completed.
+
+--- target-i386/helper.h.orig	2016-12-20 20:16:50.000000000 +0000
++++ target-i386/helper.h	2017-03-03 04:41:00.000000000 +0000
+@@ -79,6 +79,7 @@ DEF_HELPER_2(cmpxchg16b_unlocked, void, 
+ DEF_HELPER_2(cmpxchg16b, void, env, tl)
+ #endif
+ DEF_HELPER_1(single_step, void, env)
++DEF_HELPER_1(rechecking_single_step, void, env)
+ DEF_HELPER_1(cpuid, void, env)
+ DEF_HELPER_1(rdtsc, void, env)
+ DEF_HELPER_1(rdtscp, void, env)
diff --git a/qemu-git/patches/patch-target-i386_translate.c b/qemu-git/patches/patch-target-i386_translate.c
new file mode 100644
index 0000000000..65db0c4018
--- /dev/null
+++ b/qemu-git/patches/patch-target-i386_translate.c
@@ -0,0 +1,93 @@
+$NetBSD: patch-target-i386_translate.c,v 1.1 2017/03/04 15:11:11 spz Exp $
+
+from upstream:
+ commit c52ab08aee6f7d4717fc6b517174043126bd302f
+ Author: Doug Evans <dje%google.com@localhost>
+ Date:   Tue Dec 6 23:06:30 2016 +0000
+
+     target-i386: Fix eflags.TF/#DB handling of syscall/sysret insns
+
+     The syscall and sysret instructions behave a bit differently:
+     TF is checked after the instruction completes.
+     This allows the o/s to disable #DB at a syscall by adding TF to FMASK.
+     And then when the sysret is executed the #DB is taken "as if" the
+     syscall insn just completed.
+
+ commit 410e98146ffde201ab4c778823ac8beaa74c4c3f
+ Author: Doug Evans <dje%google.com@localhost>
+ Date:   Sat Dec 24 20:29:33 2016 +0000
+
+     target/i386: Fix bad patch application to translate.c
+
+     In commit c52ab08aee6f7d4717fc6b517174043126bd302f,
+     the patch snippet for the "syscall" insn got applied to "iret".
+
+--- target-i386/translate.c.orig	2016-12-20 20:16:50.000000000 +0000
++++ target-i386/translate.c	2017-03-03 04:39:24.000000000 +0000
+@@ -2500,8 +2500,10 @@ static void gen_bnd_jmp(DisasContext *s)
+ }
+ 
+ /* Generate an end of block. Trace exception is also generated if needed.
+-   If IIM, set HF_INHIBIT_IRQ_MASK if it isn't already set.  */
+-static void gen_eob_inhibit_irq(DisasContext *s, bool inhibit)
++   If INHIBIT, set HF_INHIBIT_IRQ_MASK if it isn't already set.
++   If RECHECK_TF, emit a rechecking helper for #DB, ignoring the state of
++   S->TF.  This is used by the syscall/sysret insns.  */
++static void gen_eob_worker(DisasContext *s, bool inhibit, bool recheck_tf)
+ {
+     gen_update_cc_op(s);
+ 
+@@ -2517,6 +2519,9 @@ static void gen_eob_inhibit_irq(DisasCon
+     }
+     if (s->singlestep_enabled) {
+         gen_helper_debug(cpu_env);
++   } else if (recheck_tf) {
++        gen_helper_rechecking_single_step(cpu_env);
++        tcg_gen_exit_tb(0);
+     } else if (s->tf) {
+         gen_helper_single_step(cpu_env);
+     } else {
+@@ -2525,10 +2530,17 @@ static void gen_eob_inhibit_irq(DisasCon
+     s->is_jmp = DISAS_TB_JUMP;
+ }
+ 
++/* End of block.
++   If INHIBIT, set HF_INHIBIT_IRQ_MASK if it isn't already set.  */
++static void gen_eob_inhibit_irq(DisasContext *s, bool inhibit)
++{
++    gen_eob_worker(s, inhibit, false);
++}
++
+ /* End of block, resetting the inhibit irq flag.  */
+ static void gen_eob(DisasContext *s)
+ {
+-    gen_eob_inhibit_irq(s, false);
++    gen_eob_worker(s, false, false);
+ }
+ 
+ /* generate a jump to eip. No segment change must happen before as a
+@@ -7104,7 +7116,10 @@ static target_ulong disas_insn(CPUX86Sta
+         gen_update_cc_op(s);
+         gen_jmp_im(pc_start - s->cs_base);
+         gen_helper_syscall(cpu_env, tcg_const_i32(s->pc - pc_start));
+-        gen_eob(s);
++        /* TF handling for the syscall insn is different. The TF bit is  checked
++           after the syscall insn completes. This allows #DB to not be
++           generated after one has entered CPL0 if TF is set in FMASK.  */
++        gen_eob_worker(s, false, true);
+         break;
+     case 0x107: /* sysret */
+         if (!s->pe) {
+@@ -7115,7 +7130,11 @@ static target_ulong disas_insn(CPUX86Sta
+             if (s->lma) {
+                 set_cc_op(s, CC_OP_EFLAGS);
+             }
+-            gen_eob(s);
++            /* TF handling for the sysret insn is different. The TF bit is
++               checked after the sysret insn completes. This allows #DB to be
++               generated "as if" the syscall insn in userspace has just
++               completed.  */
++            gen_eob_worker(s, false, true);
+         }
+         break;
+ #endif
diff --git a/qemu-git/patches/patch-tests_Makefile.include b/qemu-git/patches/patch-tests_Makefile.include
new file mode 100644
index 0000000000..9921005155
--- /dev/null
+++ b/qemu-git/patches/patch-tests_Makefile.include
@@ -0,0 +1,17 @@
+$NetBSD: patch-tests_Makefile.include,v 1.1 2016/09/04 09:21:04 ryoon Exp $
+
+* Don't link -lutil on SunOS
+
+--- tests/Makefile.include.orig	2016-09-02 15:34:24.000000000 +0000
++++ tests/Makefile.include
+@@ -645,8 +645,10 @@ tests/migration/initrd-stress.img: tests
+ 	rmdir $(INITRD_WORK_DIR)
+ 
+ ifeq ($(CONFIG_POSIX),y)
++ifneq ($(CONFIG_SOLARIS),y)
+ LIBS += -lutil
+ endif
++endif
+ 
+ # QTest rules
+ 


Home | Main Index | Thread Index | Old Index