vmm: move bumping VMEXIT_USERSPACE stat to the right place

Statistic for "number of vm exits handled in userspace" should be
increased in vm_run() instead of vmx_run() because in some cases
vm_run() doesn't exit to userspace and keeps entering the guest.

Also svm_run's implementation even wrongly misses that stat.

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35350
This commit is contained in:
Vitaliy Gusev 2022-06-09 08:57:25 -04:00 committed by Mark Johnston
parent 3003117253
commit e7d34aeda4
2 changed files with 1 additions and 3 deletions

View File

@ -3184,9 +3184,6 @@ vmx_run(void *arg, int vcpu, register_t rip, pmap_t pmap,
handled, vmexit->exitcode);
}
if (!handled)
vmm_stat_incr(vm, vcpu, VMEXIT_USERSPACE, 1);
VCPU_CTR1(vm, vcpu, "returning from vmx_run: exitcode %d",
vmexit->exitcode);

View File

@ -1821,6 +1821,7 @@ vm_run(struct vm *vm, struct vm_run *vmrun)
if (error == 0 && retu == false)
goto restart;
vmm_stat_incr(vm, vcpuid, VMEXIT_USERSPACE, 1);
VCPU_CTR2(vm, vcpuid, "retu %d/%d", error, vme->exitcode);
/* copy the exit information */