mirror of
https://github.com/opnsense/src.git
synced 2026-06-13 02:30:51 -04:00
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:
parent
b4fb947923
commit
2e2b8afa52
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue