From owner-freebsd-hackers Tue Jun 2 21:10:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA15599 for freebsd-hackers-outgoing; Tue, 2 Jun 1998 21:10:28 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from panzer.plutotech.com (ken@panzer.plutotech.com [206.168.67.125]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA15590 for ; Tue, 2 Jun 1998 21:10:22 -0700 (PDT) (envelope-from ken@panzer.plutotech.com) Received: (from ken@localhost) by panzer.plutotech.com (8.8.8/8.8.5) id WAA20525; Tue, 2 Jun 1998 22:10:16 -0600 (MDT) From: "Kenneth D. Merry" Message-Id: <199806030410.WAA20525@panzer.plutotech.com> Subject: Re: VM Questions In-Reply-To: <199806030335.UAA19842@implode.root.com> from David Greenman at "Jun 2, 98 08:35:34 pm" To: dg@root.com Date: Tue, 2 Jun 1998 22:10:16 -0600 (MDT) Cc: cc@swing.ca.sandia.gov, freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28s (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG David Greenman wrote... > >First, I was wondering if it is possible given a physical address, > >to copy data to it from a virtual address. Or is a virtual mapping > >necessary? > > There must be a virtual mapping. > > >The other question is how may I map user pages into the kernel? I've > >looked through vm_map.c, and it seems that support for this is > >lacking. To get around this for now, I am attempting to use almost > >exclusively physical address--although am now sure how it will work > >out. > > vm_map.c isn't really the right place to look. A better place would be > physio/vmapbuf/vunmapbuf in kern_physio.c and vm_machdep.c. One example of this is in the CAM passthrough driver. The passmapmem() function uses vmapbuf() to map the user data buffer into kernel memory. (the passthrough driver is sys/cam/scsi/scsi_pass.c) Obviously, though, you're limited by MAXPHYS as far as what you can map into kernel memory. If you want to do more than that, you've gotta either use physical addresses, or go through the effort to implement buffer chaining or some other similar mechanism. Ken -- Kenneth Merry ken@plutotech.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message