Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102658830
D46196.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
961 B
Referenced Files
None
Subscribers
None
D46196.diff
View Options
diff --git a/usr.sbin/bhyve/gdb.c b/usr.sbin/bhyve/gdb.c
--- a/usr.sbin/bhyve/gdb.c
+++ b/usr.sbin/bhyve/gdb.c
@@ -938,8 +938,28 @@
* executing the first instruction.
*/
if (!CPU_EMPTY(&vcpus_suspended)) {
+ cpuset_t suspended;
+ int error;
+
+ error = vm_debug_cpus(ctx, &suspended);
+ assert(error == 0);
+
CPU_SET(vcpuid, &vcpus_suspended);
_gdb_cpu_suspend(vcpu, false);
+
+ /*
+ * In general, APs are started in a suspended mode such that
+ * they exit with VM_EXITCODE_DEBUG until the BSP starts them.
+ * In particular, this refers to the kernel's view of the vCPU
+ * state rather than our own. If the debugger resumes guest
+ * execution, vCPUs will be unsuspended from the kernel's point
+ * of view, so we should restore the previous state before
+ * continuing.
+ */
+ if (CPU_ISSET(vcpuid, &suspended)) {
+ error = vm_suspend_cpu(vcpu);
+ assert(error == 0);
+ }
}
pthread_mutex_unlock(&gdb_lock);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 11:31 AM (22 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14657961
Default Alt Text
D46196.diff (961 B)
Attached To
Mode
D46196: bhyve: Optionally put vCPUs back in the debug state after resuming
Attached
Detach File
Event Timeline
Log In to Comment