From nobody Fri Nov 18 18:26:51 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4NDQH44XFgz4d8Mm; Fri, 18 Nov 2022 18:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4NDQH419qcz4JR9; Fri, 18 Nov 2022 18:26:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668796016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4fCjXEJg4dGzYWaOF4mPXTgWdcQdo4xa12VVkE+sSk=; b=ScWyIuj6NCInD3Z2QslamEoRSfXSSDfec/1OnJCNqnq8EUqF7/w73MH2fTcrDBm768v9Xe wBKO+5vDK3T9EVaoq79aWuCbD8CbJdZL5UC0Yi4SQVAlMVSU5PZU8eCth/ktURzC3U9Lr7 KG3y9DsMgBP+9nlmRCxK+rmvcIAyhADdpIqsUJmbKvoTCpkUBstTlyA+7yEb7g7k/GrJBW DmswpyCSoqp7rmMckmPDJ9rvkVm7RJjvoCHCtjwBOtf6xre3gSxHCjfOOmOiPokvHZHeZs yjz4JfO7Pij2qbg3v7IDRPXEoBMOmdEX0m1XGfiAIAVaxNODaYpxQRhyGcoTiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668796016; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=l4fCjXEJg4dGzYWaOF4mPXTgWdcQdo4xa12VVkE+sSk=; b=XOC92m9Nlq2RJC3rTScetNPL/fxHiEaFdBYzGi7OjeoVlE9g/HiaC/5YtJ8qtKhL4zWPnC gbNAaTIXqPBqdJ7MOX2fbzNAlhOkmwKcsP9S2FsQzVqQ5V8h1gWg/dYrBQBk300ORWnNmJ Nlyjh4a8gUK1NmOkYiMFDTJoYsvwPNvSaVyMTZeylH9lbcCTESXw7vbA1wcP4Yb1znDo3U UytgyFpSPJz86DDQj9Rf/RHJV+aQbfDhY/3HHWN1Sq0BU2xGzvTRi1PK7Tt6/XZCHxVANT +3eqoVg3fzDXr7QwqD7OqzBXVIqrUC722J1HOvCqcjAj/J6wuxv1KwNiTKxLWw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668796016; a=rsa-sha256; cv=none; b=GSxojh9GuoZ4+fosSIuF4v/mJYZD3vyi5lzA9uBHOVMBhDP9NwGnlC+HM/Q3O8Rxh845Z2 XIFr2dKOC4a8XtZGyM7LK9RxORDsU4stgBRxeJc1/zDdBFuN55y7K4ynlr/qDEdbQ1Y3th xJ/YHfEx6lgxg0E0qpaqWyj7w2KB6RtgHXYGGQGz5PgzCtUrPP3OTssTWzatCHfUbQ8Nel jvDSKP2Bx/VrdiePxgjPaEQxuANzN8XLx0lB+5XyZkcpmtI0oBZMCc0M/SyNZ0bvmvVW/J BHCu+LhO0Kc4edEjX6yRflOfhgnZNQBobg/PB88Oq3t1rV0cHNzNvJXFC0BMRA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4NDQGz4TSmzGVN; Fri, 18 Nov 2022 18:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2AIIQput030645; Fri, 18 Nov 2022 18:26:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AIIQpuT030644; Fri, 18 Nov 2022 18:26:51 GMT (envelope-from git) Date: Fri, 18 Nov 2022 18:26:51 GMT Message-Id: <202211181826.2AIIQpuT030644@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 08ebb3607647 - main - vmm: Destroy mutexes. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 08ebb360764729632e1f6bc4e3f434abdd708204 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=08ebb360764729632e1f6bc4e3f434abdd708204 commit 08ebb360764729632e1f6bc4e3f434abdd708204 Author: John Baldwin AuthorDate: 2022-11-18 18:04:30 +0000 Commit: John Baldwin CommitDate: 2022-11-18 18:25:38 +0000 vmm: Destroy mutexes. Reviewed by: corvink, markj Differential Revision: https://reviews.freebsd.org/D37171 --- sys/amd64/vmm/io/vatpic.c | 1 + sys/amd64/vmm/io/vatpit.c | 1 + sys/amd64/vmm/io/vhpet.c | 1 + sys/amd64/vmm/io/vioapic.c | 1 + sys/amd64/vmm/io/vlapic.c | 1 + sys/amd64/vmm/io/vrtc.c | 1 + sys/amd64/vmm/vmm.c | 4 ++++ sys/amd64/vmm/vmm_dev.c | 2 +- 8 files changed, 11 insertions(+), 1 deletion(-) diff --git a/sys/amd64/vmm/io/vatpic.c b/sys/amd64/vmm/io/vatpic.c index 5ece5d433244..d959909d7cdc 100644 --- a/sys/amd64/vmm/io/vatpic.c +++ b/sys/amd64/vmm/io/vatpic.c @@ -809,6 +809,7 @@ vatpic_init(struct vm *vm) void vatpic_cleanup(struct vatpic *vatpic) { + mtx_destroy(&vatpic->mtx); free(vatpic, M_VATPIC); } diff --git a/sys/amd64/vmm/io/vatpit.c b/sys/amd64/vmm/io/vatpit.c index 7626b4dc4cc2..c58a6da66c1a 100644 --- a/sys/amd64/vmm/io/vatpit.c +++ b/sys/amd64/vmm/io/vatpit.c @@ -470,6 +470,7 @@ vatpit_cleanup(struct vatpit *vatpit) for (i = 0; i < 3; i++) callout_drain(&vatpit->channel[i].callout); + mtx_destroy(&vatpit->mtx); free(vatpit, M_VATPIT); } diff --git a/sys/amd64/vmm/io/vhpet.c b/sys/amd64/vmm/io/vhpet.c index dd409cde188f..7e73684ebad2 100644 --- a/sys/amd64/vmm/io/vhpet.c +++ b/sys/amd64/vmm/io/vhpet.c @@ -754,6 +754,7 @@ vhpet_cleanup(struct vhpet *vhpet) for (i = 0; i < VHPET_NUM_TIMERS; i++) callout_drain(&vhpet->timer[i].callout); + mtx_destroy(&vhpet->mtx); free(vhpet, M_VHPET); } diff --git a/sys/amd64/vmm/io/vioapic.c b/sys/amd64/vmm/io/vioapic.c index e41b5acac920..00a206fa604d 100644 --- a/sys/amd64/vmm/io/vioapic.c +++ b/sys/amd64/vmm/io/vioapic.c @@ -508,6 +508,7 @@ void vioapic_cleanup(struct vioapic *vioapic) { + mtx_destroy(&vioapic->mtx); free(vioapic, M_VIOAPIC); } diff --git a/sys/amd64/vmm/io/vlapic.c b/sys/amd64/vmm/io/vlapic.c index 9c61726e77d7..1a8b54bba3bf 100644 --- a/sys/amd64/vmm/io/vlapic.c +++ b/sys/amd64/vmm/io/vlapic.c @@ -1641,6 +1641,7 @@ vlapic_cleanup(struct vlapic *vlapic) { callout_drain(&vlapic->callout); + mtx_destroy(&vlapic->timer_mtx); } uint64_t diff --git a/sys/amd64/vmm/io/vrtc.c b/sys/amd64/vmm/io/vrtc.c index d950bd68ad04..9cf70027f3d8 100644 --- a/sys/amd64/vmm/io/vrtc.c +++ b/sys/amd64/vmm/io/vrtc.c @@ -1018,6 +1018,7 @@ vrtc_cleanup(struct vrtc *vrtc) { callout_drain(&vrtc->callout); + mtx_destroy(&vrtc->mtx); free(vrtc, M_VRTC); } diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c index fa6420aab1c2..c8a45c7aa811 100644 --- a/sys/amd64/vmm/vmm.c +++ b/sys/amd64/vmm/vmm.c @@ -128,6 +128,7 @@ struct vcpu { #define vcpu_lock_initialized(v) mtx_initialized(&((v)->mtx)) #define vcpu_lock_init(v) mtx_init(&((v)->mtx), "vcpu lock", 0, MTX_SPIN) +#define vcpu_lock_destroy(v) mtx_destroy(&((v)->mtx)) #define vcpu_lock(v) mtx_lock_spin(&((v)->mtx)) #define vcpu_unlock(v) mtx_unlock_spin(&((v)->mtx)) #define vcpu_assert_locked(v) mtx_assert(&((v)->mtx), MA_OWNED) @@ -320,6 +321,7 @@ vcpu_cleanup(struct vm *vm, int i, bool destroy) if (destroy) { vmm_stat_free(vcpu->stats); fpu_save_area_free(vcpu->guestfpu); + vcpu_lock_destroy(vcpu); } } @@ -606,6 +608,8 @@ vm_cleanup(struct vm *vm, bool destroy) vmmops_vmspace_free(vm->vmspace); vm->vmspace = NULL; + + mtx_destroy(&vm->rendezvous_mtx); } } diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c index a007a25aa9b5..249131b16464 100644 --- a/sys/amd64/vmm/vmm_dev.c +++ b/sys/amd64/vmm/vmm_dev.c @@ -103,6 +103,7 @@ static SLIST_HEAD(, vmmdev_softc) head; static unsigned pr_allow_flag; static struct mtx vmmdev_mtx; +MTX_SYSINIT(vmmdev_mtx, &vmmdev_mtx, "vmm device mutex", MTX_DEF); static MALLOC_DEFINE(M_VMMDEV, "vmmdev", "vmmdev"); @@ -1216,7 +1217,6 @@ SYSCTL_PROC(_hw_vmm, OID_AUTO, create, void vmmdev_init(void) { - mtx_init(&vmmdev_mtx, "vmm device mutex", NULL, MTX_DEF); pr_allow_flag = prison_add_allow(NULL, "vmm", NULL, "Allow use of vmm in a jail."); }