From nobody Mon Sep 26 13:03:28 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 4MbjcJ55xhz4WWQF; Mon, 26 Sep 2022 13:03:28 +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 4MbjcJ46fZz3mLP; Mon, 26 Sep 2022 13:03:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664197408; 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=GLCsq5e04DsdzBNvFV1Svs8iYRdrB49yLQf6fmEKsDw=; b=HznyHdVyH4ZaDbOPzUGlEhxM77SuVFaAoyjlvrB1KmB6YgfbX0D2C/wpqgLsyK6ElAEzb5 tEJbair3NWTfdH0c6+UAvaLyqbxH1LGQ96xD3OU19HAwfCAeGdKtU6Io4T0Xa6HaTJhWkg i/++Jo4projyZN+3E4wgIc/z0wYJZdsiS9BfB0NQzhe5ADzl6T+9QVHkWujNXCu+J5NPFj 4iZPqP52d+OHfwqJQ63h5phV13PfUwEVkTiHu1EQ13PVOcFtUVOApXzx91Nf145ndJv088 BYpbjdMrgnymVmvsELXHHDG/NwvNvBCl4zMDb2GHYryrQFiUu7vZ4+TCrYzDXg== 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 4MbjcJ38Lpzml8; Mon, 26 Sep 2022 13:03:28 +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 28QD3S3J059180; Mon, 26 Sep 2022 13:03:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28QD3SK7059179; Mon, 26 Sep 2022 13:03:28 GMT (envelope-from git) Date: Mon, 26 Sep 2022 13:03:28 GMT Message-Id: <202209261303.28QD3SK7059179@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 7533062ae133 - main - arm64: Handle 1GB mappings in pmap_enter_quick_locked() 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7533062ae133a0e6e8f5b9913565bb99eabacb5f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664197408; 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=GLCsq5e04DsdzBNvFV1Svs8iYRdrB49yLQf6fmEKsDw=; b=SgJic2vziROBtDbU6LVu2mW9SBf66F+eihTbkr3DZ0HZShP8l0/n2I4XOP64xby+Hj1IHQ oeJeJ66I+xYlqGjo6/0smIcj0+f2nxntstRXj3lD/yLYb9Y2pAhCp/lUZRWlx2L+4g08MQ caHtj9kJQjLGFKO67Axf/rfBPkhL8mKuxJd35EAgRpnPuXYm2YkqQvILlvXOG14iOYk7eO D71680EL6vmTTr3bkVYh8DMjuGvi3qEpD25WnLoWD74sC/ei31cN1yVtNe/FHTs9+zFtaW jz5ubB5+95GypQEwiHfAfFsOYm2ZJcvMEIifZO8DNhHZyFTd3eBBAuVIHfoE1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664197408; a=rsa-sha256; cv=none; b=w2vc4oH54f5OwvepEUC/bmPT7EprwSO6GVcTlCqDHqEIoNB+jYIAaOyGR07Be5idTpmdDU xvgTwhg6pqxt01HdTzTQCxlGI8hduPQWch/cHWgf2OWzdyDDjluIULOBif4+iCMnRLImxH 5w8cRO8QqYZ60VlNERMZCp494dlKdlgRAsu9IdyvYVmjzYzQvYopH0j7vbHKlh3Q8m3mUD l8CjfqxfolFr3M2QA8iOvD7516i7lbLFWwrbyjgJ6M4NmxTMgGLsIdV6/Aq+cndXQFx7aB IAD8u5n5IQXj+uoEoC7bR0rY3R2+5culmPHy5gpoysOXJcHY0LGjDenXpPLTzg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=7533062ae133a0e6e8f5b9913565bb99eabacb5f commit 7533062ae133a0e6e8f5b9913565bb99eabacb5f Author: Mark Johnston AuthorDate: 2022-09-26 12:54:35 +0000 Commit: Mark Johnston CommitDate: 2022-09-26 12:54:35 +0000 arm64: Handle 1GB mappings in pmap_enter_quick_locked() Reviewed by: alc, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36697 --- sys/arm64/arm64/pmap.c | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c index a4acb6a61600..32cf3dd7636c 100644 --- a/sys/arm64/arm64/pmap.c +++ b/sys/arm64/arm64/pmap.c @@ -4555,7 +4555,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp) { pd_entry_t *pde; - pt_entry_t *l2, *l3, l3_val; + pt_entry_t *l1, *l2, *l3, l3_val; vm_paddr_t pa; int lvl; @@ -4582,32 +4582,34 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, if (mpte && (mpte->pindex == l2pindex)) { mpte->ref_count++; } else { - /* - * Get the l2 entry - */ - pde = pmap_pde(pmap, va, &lvl); - /* * If the page table page is mapped, we just increment * the hold count, and activate it. Otherwise, we - * attempt to allocate a page table page. If this - * attempt fails, we don't retry. Instead, we give up. + * attempt to allocate a page table page, passing NULL + * instead of the PV list lock pointer because we don't + * intend to sleep. If this attempt fails, we don't + * retry. Instead, we give up. */ - if (lvl == 1) { - l2 = pmap_l1_to_l2(pde, va); - if ((pmap_load(l2) & ATTR_DESCR_MASK) == - L2_BLOCK) + l1 = pmap_l1(pmap, va); + if (l1 != NULL && pmap_load(l1) != 0) { + if ((pmap_load(l1) & ATTR_DESCR_MASK) == + L1_BLOCK) return (NULL); - } - if (lvl == 2 && pmap_load(pde) != 0) { - mpte = - PHYS_TO_VM_PAGE(pmap_load(pde) & ~ATTR_MASK); - mpte->ref_count++; + l2 = pmap_l1_to_l2(l1, va); + if (pmap_load(l2) != 0) { + if ((pmap_load(l2) & ATTR_DESCR_MASK) == + L2_BLOCK) + return (NULL); + mpte = PHYS_TO_VM_PAGE(pmap_load(l2) & + ~ATTR_MASK); + mpte->ref_count++; + } else { + mpte = _pmap_alloc_l3(pmap, l2pindex, + NULL); + if (mpte == NULL) + return (mpte); + } } else { - /* - * Pass NULL instead of the PV list lock - * pointer, because we don't intend to sleep. - */ mpte = _pmap_alloc_l3(pmap, l2pindex, NULL); if (mpte == NULL) return (mpte);