From owner-freebsd-hackers Sun Feb 23 0:51:53 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1E0737B429 for ; Sun, 23 Feb 2003 00:51:50 -0800 (PST) Received: from stork.mail.pas.earthlink.net (stork.mail.pas.earthlink.net [207.217.120.188]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5665643FD7 for ; Sun, 23 Feb 2003 00:51:50 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0405.cvx40-bradley.dialup.earthlink.net ([216.244.43.150] helo=mindspring.com) by stork.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18mrrP-00074X-00; Sun, 23 Feb 2003 00:51:47 -0800 Message-ID: <3E588B1B.484C4D61@mindspring.com> Date: Sun, 23 Feb 2003 00:49:31 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Byunghyun Oh Cc: freebsd-hackers@freebsd.org Subject: Re: Replacement for get_user_pages() of Linux References: <20030223163746.A19421@shell.postech.ac.kr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a421d7f1cfc20fe28cee678c32ae67e608667c3043c0873f7e350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Byunghyun Oh wrote: > I'm porting Plex86 x86 VM, which uses get_user_pages() function at > Linux-version kernel module to find and pin physical pages of memory > in user space (according to its documentation). I tried many > candidates as its replacement (PHYS_TO_VM_PAGE() macro in vm/vm_page.h > seems most useful now), but they haven't worked at all. > > Any experience about porting VM-related things in Linux will be > appreciated. :) I've been unable to find any documentation on get_user_pages(), and you didn't provide a link to any. But looking at the source code, the reason for doing this is to permit DMA directly into user pages. I don't understand what you mean by "pin", in this context. You are aware that FreeBSD has a unified VM and buffer cache, and all user pages for the current process are automatically visible in th kernel address space, with no need to call something like get_user_pages() to establish a mapping, right? Is the intent of this to allow the process memory to be addressed, even though the process is not active? If so, then what you want to do is establish a kernel mapping for the pages, and mark them non-swappable. Otherwise, what you want is automatic (see uiomove). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message