From ac5b473501b14817a3a8b258d039920182d77529 Mon Sep 17 00:00:00 2001 From: dlg Date: Tue, 8 Nov 2022 19:38:34 +0000 Subject: [PATCH] don't keep track of how many vcpus are currently running. the number is never read anywhere, and i'm not sure what value that number has anyway. mlarkin@ agrees --- sys/arch/amd64/amd64/vmm.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index 5ef771bbe52..d47918b439f 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.328 2022/11/08 19:18:47 dlg Exp $ */ +/* $OpenBSD: vmm.c,v 1.329 2022/11/08 19:38:34 dlg Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -95,7 +95,6 @@ struct vm { struct vcpu_head vm_vcpu_list; /* [v] */ uint32_t vm_vcpu_ct; /* [v] */ - u_int vm_vcpus_running; /* [a] */ struct rwlock vm_vcpu_lock; SLIST_ENTRY(vm) vm_link; /* [V] */ @@ -1778,7 +1777,6 @@ vm_create(struct vm_create_params *vcp, struct proc *p) } vm->vm_vcpu_ct = 0; - vm->vm_vcpus_running = 0; /* Initialize each VCPU defined in 'vcp' */ for (i = 0; i < vcp->vcp_ncpus; i++) { @@ -4547,7 +4545,6 @@ vm_run(struct vm_run_params *vrp) ret = EBUSY; goto out_unlock; } - atomic_inc_int(&vm->vm_vcpus_running); /* * We may be returning from userland helping us from the last exit. @@ -4574,7 +4571,6 @@ vm_run(struct vm_run_params *vrp) } WRITE_ONCE(vcpu->vc_curcpu, NULL); - atomic_dec_int(&vm->vm_vcpus_running); if (ret == 0 || ret == EAGAIN) { /* If we are exiting, populate exit data so vmd can help. */ vrp->vrp_exit_reason = (ret == 0) ? VM_EXIT_NONE -- 2.20.1