NVMM user version 1 is the version being shipped with netbsd-9,
which is the most recent stable branch of NetBSD. This makes it
possible to use the NVMM accelerator on the most recent NetBSD
release, 9.2, which lacks nvmm_cpu_stop.
(CC'ing maintainers)
Signed-off-by: Nia Alarie <nia@NetBSD.org>
Reviewed-by: Kamil Rytarowski <kamil@netbsd.org>
Message-Id: <YWblCe2J8GwCaV9U@homeworld.netbsd.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
endif
endif
if targetos == 'netbsd'
- if cc.has_header_symbol('nvmm.h', 'nvmm_cpu_stop', required: get_option('nvmm'))
- nvmm = cc.find_library('nvmm', required: get_option('nvmm'))
- endif
+ nvmm = cc.find_library('nvmm', required: get_option('nvmm'))
if nvmm.found()
accelerators += 'CONFIG_NVMM'
endif
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 */
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
smp_wmb();
qcpu->stop = true;
break;
+#endif
case NVMM_VCPU_EXIT_MEMORY:
ret = nvmm_handle_mem(mach, vcpu);
break;
{
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
}
}