git: bb5248944430 - stable/13 - vmm: move bumping VMEXIT_USERSPACE stat to the right place
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 24 Jun 2022 14:41:12 UTC
The branch stable/13 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=bb5248944430a092d338ff4847adf83640effd48
commit bb5248944430a092d338ff4847adf83640effd48
Author: Vitaliy Gusev <gusev.vitaliy@gmail.com>
AuthorDate: 2022-06-09 12:57:25 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-06-24 14:40:48 +0000
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
(cherry picked from commit e7d34aeda4e6fba68343dfcaf5e4aeed83a0ec87)
---
sys/amd64/vmm/intel/vmx.c | 3 ---
sys/amd64/vmm/vmm.c | 1 +
2 files changed, 1 insertion(+), 3 deletions(-)
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 62d9c64847d6..d4e0d2c65650 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -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);
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index f6ed99a6efbf..587a5bfdfa65 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -1821,6 +1821,7 @@ restart:
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 */