summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorHans Rosenfeld <hans.rosenfeld@joyent.com>2018-12-05 22:47:24 +0000
committerHans Rosenfeld <hans.rosenfeld@joyent.com>2018-12-05 23:00:12 +0000
commitb3bd764962b86d7c9b6cb4939d04a3bde0ca6519 (patch)
tree92ee9268ad92da94b68c66aea38e1abf566334e2 /usr/src
parent4966850cbd32c33aeed41ff4610b6ac82c195962 (diff)
downloadillumos-joyent-release-20181206.tar.gz
OS-7401 bhyve: suspend vcpu after mtrap vmexitrelease-20181206
Reviewed by: Patrick Mooney <patrick.mooney@joyent.com> Reviewed by: John Levon <john.levon@joyent.com> Approved by: John Levon <john.levon@joyent.com>
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/bhyve/gdb.c4
-rw-r--r--usr/src/uts/i86pc/io/vmm/vmm.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/usr/src/cmd/bhyve/gdb.c b/usr/src/cmd/bhyve/gdb.c
index 4414a05e27..8f464816f0 100644
--- a/usr/src/cmd/bhyve/gdb.c
+++ b/usr/src/cmd/bhyve/gdb.c
@@ -76,7 +76,11 @@ static cpuset_t vcpus_active, vcpus_suspended, vcpus_waiting;
static pthread_mutex_t gdb_lock;
static pthread_cond_t idle_vcpus;
static bool stop_pending, first_stop;
+#ifdef __FreeBSD__
static int stepping_vcpu, stopped_vcpu;
+#else
+static int stepping_vcpu = -1, stopped_vcpu = -1;
+#endif
/*
* An I/O buffer contains 'capacity' bytes of room at 'data'. For a
diff --git a/usr/src/uts/i86pc/io/vmm/vmm.c b/usr/src/uts/i86pc/io/vmm/vmm.c
index 9a4bbad9c1..14e2fc4e60 100644
--- a/usr/src/uts/i86pc/io/vmm/vmm.c
+++ b/usr/src/uts/i86pc/io/vmm/vmm.c
@@ -2205,6 +2205,10 @@ restart:
break;
}
+ case VM_EXITCODE_MTRAP:
+ vm_suspend_cpu(vm, vcpuid);
+ retu = true;
+ break;
#endif
default:
retu = true; /* handled in userland */