diff options
author | nia <nia@pkgsrc.org> | 2021-06-01 16:28:05 +0000 |
---|---|---|
committer | nia <nia@pkgsrc.org> | 2021-06-01 16:28:05 +0000 |
commit | 042a56414eb6718edbbabd0f2a8944e947e6d031 (patch) | |
tree | 2d2017f55b477a3daafcbff98bb0580d25851081 /emulators/qemu | |
parent | ed9ae60a83205f6a3828a5fd0afbc3e8fcbf6f57 (diff) | |
download | pkgsrc-042a56414eb6718edbbabd0f2a8944e947e6d031.tar.gz |
qemu: Fix build on NetBSD/x86 9.0
Based on an earlier NVMM patch reinoud sent to qemu-devel.
Diffstat (limited to 'emulators/qemu')
-rw-r--r-- | emulators/qemu/distinfo | 4 | ||||
-rw-r--r-- | emulators/qemu/patches/patch-target_i386_nvmm_nvmm-all.c | 16 |
2 files changed, 15 insertions, 5 deletions
diff --git a/emulators/qemu/distinfo b/emulators/qemu/distinfo index 0dff64c70c5..28371cbb9a2 100644 --- a/emulators/qemu/distinfo +++ b/emulators/qemu/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.178 2021/05/24 14:22:08 ryoon Exp $ +$NetBSD: distinfo,v 1.179 2021/06/01 16:28:05 nia Exp $ SHA1 (palcode-clipper-qemu-5.2.0nb8) = ddbf1dffb7c2b2157e0bbe9fb7db7e57105130b1 RMD160 (palcode-clipper-qemu-5.2.0nb8) = 3f9fe19a40f7ca72ecfe047d1449e55b63cba3ee @@ -51,5 +51,5 @@ SHA1 (patch-target_i386_meson.build) = 0b6430825e1f5715f6deea556043b7e5063cf10a SHA1 (patch-target_i386_nvmm_meson.build) = c773fbed28a87f53263ab5299a63ca77423d164f SHA1 (patch-target_i386_nvmm_nvmm-accel-ops.c) = fdc29ccd0fcd47b72e7802655fe92b08f7d22bb9 SHA1 (patch-target_i386_nvmm_nvmm-accel-ops.h) = 74d6442e1ac1cdf187996f3dd82bb3efddc002ec -SHA1 (patch-target_i386_nvmm_nvmm-all.c) = cd75f6a584920093407ec254b9276b056f83132e +SHA1 (patch-target_i386_nvmm_nvmm-all.c) = 6370f1f6336546b24d9c3493cd0b27ca6843f35d SHA1 (patch-target_sparc_translate.c) = 7ec2add2fd808facb48b9a66ccc345599251bf76 diff --git a/emulators/qemu/patches/patch-target_i386_nvmm_nvmm-all.c b/emulators/qemu/patches/patch-target_i386_nvmm_nvmm-all.c index f6e1a446b2a..a0777907542 100644 --- a/emulators/qemu/patches/patch-target_i386_nvmm_nvmm-all.c +++ b/emulators/qemu/patches/patch-target_i386_nvmm_nvmm-all.c @@ -1,8 +1,8 @@ -$NetBSD: patch-target_i386_nvmm_nvmm-all.c,v 1.1 2021/05/24 14:22:08 ryoon Exp $ +$NetBSD: patch-target_i386_nvmm_nvmm-all.c,v 1.2 2021/06/01 16:28:05 nia Exp $ ---- target/i386/nvmm/nvmm-all.c.orig 2021-05-06 05:09:24.911125954 +0000 +--- target/i386/nvmm/nvmm-all.c.orig 2021-06-01 15:07:31.572325819 +0000 +++ target/i386/nvmm/nvmm-all.c -@@ -0,0 +1,1226 @@ +@@ -0,0 +1,1236 @@ +/* + * Copyright (c) 2018-2019 Maxime Villard, All rights reserved. + * @@ -755,7 +755,11 @@ $NetBSD: patch-target_i386_nvmm_nvmm-all.c,v 1.1 2021/05/24 14:22:08 ryoon 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 + } + + /* Read exit_request before the kernel reads the immediate exit flag */ @@ -772,6 +776,7 @@ $NetBSD: patch-target_i386_nvmm_nvmm-all.c,v 1.1 2021/05/24 14:22:08 ryoon Exp $ + switch (exit->reason) { + case NVMM_VCPU_EXIT_NONE: + break; ++#if NVMM_USER_VERSION >= 2 + case NVMM_VCPU_EXIT_STOPPED: + /* + * The kernel cleared the immediate exit flag; cpu->exit_request @@ -780,6 +785,7 @@ $NetBSD: patch-target_i386_nvmm_nvmm-all.c,v 1.1 2021/05/24 14:22:08 ryoon Exp $ + smp_wmb(); + qcpu->stop = true; + break; ++#endif + case NVMM_VCPU_EXIT_MEMORY: + ret = nvmm_handle_mem(mach, vcpu); + break; @@ -893,8 +899,12 @@ $NetBSD: patch-target_i386_nvmm_nvmm-all.c,v 1.1 2021/05/24 14:22:08 ryoon Exp $ +{ + if (current_cpu) { + struct qemu_vcpu *qcpu = get_qemu_vcpu(current_cpu); ++#if NVMM_USER_VERSION >= 2 + struct nvmm_vcpu *vcpu = &qcpu->vcpu; + nvmm_vcpu_stop(vcpu); ++#else ++ qcpu->stop = true; ++#endif + } +} + |