diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h --- a/sys/amd64/include/vmm.h +++ b/sys/amd64/include/vmm.h @@ -497,6 +497,7 @@ VM_CAP_RDPID, VM_CAP_RDTSCP, VM_CAP_IPI_EXIT, + VM_CAP_MASK_HWINTR, VM_CAP_MAX }; diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c --- a/sys/amd64/vmm/intel/vmx.c +++ b/sys/amd64/vmm/intel/vmx.c @@ -1433,6 +1433,10 @@ uint64_t rflags, entryinfo; uint32_t gi, info; + if (vcpu->cap.set & (1 << VM_CAP_MASK_HWINTR)) { + return; + } + if (vcpu->state.nextrip != guestrip) { gi = vmcs_read(VMCS_GUEST_INTERRUPTIBILITY); if (gi & HWINTR_BLOCKING) { @@ -2640,7 +2644,7 @@ /* * If Virtual NMIs control is 1 and the VM-exit is due to a - * fault encountered during the execution of IRET then we must + * fault encou ntered during the execution of IRET then we must * restore the state of "virtual-NMI blocking" before resuming * the guest. * @@ -3628,6 +3632,9 @@ vlapic = vm_lapic(vcpu->vcpu); vlapic->ipi_exit = val; break; + case VM_CAP_MASK_HWINTR: + retval = 0; + break; default: break; } 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 @@ -801,6 +801,9 @@ if (vs->stepping) { error = vm_set_capability(vcpu, VM_CAP_MTRAP_EXIT, 1); assert(error == 0); + + error = vm_set_capability(vcpu, VM_CAP_MASK_HWINTR, 1); + assert(error == 0); } } @@ -853,6 +856,8 @@ vs->stepping = false; vs->stepped = true; vm_set_capability(vcpu, VM_CAP_MTRAP_EXIT, 0); + vm_set_capability(vcpu, VM_CAP_MASK_HWINTR, 0); + while (vs->stepped) { if (stopped_vcpu == -1) { debug("$vCPU %d reporting step\n", vcpuid);