From nobody Thu Mar 16 16:46:07 2023 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 4PctSH6GhJz3yKVV; Thu, 16 Mar 2023 16:46:07 +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 4PctSH31Grz3mq0; Thu, 16 Mar 2023 16:46:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985167; 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=PlsKz+O1CGUxl9EJ/4PTPOlV1mmb3HV07DrLU0gPniM=; b=C8jIiFQMUpI2+uvEu8W0UJ0ZLqzVnAP09iQD26ZOwv0qVybqd1X6IpeLpq12P0cQL9Owf9 8oKZCGsIPnaqjaSOBYdRbi3dzRdlpjxLAyCa5Eew3jkD8mF2mNnYclbltebAavlzyrplix 5NAy3wpQss9EkHiPqePNALZ8lScxtQpbKqBzF6ZJSU4GdSSXfWvvp1U3QKLNz64cWiewxb VcpJ5VkxsFbYF5Qi7edazb4zhq/vHOEurROo+/aJZxtPlOIEYTV/4ei1HVf0vQTnsnNeF+ Xd8S/Ln5fgFBnsN800C+9VwK6tYgHgFXd0BHFF22OogZThL9JQXE3ThNjzs9kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1678985167; 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=PlsKz+O1CGUxl9EJ/4PTPOlV1mmb3HV07DrLU0gPniM=; b=cAkrv8qLmpb6B7Zdhqxx7jtm0gq/ii3hoo+DU3Cvgpl5CmbY0GhSMlqGZcZewgakR9hfdu cI/98sNo00dk9UulESn2AVBhB4tUfS1kWPPshgzDPF90XClIU/hZTZa0PKLFz3MkG08rWK +q1A1QmLt0Yq2EETMVlKTsFRuYE+W73vLnYwJq2joer//5e2zNZEMcoZrubuBSrQDgbsqO muUihXlW1VM7YJqcXJ0uBC6ratqtYLe1h5cDV/o2s66zMkXCIu3OKnK3maVaqZKl1Gvjbb is88cISZ7SRYvgFvupMVEBKqD2c1jPGLi8k+2jl1nm+QvZwwXEVqnxCBceYH+w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1678985167; a=rsa-sha256; cv=none; b=T2KqHI7diCE0ipXqu8wtThFXR+g/KGK1UAqgaNESVTus2W0uSl+vg9p/FhrWyMNyWJ5edh BumQgxtBhtgDCkMtlmBzFWL/Wee8dj0+HJGy5LIcC5r6zW4aMkP9fR4hVKlfQt/hx6PveQ wFlwjKJUHqwDRjx97+qpjbPw+xRR+DeEuldSUDDFnBxuZNvw5JqW24dK6zGoP4+i79MAJD 3LHBTxE3apllIMLLbIzPDvT1oTFWpUA/ZgP8i486lt6TtD8gUj+xWQo3eqdu6V6700Cerm 2FPAJp+skuidyjNapbAkipBuP7fPzxxxMb3Qcq/Z1dN6i7t3bCbHP5QAwAQOFQ== 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 4PctSH1l0wzqmW; Thu, 16 Mar 2023 16:46:07 +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 32GGk7WF022190; Thu, 16 Mar 2023 16:46:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32GGk7FW022189; Thu, 16 Mar 2023 16:46:07 GMT (envelope-from git) Date: Thu, 16 Mar 2023 16:46:07 GMT Message-Id: <202303161646.32GGk7FW022189@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 5f2070adb943 - main - Only support a 4 level smmu page table 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: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5f2070adb943b64a286e140f3ebd00da43001845 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=5f2070adb943b64a286e140f3ebd00da43001845 commit 5f2070adb943b64a286e140f3ebd00da43001845 Author: Andrew Turner AuthorDate: 2023-03-16 15:34:54 +0000 Commit: Andrew Turner CommitDate: 2023-03-16 16:45:42 +0000 Only support a 4 level smmu page table We only ever build a 4 level page table for the Arm SMMU. Remove the support for a 3 level table. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38949 --- sys/arm64/iommu/iommu_pmap.c | 43 +++---------------------------------------- 1 file changed, 3 insertions(+), 40 deletions(-) diff --git a/sys/arm64/iommu/iommu_pmap.c b/sys/arm64/iommu/iommu_pmap.c index 80a0515a0c2c..acef3d8d3368 100644 --- a/sys/arm64/iommu/iommu_pmap.c +++ b/sys/arm64/iommu/iommu_pmap.c @@ -388,8 +388,8 @@ _smmu_pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t m, smmu_pmap_add_delayed_free_list(m, free, TRUE); } -static int -smmu_pmap_pinit_levels(pmap_t pmap, int levels) +int +smmu_pmap_pinit(pmap_t pmap) { vm_page_t m; @@ -404,31 +404,12 @@ smmu_pmap_pinit_levels(pmap_t pmap, int levels) vm_radix_init(&pmap->pm_root); bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); - MPASS(levels == 3 || levels == 4); - pmap->pm_levels = levels; - - /* - * Allocate the level 1 entry to use as the root. This will increase - * the refcount on the level 1 page so it won't be removed until - * pmap_release() is called. - */ - if (pmap->pm_levels == 3) { - PMAP_LOCK(pmap); - m = _pmap_alloc_l3(pmap, NUL2E + NUL1E); - PMAP_UNLOCK(pmap); - } + pmap->pm_levels = 4; pmap->pm_ttbr = VM_PAGE_TO_PHYS(m); return (1); } -int -smmu_pmap_pinit(pmap_t pmap) -{ - - return (smmu_pmap_pinit_levels(pmap, 4)); -} - /* * This routine is called if the desired page table page does not exist. * @@ -567,26 +548,8 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex) void smmu_pmap_release(pmap_t pmap) { - boolean_t rv __diagused; - struct spglist free; vm_page_t m; - if (pmap->pm_levels != 4) { - KASSERT(pmap->pm_stats.resident_count == 1, - ("pmap_release: pmap resident count %ld != 0", - pmap->pm_stats.resident_count)); - KASSERT((pmap->pm_l0[0] & ATTR_DESCR_VALID) == ATTR_DESCR_VALID, - ("pmap_release: Invalid l0 entry: %lx", pmap->pm_l0[0])); - - SLIST_INIT(&free); - m = PHYS_TO_VM_PAGE(pmap->pm_ttbr); - PMAP_LOCK(pmap); - rv = smmu_pmap_unwire_l3(pmap, 0, m, &free); - PMAP_UNLOCK(pmap); - MPASS(rv == TRUE); - vm_page_free_pages_toq(&free, true); - } - KASSERT(pmap->pm_stats.resident_count == 0, ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count));