From nobody Mon Dec 02 01:46:16 2024 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 4Y1mpc4w9dz5fL7V; Mon, 02 Dec 2024 01:46:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Y1mpc4JB2z4j8m; Mon, 2 Dec 2024 01:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733103976; 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=IQEUjOXaYwWji+bfXIPAbQup8lKwtjUQ6vY49FbNYhA=; b=DBqowLogtYAsS3e7oaCvhxB4uvQGgq6lHAGBDpfxA3kdAn1Z/VgU2a6s/eyr+XgUa9SvAZ whgqfaXLXuomeueVNThQq42lgWgiUJNAIG14Mo822CNgDdXGqwpKYTiHEC7jThyZuYuqeO fn3TbtgvmUvQleah5I899wh7sWLIZ1moAJnZ8Uqljxf41zauvFTjqqeaiaSTIsz1xtekjB iixcfyXMCM0pDAu4LoYedDXZMEoI1AQ0LFwDlUCxGTRTCt9hNrL6E43C3pYqFVdjW7iHrv A61HFXbV+79R21Pq3zxttuWnjsnARlxJ5z6DMDIMgIFPyvymk6oiRV0ZCvBixA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1733103976; 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=IQEUjOXaYwWji+bfXIPAbQup8lKwtjUQ6vY49FbNYhA=; b=n6wMONhxo4e7Rixuprae2yR2NSRAc5Pli6610nIy90vOGx43hbD+kd8HoGg01oPUtnmpob zjPp+BdF4HW3YQxS+gV/vSst5suGKvAFgxZm7VZAB73MrVDrTHAW9Lt9mGrKxZ0wlTu/SU 0c9QtmDNVN2y4gi6N/1271hiI2whHesYADKBToofB2OS7ujky482uqZGlEHQeULSNEopvy 5I/emazyt9uL5mSTgA6oryPb7gsEAG8+ea3kD9cT1JMgo5AAOesSLbptkJvH14ZBjXUQhL eU07Ll+8K+Q+Piv+yobCde6HOxAED1MCMrkeJQs5x6jd09Cpf4GFaXwQry0d3w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1733103976; a=rsa-sha256; cv=none; b=jHCjKurgI/b6A6XWCLdhPRZt0u42bqxx2pQl58UCeSlOliEOx5qMtg5m9bET9DMkrmWbLo QnhBSDZRKxIYDBnaK2o73nK9p62sbYLxVV4E8J5iM3uLnKmML9/gUvjM+9j5o+YzF17rT3 R89IcBVjv+/T+K/m+4yoWuJmzpm5DrdK9wgW+1BMDtzog8vorS5nzlf4f3kHcsbRwZP0F9 0Icb1Ey1tH7K9GHwe1UY4ZEh235nXxKLFnERcM5eV3TeQ05ux10YmyXj45uNNxvb0qNQDK Wf39TsXWifAGP+bXtCQmVzs1vj4Fyn3zqQ0yX8jJqHKGpfVQ5wG/iyMkxc+KSA== 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 4Y1mpc3QkxzHfv; Mon, 2 Dec 2024 01:46:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4B21kGDf026483; Mon, 2 Dec 2024 01:46:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4B21kGwq026480; Mon, 2 Dec 2024 01:46:16 GMT (envelope-from git) Date: Mon, 2 Dec 2024 01:46:16 GMT Message-Id: <202412020146.4B21kGwq026480@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: 8e9f1e10c624 - stable/14 - amd64 pmap: assert and explain why pmap_qremove() is safe WRT supermappings 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/14 X-Git-Reftype: branch X-Git-Commit: 8e9f1e10c624e289212a9244c317b61ea8195a7e Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8e9f1e10c624e289212a9244c317b61ea8195a7e commit 8e9f1e10c624e289212a9244c317b61ea8195a7e Author: Konstantin Belousov AuthorDate: 2024-11-23 21:02:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-12-02 01:44:55 +0000 amd64 pmap: assert and explain why pmap_qremove() is safe WRT supermappings (cherry picked from commit 2d6923790b16785ac691cedb23234067672fe1cc) --- sys/amd64/amd64/pmap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index 9e6196de2e89..5a6c2b479937 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4077,7 +4077,19 @@ pmap_qremove(vm_offset_t sva, int count) va = sva; while (count-- > 0) { + /* + * pmap_enter() calls within the kernel virtual + * address space happen on virtual addresses from + * subarenas that import superpage-sized and -aligned + * address ranges. So, the virtual address that we + * allocate to use with pmap_qenter() can't be close + * enough to one of those pmap_enter() calls for it to + * be caught up in a promotion. + */ KASSERT(va >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", va)); + KASSERT((*vtopde(va) & X86_PG_PS) == 0, + ("pmap_qremove on promoted va %#lx", va)); + pmap_kremove(va); va += PAGE_SIZE; }