---
name: "pmap_kextract"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/pmap_kextract"
---

# pmap\_kextract(9)

extract a physical address from the kernel page table

## NAME

**pmap\_kextract**, **vtophys** – extract a physical address from the kernel page table

## SYNOPSIS

**#include \<sys/param.h\>**

**#include \<vm/vm.h\>**

**#include \<vm/pmap.h\>**

*vm\_paddr\_t*\

**pmap\_kextract**(*vm\_offset\_t va*);

*vm\_paddr\_t*\

**vtophys**(*vm\_offset\_t va*);

## DESCRIPTION

The **pmap\_kextract**() function retrieves the underlying physical memory address corresponding to the given kernel virtual address *va*. The caller is responsible for ensuring that *va* 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 **pmap\_kextract**() with the address of a malloc'd object while there is a possibility for that object to be freed concurrently.

Unlike [pmap\_extract(9)](/pmap_extract/9.md), **pmap\_kextract**() is safe to be called from any context; it has no internal locking or sleep.

**vtophys**() is an alias for **pmap\_kextract**() and behaves identically.

## RETURN VALUES

The **pmap\_kextract**() function returns the physical address of memory mapped at the kernel virtual address *va*.

**pmap\_kextract**() generally does not fail. However, if supplied with an illegitimate value for *va*, the function may return zero, an invalid non-zero value, or call [panic(9)](/panic/9.md).

## SEE ALSO

[pmap(9)](/pmap/9.md), [pmap\_extract(9)](/pmap_extract/9.md)

## AUTHORS

This manual page was written by Mina Galić ⟨*FreeBSD@igalic.co*⟩, based on the [pmap\_extract(9)](/pmap_extract/9.md) page written by Bruce M Simpson ⟨*bms@spc.org*⟩.
