Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Oct 2023 12:05:15 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Mitchell Horne <mhorne@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: 74e4a8d208f0 - main - pmap: add pmap_kextract(9) man page
Message-ID:  <ZS5OS1tgejgK1pva@kib.kiev.ua>
In-Reply-To: <527ab884-ce06-4325-52a6-7c6dec1af563@FreeBSD.org>
References:  <202310131827.39DIRXsu082741@gitrepo.freebsd.org> <ZSqXbrd9dn9h5-We@kib.kiev.ua> <068574a3-f63a-4830-be1d-2a8cd67c1819@freebsd.org> <527ab884-ce06-4325-52a6-7c6dec1af563@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 16, 2023 at 03:54:32PM -0700, John Baldwin wrote:
> On 10/14/23 10:34 AM, Mitchell Horne wrote:
> > On 10/14/23 10:28, Konstantin Belousov wrote:
> > > On Fri, Oct 13, 2023 at 06:27:33PM +0000, Mitchell Horne wrote:
> > > > +.Pp
> > > > +.Fn vtophys
> > > > +is an alias for
> > > > +.Fn pmap_kextract
> > > > +and behaves identically.
> > > > +.Sh RETURN VALUES
> > > > +The
> > > > +.Fn pmap_kextract
> > > > +function will return the physical address
> > > > +.Pq Vt vm_paddr_t
> > > > +associated with the kernel virtual address
> > > and 'associated'?
> > > 
> > > The function returns address of physical memory mapped at the supplied
> > > kernel virtual address.
> > > 
> > 
> > Sure, this is more accurate.
> 
> I suggest tweaking this further just to be very explicit about the type
> of address being returned:
> 
> The
> .Fn pmap_kextract
> function returns the physical address of memory mapped at the
> kernel virtual address
> .Va va .
> 
> or some such.

There are two larger things that are worth adding to the man page, IMO.

1. pmap_kextract() is safe to be used from any context (in particular, it
   does not do any locking internally)

2. it is caller duty to ensure that the active mapping is alive and stable
   long enough for the answer to be useful




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ZS5OS1tgejgK1pva>