From nobody Fri Sep 16 20:33:57 2022 X-Original-To: dev-commits-src-main@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 4MTm4k15XNz4bv98; Fri, 16 Sep 2022 20:33:58 +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 4MTm4k0WMXz3WQC; Fri, 16 Sep 2022 20:33:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663360438; 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=VckQuhaDIGYQvnU4u4ZsBZ+wh3LXftqCc/TwPkwVmVs=; b=tzRVPjDdrYchvypMQxnw8xUgkYpssvQD66OqAErj4mfYvlT7Hb2G1IvjvJBFBgfZkZ+YK3 f90AOvWrvQjq7++94OgruRbeiZ6Ak+UFHAITw/jxT2QImlQawR8eDAzK8h87H+mpfVzlB3 YFqLB5PpbCad9vPQwSzxIo0K532rgeDrTlFfI/yMHGKHdpX9upArJa+4ltCUOznzi49uMG PeHWy9k7uNsamGl21N62UOup5lveUiroiWuxWWb7w6R9DNX7p0rtrt/hQD8tuq+vKemlhZ G9eCIYTf+us4/VmJyPs3sH9/srHm2vXaCeTmWXoZhkvEe9Hl1gxTw6AGrHTckQ== 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 4MTm4j6fNjzT9g; Fri, 16 Sep 2022 20:33:57 +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 28GKXv0N038530; Fri, 16 Sep 2022 20:33:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28GKXva4038529; Fri, 16 Sep 2022 20:33:57 GMT (envelope-from git) Date: Fri, 16 Sep 2022 20:33:57 GMT Message-Id: <202209162033.28GKXva4038529@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 87cd087a4ae7 - main - iommu_gas: don't remove and insert boundary entry List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 87cd087a4ae7b272986ce3bcf27ffe4930f15e55 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1663360438; 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=VckQuhaDIGYQvnU4u4ZsBZ+wh3LXftqCc/TwPkwVmVs=; b=voOspN1w2SrsQNsK43j/9UfCM/C/iBfnSivjtzl34PjfGNReFHJ0DWfCrJ73P3BmTwR3K6 XWhvXyAolxX85zLILRiWIe0zZfDml62U4J/to1AfGoGhxJ+UWk8CsCznpcMnKRku+dmpmR iiBlVCvqv+TiKHuC72TZQt3l90mdRzV156Ild5P2goga89uyuE+tVUm5Ecz3gs+K1VRru6 3i3lAZpRXcuToGlwWo+lBRT+qvm9++luqdOAFjjsgrolIi/DNJlVI8Vx/ezV4t05SC1BeA XgBmKkpKj2mZRoVViwuZQ2MOVoviimJc26NboxeoLiyIn5H4j2tYnBYci93s/Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1663360438; a=rsa-sha256; cv=none; b=qCXsqt/tAaQIZP4x4wJw/T3ZMlcVh0xg8ulovUhCw1WIJnDJrZCivnwtVYxHv3pEVO5YI0 Z8YjpfU2XWG+/RCUZK2mkN8r8QebYA6i1XCtGSb39RTWVJaM5ppFmL44d1kJgFgpkAL0vD 38h1ud3rQQ5dCR+hgrIGCkLVIoiU0mApX0TgDNxMkCOCm9DyQIQJqOfMzCJ48nV8AtIpx3 wW5XxaLD5CJbY5k0rV9P//05R6T0B7F0JmzM7kONrdKwHaMC2UzML4rB4eYrMjVJNQMZli EIhMlge0qhPpbrfh1uQCgJDRg5IZC3NQuDb/CDYDbfpKbTK417GpPqbyGeruKA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=87cd087a4ae7b272986ce3bcf27ffe4930f15e55 commit 87cd087a4ae7b272986ce3bcf27ffe4930f15e55 Author: Doug Moore AuthorDate: 2022-09-16 20:32:11 +0000 Commit: Doug Moore CommitDate: 2022-09-16 20:32:11 +0000 iommu_gas: don't remove and insert boundary entry Avoid removing an item in iommu_gas_free_region only to reinsert it, by avoiding removing an entry that is either first_place or last_place. Reviewed by: kib MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D36597 --- sys/dev/iommu/iommu_gas.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/sys/dev/iommu/iommu_gas.c b/sys/dev/iommu/iommu_gas.c index ca5a614060fe..68e22f16c69f 100644 --- a/sys/dev/iommu/iommu_gas.c +++ b/sys/dev/iommu/iommu_gas.c @@ -580,7 +580,6 @@ void iommu_gas_free_region(struct iommu_map_entry *entry) { struct iommu_domain *domain; - struct iommu_map_entry *next, *prev; domain = entry->domain; KASSERT((entry->flags & (IOMMU_MAP_ENTRY_PLACE | IOMMU_MAP_ENTRY_RMRR | @@ -588,15 +587,10 @@ iommu_gas_free_region(struct iommu_map_entry *entry) ("non-RMRR entry %p %p", domain, entry)); IOMMU_DOMAIN_LOCK(domain); - prev = RB_PREV(iommu_gas_entries_tree, &domain->rb_root, entry); - next = RB_NEXT(iommu_gas_entries_tree, &domain->rb_root, entry); - iommu_gas_rb_remove(domain, entry); + if (entry != domain->first_place && + entry != domain->last_place) + iommu_gas_rb_remove(domain, entry); entry->flags &= ~IOMMU_MAP_ENTRY_RMRR; - - if (prev == NULL) - iommu_gas_rb_insert(domain, domain->first_place); - if (next == NULL) - iommu_gas_rb_insert(domain, domain->last_place); IOMMU_DOMAIN_UNLOCK(domain); } @@ -608,7 +602,7 @@ iommu_gas_remove_clip_left(struct iommu_domain *domain, iommu_gaddr_t start, IOMMU_DOMAIN_ASSERT_LOCKED(domain); MPASS(start <= end); - MPASS(end <= domain->last_place->end); + MPASS(end <= domain->end); /* * Find an entry which contains the supplied guest's address