From nobody Mon Nov 06 16:55:14 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 4SPHXM184nz50Gfn; Mon, 6 Nov 2023 16:55:15 +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 4SPHXM0KX6z4LQ2; Mon, 6 Nov 2023 16:55:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699289715; 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=SC9lyA25Ln7iU3JNQN8QsqavAsZm4U3brTgzS/A8fZg=; b=NcdGajBmzIrj0zfzJVOvVHejOF5vSI43mi/UHvNntGs4GDe9EFj7nQ85ms4t3UjxynM64g nsJxTyDg1A7CgO050UOk/wiVTVpreDRBElEsBohPiIQjKv9lV6nTU/GIdtU4FHLWG4L9PG HlQpmNYaYoC9LV/I0YBlHfhbExR255n4qYrknS+Rqi8pN3oGJZH9JA0Hefg0tF8PlgO3E1 M57s55eq+U1CVPtohPRdAVw3QHoXH4KjgFgrG/l4ytfc3nIvhw6slNXk6V+JynKkazFY9g OPMhRE+Bwvn/gWGZkl/7tvhcBK+P4KuqyaDUmc3uw1heaO8QyLKQshv7P72OYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699289715; 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=SC9lyA25Ln7iU3JNQN8QsqavAsZm4U3brTgzS/A8fZg=; b=DjLvCAtUmoAch5DOe7ONFqG2wsXXYFuy5igniJo/X+E1HxFOLplKvbBPUA+kLWDwj5D0qM mxUw90KTDTVu3czwZ1fi4HJL6HX+SFXEujrHtG5QPCpD2ufJzorE0B0T5zhdZW1JuszQRd kjKU/dzu7gRX/2k0Sw8e0f2OhZJU5wNgDKz9IeZQixgW8EJ7OdGv4yF5d1Vf9+N8B5kmT5 EJHT7XAFQ1pYs5d+KDq08yV5uFP44/TFpMawuovPa6w29rCgXZfbtx12n9EsTSlKVWZkjf Nuc1Q2Ru5WXEbiGdNbOFuFGGqjm4BEb7s8LGDVWzafIhamHu63CzyLLg7XXSJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699289715; a=rsa-sha256; cv=none; b=iz2qR4T//wU1eInIHmBxvOozIHmXC2ZawpTw4oe6U4n34c8XOqJ1iY7dEJ4P0TK3iG913E X2p3ILOevJSvaRow4EBOP6H9fimN/R30w5Q3vNNyABHwGn4z7AMGcvyys+mNPcOL0FERJP 3NBPoLo+BWpgyv7cj6V3qdeJ6XNcDiBKgV4FxCJSGRkHq2kJrhbUfOGOE4rNweqXrImmLK YESRgdVf0XQzHClNHZBQBj6cTl88i9Ph070TVP+KoYz3SB8dxphOinFZNwTu3EX5uQTqlA gawazbe0IU3VRlKOjyYn3pF1SYhlafLeaZMVQ9u0/fU7acvedNVZcN20Y+nwnw== 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 4SPHXL6PfRzYl; Mon, 6 Nov 2023 16:55:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A6GtE2H074871; Mon, 6 Nov 2023 16:55:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A6GtElF074868; Mon, 6 Nov 2023 16:55:14 GMT (envelope-from git) Date: Mon, 6 Nov 2023 16:55:14 GMT Message-Id: <202311061655.3A6GtElF074868@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: c1e21468213e - main - pmap_kextract(9): some additions 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: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c1e21468213e3ae35c5302f94472f1d996d530cd Auto-Submitted: auto-generated The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=c1e21468213e3ae35c5302f94472f1d996d530cd commit c1e21468213e3ae35c5302f94472f1d996d530cd Author: Mitchell Horne AuthorDate: 2023-11-06 16:54:18 +0000 Commit: Mitchell Horne CommitDate: 2023-11-06 16:54:45 +0000 pmap_kextract(9): some additions Mainly, provide a little more detail on the caller's responsibilities. Suggested by: kib, jhb Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D42458 --- share/man/man9/pmap_kextract.9 | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/share/man/man9/pmap_kextract.9 b/share/man/man9/pmap_kextract.9 index 40008a1bc96c..a93bbc70b351 100644 --- a/share/man/man9/pmap_kextract.9 +++ b/share/man/man9/pmap_kextract.9 @@ -31,9 +31,21 @@ The function retrieves the underlying physical memory address corresponding to the given kernel virtual address .Fa va . -The value of +The caller is responsible for ensuring that .Fa va -must belong to a valid mapping in the kernel address space. +belongs to a valid mapping in the kernel address space. +The returned physical address is only meaningful as long as the mapping remains +stable, so the caller must also have some knowledge or guarantee of the +mapping's lifetime. +For example, it is invalid to call +.Fn pmap_kextract +with the address of a malloc'd object while there is a possibility for that +object to be freed concurrently. +.Pp +Unlike +.Xr pmap_extract 9 , +.Fn pmap_kextract +is safe to be called from any context; it has no internal locking or sleep. .Pp .Fn vtophys is an alias for @@ -42,7 +54,7 @@ and behaves identically. .Sh RETURN VALUES The .Fn pmap_kextract -function returns the address of physical memory mapped at the kernel +function returns the physical address of memory mapped at the kernel virtual address .Fa va . .Pp