bhyve: Sleep for a short period after VM_EXITCODE_DEBUG exits
As on amd64, APs will repeatedly exit until they are brought online, so this hack helps avoid burning CPU time during guest bootup. Reviewed by: jhb MFC after: 2 weeks Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D46195
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <vmmapi.h>
|
||||
|
||||
@@ -132,6 +133,11 @@ vmexit_debug(struct vmctx *ctx __unused, struct vcpu *vcpu,
|
||||
struct vm_run *vmrun __unused)
|
||||
{
|
||||
gdb_cpu_suspend(vcpu);
|
||||
/*
|
||||
* XXX-MJ sleep for a short period to avoid chewing up the CPU in the
|
||||
* window between activation of the vCPU thread and the STARTUP IPI.
|
||||
*/
|
||||
usleep(1000);
|
||||
return (VMEXIT_CONTINUE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user