From owner-freebsd-hackers Tue Jul 29 17:32:53 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id RAA24597 for hackers-outgoing; Tue, 29 Jul 1997 17:32:53 -0700 (PDT) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id RAA24592 for ; Tue, 29 Jul 1997 17:32:51 -0700 (PDT) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id RAA03691; Tue, 29 Jul 1997 17:30:46 -0700 From: Terry Lambert Message-Id: <199707300030.RAA03691@phaeton.artisoft.com> Subject: Re: Location of copyin() and copyout().. To: msmith@atrad.adelaide.edu.au (Michael Smith) Date: Tue, 29 Jul 1997 17:30:46 -0700 (MST) Cc: vinay@agni.nuko.com, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199707290220.LAA09491@genesis.atrad.adelaide.edu.au> from "Michael Smith" at Jul 29, 97 11:50:40 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > It is generally considered _extremely_ bad to use copyin/copyout, as it > precludes your functions from being called from within kernel space. > > FWIW, this is what eventually stumped me when it came to getting Linux > WABI running on FreeBSD. This is a good point, considering that kernel preemption is one of my own goals. The issue is recursion with a paging operation in progress. I think with the limited cases I gave (the page is filled, the call made, and the page is still mapped) are OK. copying out is more likely to cause problems than copying in, since you copy in pages after they are touched, but you potentially touch on copyout. Probably there needs to be _copyin/_copyout for the internal usage, and a "safe" copyin/copyout for usage which isn't safed against reentrancy. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.