From owner-freebsd-hackers Tue Jul 29 19:18:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id TAA29993 for hackers-outgoing; Tue, 29 Jul 1997 19:18:50 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id TAA29984 for ; Tue, 29 Jul 1997 19:18:45 -0700 (PDT) Received: (from msmith@localhost) by genesis.atrad.adelaide.edu.au (8.8.5/8.7.3) id LAA16641; Wed, 30 Jul 1997 11:47:22 +0930 (CST) From: Michael Smith Message-Id: <199707300217.LAA16641@genesis.atrad.adelaide.edu.au> Subject: Re: Location of copyin() and copyout().. In-Reply-To: <199707300146.SAA11272@implode.root.com> from David Greenman at "Jul 29, 97 06:46:08 pm" To: dg@root.com Date: Wed, 30 Jul 1997 11:47:21 +0930 (CST) Cc: terry@lambert.org, freebsd-hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL28 (25)] 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 David Greenman stands accused of saying: > > There is no problem with using copyout() in the kernel to copy data out to > a user process, assuming that the currently running process is the intended > target of the copy. That is the sole purpose of the function. copyout() > correctly handles all issues of COW/ZF/page faults. The only issue here is that the consumer of your service may _not_ be a user process, eg. in the case of an ABI emulation module. I would specifically request that people avoid using copyout unless they can be _absolutely_ certain that they will only ever be talking to user processes. As I said, this has already caused me heartache several times 8( > uiomove() is escentially a wrapper for copyin/copyout that has an > optimization for the case of kernel-to-kernel copies (in which case it > uses bcopy instead). You're ignoring the support for readv/writev here, although it would seem that user-level scatter-gather never really took off. > -DG -- ]] Mike Smith, Software Engineer msmith@gsoft.com.au [[ ]] Genesis Software genesis@gsoft.com.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control. (ph) +61-8-8267-3493 [[ ]] Unix hardware collector. "Where are your PEZ?" The Tick [[