From nobody Mon Nov 25 12:20:09 2024 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 4XxlCG03bcz5dWN4; Mon, 25 Nov 2024 12:20:10 +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 4XxlCF6d7Xz4tvy; Mon, 25 Nov 2024 12:20:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732537209; 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=8ktnhbyam2lL7hPpXcjjRqg/0OvOwvEb0KcRW5OdBpg=; b=eI4kehfcLgGm51Fdy9aNf7qbugtuMOhKf+okxg3YPvgKGBGDhhyYX86chIz8vUEPJxI3lc jzuNfCt2rI+/Txvf/VzJuxe+NZzWjiXAuBrMnuKkDfJKN4rSvSczI60C26FXXM85ls3t5h 8gu/oPedW5kkBgS2G+GADHB/QWcsxnbQ++O2fR8GotLBob2fiVX/dKX4sWCoDYDBxTQ8hw 8o26MTTEZcCxvhxQv+Jumm0ZrDMC8DnR7yFn5SAE1tC3W0L0F5Ik1FdawGEgfZo0FOWiM7 sGAXzoxZhiw8CkgQ1CnSjhAN01a5EAtnlCq1juCidCT6F+DZQspOuOat/MoMhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732537209; 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=8ktnhbyam2lL7hPpXcjjRqg/0OvOwvEb0KcRW5OdBpg=; b=WyLBbCOw4K6KkorNpSJXnEZAvP62GEcpiM51PyAfk0LYBLNWwzo1K09+N+G3e2K3L6Nd93 akwumRnDTqnIi45As82L3zQKJoMZZ8LqY7UYhd9XZ0PWeOVfm81FwKZ7Z5PeUlukaPb1Kj 9++b11b0n3BwIDjK34fwN26A/MxqItUbyPoqs34wZlootD/ZcHBnrWJi+ai7XK/r1hzr9E jsy0rPR+E8u6U5K9Vh9w5yC2xw4TKGaxTB4mxwIEJqPQvE8HkJQoJstwFTstyPWfCWNyE7 yMHNHvp+ysAV5kaio+K9lGonmxyYmCX702lZZxr/5Kh6EoIO6C+CuhcKQ3Vf1g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732537209; a=rsa-sha256; cv=none; b=fc4TigF28QKVTTdw1Kh0r6H1DJdCeI42DQTVUkmc7Wezf4G/rGttglIKLQ7E6b6FooFo3S 35vDPukbw7Ufiv9K8txgEi/svHhzneKxHROk/EUGnXYkdOSRWX9U69FA0cYG63Uw70mzlc sizJYr2LpXYt7JZRvItSK+LRobI1kJplic7FWHXvmM2GY+ChMEEfEFpRZgqvLfGj5bkD+Y xnoByRMAJXXFIEKVkTi1/YcVGywGljrmD47b5IwXKSgKVIWAE1z47lro3sIItIXHrYQmmV l3TDmmlNmTc3uQ7XtZ5KZjUsG3UuOcKtCaTjaMVoH20c+s1KHtyV8jvciVWjXA== 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 4XxlCF5dxPzfr6; Mon, 25 Nov 2024 12:20:09 +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 4APCK9PV025146; Mon, 25 Nov 2024 12:20:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4APCK9G7025130; Mon, 25 Nov 2024 12:20:09 GMT (envelope-from git) Date: Mon, 25 Nov 2024 12:20:09 GMT Message-Id: <202411251220.4APCK9G7025130@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 2d6923790b16 - main - amd64 pmap: assert and explain why pmap_qremove() is safe WRT supermappings 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: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 2d6923790b16785ac691cedb23234067672fe1cc Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=2d6923790b16785ac691cedb23234067672fe1cc commit 2d6923790b16785ac691cedb23234067672fe1cc Author: Konstantin Belousov AuthorDate: 2024-11-23 21:02:25 +0000 Commit: Konstantin Belousov CommitDate: 2024-11-25 12:16:50 +0000 amd64 pmap: assert and explain why pmap_qremove() is safe WRT supermappings Based on alc@ comments from https://reviews.freebsd.org/D47678. Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D47717 --- 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 3b7220369b61..21b8555b5380 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -4082,7 +4082,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; }