From 2b8c5d5f8e3949e8060271d612ddfcfbbebb8c34 Mon Sep 17 00:00:00 2001 From: mlarkin Date: Tue, 8 Nov 2022 18:08:43 +0000 Subject: [PATCH] vmm(4): remove locking in vmm_intr_pending Removes a lock around an atomic write; this lock was causing slowdowns since the lock being requested is nearly always unavailable because it is held while the VM is running. Noticed by claudio@, help from mpi@, dlg@ and claudio@. ok dv --- sys/arch/amd64/amd64/vmm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index f6ad02e075c..2defbd045a9 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.326 2022/11/07 12:29:12 dv Exp $ */ +/* $OpenBSD: vmm.c,v 1.327 2022/11/08 18:08:43 mlarkin Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -894,9 +894,7 @@ vm_intr_pending(struct vm_intr_params *vip) goto out; } - rw_enter_write(&vcpu->vc_lock); vcpu->vc_intr = vip->vip_intr; - rw_exit_write(&vcpu->vc_lock); refcnt_rele_wake(&vcpu->vc_refcnt); out: @@ -3526,7 +3524,7 @@ vcpu_reset_regs_vmx(struct vcpu *vcpu, struct vcpu_reg_state *vrs) vmx_setmsrbrw(vcpu, MSR_FSBASE); vmx_setmsrbrw(vcpu, MSR_GSBASE); vmx_setmsrbrw(vcpu, MSR_KERNELGSBASE); - + vmx_setmsrbr(vcpu, MSR_MISC_ENABLE); vmx_setmsrbr(vcpu, MSR_TSC); -- 2.20.1