Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Jan 2020 01:37:34 +0200
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        Rick Macklem <rmacklem@uoguelph.ca>
Cc:        "freebsd-current@FreeBSD.org" <freebsd-current@freebsd.org>
Subject:   Re: easy way to work around a lack of a direct map on i386
Message-ID:  <20200130233734.GV4808@kib.kiev.ua>
In-Reply-To: <YTBPR01MB3374AA25792499A796DB7CAADD040@YTBPR01MB3374.CANPRD01.PROD.OUTLOOK.COM>

index | next in thread | previous in thread | raw e-mail

On Thu, Jan 30, 2020 at 11:23:02PM +0000, Rick Macklem wrote:
> Hi,
> 
> The current code for KERN_TLS uses PHYS_TO_DMAP()
> to access unmapped external pages on m_ext.ext_pgs
> mbufs.
> I also need to do this to implement RPC-over-TLS.
> 
> The problem is that some arches, like i386, don't
> support PHYS_TO_DMAP().
> 
> Since it appears that there will be at most 4 pages on
> one of these mbufs, my thinking was...
> - Acquire four pages of kva from the kernel_map during
>   booting.
> - Then just use pmap_qenter() to fill in the physical page
>   mappings for long enough to copy the data.
> 
> Does this sound reasonable?
> Is there a better way?

Use sfbufs, they should work on all arches.  In essence, they provide MI
interface to DMAP where possible.  I do not remember did I bumped the
limit for i386 after 4/4 went in.

There is currently no limits for sfbufs use per subsystem, but I think it
is not very likely to cause too much troubles.  Main rule is to not sleep
waiting for more sfbufs if you already own one..




home | help

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