From nobody Fri Jan 20 03:23:56 2023 X-Original-To: dev-commits-src-branches@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 4NylG4613Rz30vrp; Fri, 20 Jan 2023 03:23: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 4NylG45XNjz3pGq; Fri, 20 Jan 2023 03:23:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185036; 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=PNjVrHcXU4q9QyS4jiM18xZ5Mv9W+ZdilangifYL/Ms=; b=MmHH1i+GnGi+Fz/D6WCQhpvr9uCoh3aHfSetGDaAVlS8FGWuqF/zovZSfIxZzMm+bnHrlv HOW5X/3+TqeyDmZRAvtlsCqroZIRR8zuZSvNcjQXp1GluzqTDktlPdnHtH7nEn61d0n/qK a55GPZz+ASrA4l/63/ya1SfU7dLBXxcgmWKdg8StcvW0ZYO9DgamYh6V86gLX1K6Q6jLH/ lMGTfKwbwVrtIlx2geHjXKGwOAWukhSMAgXYtqMf8GMEF7jaiiiIEH1ZTp8lJGdStocy5P Vtw4tpP6GjQ77FUEO7ImQv1NiQM11FX6MjrzJa+ky4DvoOXzd6lcnDp/RZAxew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674185036; 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=PNjVrHcXU4q9QyS4jiM18xZ5Mv9W+ZdilangifYL/Ms=; b=GDKRqhYtVZDUcqQHpgcVQq2anuWP8ocJevAty3R0CPAX4E2C0H6CisUNGU6/oJ4qGWwTjQ xcycmy1vDNAQwD0o/P4RJ8/PxZCtd6lGJj3NqVtTIzahSXq1vLT0lopNa5MC3qUAo9TPXa n+8mx+bxeNC4VK7/sac4TK6pGGcY6fDl462W44QCZ48esYoXCD+SkvNl6RpobAuBXIOkYd JtbNMGfSL9I7TWFxz4pKG068GOZ3CEyGeFv12qfzUHbD4PgdN5Bs214RvLj4F++vyIMDe5 13YVPPEjO0YU5hct0Ch8alU18FqPOzEwILmE2Rj5M6Bw0rvHykVmOPETLfIOZw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674185036; a=rsa-sha256; cv=none; b=pZ5fnlfHkohr2xk2fOI6l7EfkAN8LErDQXi5uvpCLzRfGljEK19wO3SqGLiRs8XHrCHAV5 Emkr+t6/gXVKVLWbZCftN31d5gTzKSRrDDNqzxma9LZoxyVPnu6in9JUJkByyS9Xsu+IVV cbDX9m4phntUIKHBISwNvJHNO3BpGy6H3H67SLOhtccfgCgCrRPekpbWpVnXvBpzCSPhOL tT8W/Fecq4epIuZUwtuYkg3TY+dEUujoJ/3EufPBAb7PUBqWpnVTQkvbYaHbZhBWmTAQjl wuZdJq6kEU/Uq4lnsjhMOQzViqVACvQHKO7f4hpkoiUTxEcqZWRjXy6sKyFFVg== 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 4NylG44Z6pzG9N; Fri, 20 Jan 2023 03:23:56 +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 30K3Nu6g042848; Fri, 20 Jan 2023 03:23:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30K3Nu6w042847; Fri, 20 Jan 2023 03:23:56 GMT (envelope-from git) Date: Fri, 20 Jan 2023 03:23:56 GMT Message-Id: <202301200323.30K3Nu6w042847@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 4ab02274ed39 - stable/13 - Move INVLPG to pmap_quick_enter_page() from pmap_quick_remove_page(). List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4ab02274ed392d088f4bbd17811a668d657a63bc Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=4ab02274ed392d088f4bbd17811a668d657a63bc commit 4ab02274ed392d088f4bbd17811a668d657a63bc Author: Konstantin Belousov AuthorDate: 2022-12-29 20:48:51 +0000 Commit: Konstantin Belousov CommitDate: 2023-01-20 03:22:02 +0000 Move INVLPG to pmap_quick_enter_page() from pmap_quick_remove_page(). Tested by: pho (cherry picked from commit 231d75568f169fe6adc30373c12512b992c5c672) --- sys/amd64/amd64/pmap.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 62fa64881c7b..e990ed0b93af 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -10275,6 +10275,13 @@ pmap_quick_enter_page(vm_page_t m) return (PHYS_TO_DMAP(paddr)); mtx_lock_spin(&qframe_mtx); KASSERT(*vtopte(qframe) == 0, ("qframe busy")); + + /* + * Since qframe is exclusively mapped by us, and we do not set + * PG_G, we can use INVLPG here. + */ + invlpg(qframe); + pte_store(vtopte(qframe), paddr | X86_PG_RW | X86_PG_V | X86_PG_A | X86_PG_M | pmap_cache_bits(kernel_pmap, m->md.pat_mode, 0)); return (qframe); @@ -10287,14 +10294,6 @@ pmap_quick_remove_page(vm_offset_t addr) if (addr != qframe) return; pte_store(vtopte(qframe), 0); - - /* - * Since qframe is exclusively mapped by - * pmap_quick_enter_page() and that function doesn't set PG_G, - * we can use INVLPG here. - */ - invlpg(qframe); - mtx_unlock_spin(&qframe_mtx); }