pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/emulators/qemu Add support for the enhanced NVMM found...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/375abcd2bb46
branches:  trunk
changeset: 449472:375abcd2bb46
user:      reinoud <reinoud%pkgsrc.org@localhost>
date:      Wed Mar 31 08:52:27 2021 +0000

description:
Add support for the enhanced NVMM found in -current

diffstat:

 emulators/qemu/Makefile                             |   4 +-
 emulators/qemu/distinfo                             |   4 +-
 emulators/qemu/patches/patch-target_i386_nvmm_all.c |  26 +++++++++++++++++---
 3 files changed, 26 insertions(+), 8 deletions(-)

diffs (113 lines):

diff -r f0f95c012df4 -r 375abcd2bb46 emulators/qemu/Makefile
--- a/emulators/qemu/Makefile   Wed Mar 31 08:07:12 2021 +0000
+++ b/emulators/qemu/Makefile   Wed Mar 31 08:52:27 2021 +0000
@@ -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 -r f0f95c012df4 -r 375abcd2bb46 emulators/qemu/distinfo
--- a/emulators/qemu/distinfo   Wed Mar 31 08:07:12 2021 +0000
+++ b/emulators/qemu/distinfo   Wed Mar 31 08:52:27 2021 +0000
@@ -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-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 -r f0f95c012df4 -r 375abcd2bb46 emulators/qemu/patches/patch-target_i386_nvmm_all.c
--- a/emulators/qemu/patches/patch-target_i386_nvmm_all.c       Wed Mar 31 08:07:12 2021 +0000
+++ b/emulators/qemu/patches/patch-target_i386_nvmm_all.c       Wed Mar 31 08:52:27 2021 +0000
@@ -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 @@
 +        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 @@
 +        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 @@
 +
 +static Error *nvmm_migration_blocker;
 +
++#if NVMM_USER_VERSION == 1
 +static void
 +nvmm_ipi_signal(int sigcpu)
 +{
@@ -885,10 +895,12 @@
 +        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 @@
 +    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 @@
 +        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;
 +    }



Home | Main Index | Thread Index | Old Index