summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorreinoud <reinoud@pkgsrc.org>2021-03-31 08:52:27 +0000
committerreinoud <reinoud@pkgsrc.org>2021-03-31 08:52:27 +0000
commit50fa6488fda4c305fb545444d46b105dfb9934e2 (patch)
treee6cf607b75ec46808ecc7fa9c14a181948a1dfec /emulators
parent342d115e4ab49cb363a85de30c2a198a78aec224 (diff)
downloadpkgsrc-50fa6488fda4c305fb545444d46b105dfb9934e2.tar.gz
Add support for the enhanced NVMM found in -current
Diffstat (limited to 'emulators')
-rw-r--r--emulators/qemu/Makefile4
-rw-r--r--emulators/qemu/distinfo4
-rw-r--r--emulators/qemu/patches/patch-target_i386_nvmm_all.c26
3 files changed, 26 insertions, 8 deletions
diff --git a/emulators/qemu/Makefile b/emulators/qemu/Makefile
index e8fe2ae4910..d513760c182 100644
--- a/emulators/qemu/Makefile
+++ b/emulators/qemu/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.268 2021/03/19 13:24:15 reinoud Exp $
+# $NetBSD: Makefile,v 1.269 2021/03/31 08:52:27 reinoud Exp $
DISTNAME= qemu-5.2.0
-PKGREVISION= 4
+PKGREVISION= 5
CATEGORIES= emulators
MASTER_SITES= https://download.qemu.org/
EXTRACT_SUFX= .tar.xz
diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo
index 28392cb6e78..32762f89d64 100644
--- a/emulators/qemu/distinfo
+++ b/emulators/qemu/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.175 2021/03/19 13:25:36 reinoud Exp $
+$NetBSD: distinfo,v 1.176 2021/03/31 08:52:27 reinoud Exp $
SHA1 (palcode-clipper) = e25ae10a10e0801e47b62b9ee2d10c8ccb4ee940
RMD160 (palcode-clipper) = a637f1cc38dabfdff36e3f02b6dd02d7c63cb8db
@@ -49,7 +49,7 @@ SHA1 (patch-roms_u-boot_tools_imx8m__image.sh) = e4c452062f40569e33aa93eec4a65bd
SHA1 (patch-target_i386_helper.c) = 3314e65df11492438af2ec2c53ed3082a0b62b09
SHA1 (patch-target_i386_kvm-stub.c) = 4cd2b7a8d8d8a317829f982b5acff7fdf2479d9f
SHA1 (patch-target_i386_meson.build) = d0e0d7d4dd96ea43fc386e7166bbabbd71b0f4fc
-SHA1 (patch-target_i386_nvmm_all.c) = dd22747aa0b94bc371303fc865d523d3623ec043
+SHA1 (patch-target_i386_nvmm_all.c) = 9a6d85eb650b260dc33d63caee4bcd0e1f4cb49c
SHA1 (patch-target_i386_nvmm_cpus.c) = 7f028bf2637fe31d8524f710a9e508c8ce65c822
SHA1 (patch-target_i386_nvmm_cpus.h) = 0a25e49929cb772fc46a4ace91127ccf3605521d
SHA1 (patch-target_sparc_translate.c) = 7ec2add2fd808facb48b9a66ccc345599251bf76
diff --git a/emulators/qemu/patches/patch-target_i386_nvmm_all.c b/emulators/qemu/patches/patch-target_i386_nvmm_all.c
index e00ff0ff5d2..b674626fed8 100644
--- a/emulators/qemu/patches/patch-target_i386_nvmm_all.c
+++ b/emulators/qemu/patches/patch-target_i386_nvmm_all.c
@@ -1,8 +1,8 @@
-$NetBSD: patch-target_i386_nvmm_all.c,v 1.1 2021/03/06 11:19:34 reinoud Exp $
+$NetBSD: patch-target_i386_nvmm_all.c,v 1.2 2021/03/31 08:52:27 reinoud Exp $
---- target/i386/nvmm-all.c.orig 2021-03-05 20:20:34.189784289 +0000
+--- target/i386/nvmm-all.c.orig 2021-03-29 12:28:50.237420268 +0000
+++ target/i386/nvmm-all.c
-@@ -0,0 +1,1216 @@
+@@ -0,0 +1,1234 @@
+/*
+ * Copyright (c) 2018-2019 Maxime Villard, All rights reserved.
+ *
@@ -756,7 +756,11 @@ $NetBSD: patch-target_i386_nvmm_all.c,v 1.1 2021/03/06 11:19:34 reinoud Exp $
+ nvmm_vcpu_pre_run(cpu);
+
+ if (qatomic_read(&cpu->exit_request)) {
++#if NVMM_USER_VERSION >= 2
++ nvmm_vcpu_stop(vcpu);
++#else
+ qemu_cpu_kick_self();
++#endif
+ }
+
+ ret = nvmm_vcpu_run(mach, vcpu);
@@ -771,6 +775,11 @@ $NetBSD: patch-target_i386_nvmm_all.c,v 1.1 2021/03/06 11:19:34 reinoud Exp $
+ switch (exit->reason) {
+ case NVMM_VCPU_EXIT_NONE:
+ break;
++#if NVMM_USER_VERSION >= 2
++ case NVMM_VCPU_EXIT_STOPPED:
++ qcpu->stop = true;
++ break;
++#endif
+ case NVMM_VCPU_EXIT_MEMORY:
+ ret = nvmm_handle_mem(mach, vcpu);
+ break;
@@ -875,6 +884,7 @@ $NetBSD: patch-target_i386_nvmm_all.c,v 1.1 2021/03/06 11:19:34 reinoud Exp $
+
+static Error *nvmm_migration_blocker;
+
++#if NVMM_USER_VERSION == 1
+static void
+nvmm_ipi_signal(int sigcpu)
+{
@@ -885,10 +895,12 @@ $NetBSD: patch-target_i386_nvmm_all.c,v 1.1 2021/03/06 11:19:34 reinoud Exp $
+ qcpu->stop = true;
+ }
+}
++#endif
+
+static void
+nvmm_init_cpu_signals(void)
+{
++#if NVMM_USER_VERSION == 1
+ struct sigaction sigact;
+ sigset_t set;
+
@@ -901,6 +913,12 @@ $NetBSD: patch-target_i386_nvmm_all.c,v 1.1 2021/03/06 11:19:34 reinoud Exp $
+ sigprocmask(SIG_BLOCK, NULL, &set);
+ sigdelset(&set, SIG_IPI);
+ pthread_sigmask(SIG_SETMASK, &set, NULL);
++#else
++ /*
++ * We use the nvmm_vcpu_stop() mechanism, and don't use signals.
++ * Nothing to do.
++ */
++#endif
+}
+
+int
@@ -1166,7 +1184,7 @@ $NetBSD: patch-target_i386_nvmm_all.c,v 1.1 2021/03/06 11:19:34 reinoud Exp $
+ error_report("NVMM: Unable to fetch capability, error=%d", errno);
+ return -err;
+ }
-+ if (qemu_mach.cap.version != 1) {
++ if (qemu_mach.cap.version < NVMM_KERN_VERSION) {
+ error_report("NVMM: Unsupported version %u", qemu_mach.cap.version);
+ return -EPROGMISMATCH;
+ }