git: 80764cdb73f5 - main - bhyve: Remove the exitcode stats structure

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Wed, 24 May 2023 01:17:53 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=80764cdb73f5476b695afc1bbabc3eccf55a26c5

commit 80764cdb73f5476b695afc1bbabc3eccf55a26c5
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-05-24 01:14:36 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-05-24 01:17:02 +0000

    bhyve: Remove the exitcode stats structure
    
    This structure isn't used for anything, and only counts a subset of
    vmexit types.  Moreover, it is not accurate since there is no
    synchronization between vcpu threads.  Simply remove it.
    
    No functional change intended.
    
    Reviewed by:    jhb
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D40245
---
 usr.sbin/bhyve/bhyverun.c | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
index 7be97ecedfdc..ef5968ba6385 100644
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -198,17 +198,6 @@ static cpuset_t cpumask;
 
 static void vm_loop(struct vmctx *ctx, struct vcpu *vcpu);
 
-static struct bhyvestats {
-	uint64_t	vmexit_bogus;
-	uint64_t	vmexit_reqidle;
-	uint64_t	vmexit_hlt;
-	uint64_t	vmexit_pause;
-	uint64_t	vmexit_mtrap;
-	uint64_t	vmexit_inst_emul;
-	uint64_t	cpu_switch_rotate;
-	uint64_t	cpu_switch_direct;
-} stats;
-
 static struct vcpu_info {
 	struct vmctx	*ctx;
 	struct vcpu	*vcpu;
@@ -753,8 +742,6 @@ vmexit_bogus(struct vmctx *ctx __unused, struct vcpu *vcpu __unused,
 {
 	assert(vmrun->vm_exit->inst_length == 0);
 
-	stats.vmexit_bogus++;
-
 	return (VMEXIT_CONTINUE);
 }
 
@@ -764,8 +751,6 @@ vmexit_reqidle(struct vmctx *ctx __unused, struct vcpu *vcpu __unused,
 {
 	assert(vmrun->vm_exit->inst_length == 0);
 
-	stats.vmexit_reqidle++;
-
 	return (VMEXIT_CONTINUE);
 }
 
@@ -773,8 +758,6 @@ static int
 vmexit_hlt(struct vmctx *ctx __unused, struct vcpu *vcpu __unused,
     struct vm_run *vmrun __unused)
 {
-	stats.vmexit_hlt++;
-
 	/*
 	 * Just continue execution with the next instruction. We use
 	 * the HLT VM exit as a way to be friendly with the host
@@ -787,8 +770,6 @@ static int
 vmexit_pause(struct vmctx *ctx __unused, struct vcpu *vcpu __unused,
     struct vm_run *vmrun __unused)
 {
-	stats.vmexit_pause++;
-
 	return (VMEXIT_CONTINUE);
 }
 
@@ -798,8 +779,6 @@ vmexit_mtrap(struct vmctx *ctx __unused, struct vcpu *vcpu,
 {
 	assert(vmrun->vm_exit->inst_length == 0);
 
-	stats.vmexit_mtrap++;
-
 #ifdef BHYVE_SNAPSHOT
 	checkpoint_cpu_suspend(vcpu_id(vcpu));
 #endif
@@ -822,8 +801,6 @@ vmexit_inst_emul(struct vmctx *ctx __unused, struct vcpu *vcpu,
 
 	vme = vmrun->vm_exit;
 
-	stats.vmexit_inst_emul++;
-
 	vie = &vme->u.inst_emul.vie;
 	if (!vie->decoded) {
 		/*