Subject: CVS commit: src/sys
To: None <>
From: Chuck Silvers <>
List: source-changes
Date: 11/13/2003 03:09:30
Module Name:	src
Committed By:	chs
Date:		Thu Nov 13 03:09:30 UTC 2003

Modified Files:
	src/sys/arch/alpha/alpha: trap.c
	src/sys/arch/arm/iomd: vidcvideo.c
	src/sys/arch/hpcmips/dev: ite8181.c mq200.c plumvideo.c
	src/sys/arch/hpcmips/tx: tx3912video.c
	src/sys/arch/hpcsh/dev/hd64461: hd64461video.c
	src/sys/arch/luna68k/dev: lunafb.c
	src/sys/arch/macppc/dev: ofb.c
	src/sys/arch/newsmips/apbus: xafb.c
	src/sys/arch/prep/pci: gten.c
	src/sys/arch/sparc/dev: cgfourteen.c
	src/sys/arch/sparc64/sparc64: machdep.c
	src/sys/compat/irix: irix_swap.c irix_sysmp.c irix_syssgi.c
	src/sys/compat/mach: mach_vm.c
	src/sys/dev/hpc: bivideo.c video_subr.c
	src/sys/dev/ic: bt463.c bt485.c ibm561.c igsfb.c
	src/sys/dev/pci: tga.c
	src/sys/dev/sbus: zx.c
	src/sys/dev/sun: bt_subr.c cgsix.c
	src/sys/dev/tc: cfb.c mfb.c sfb.c sfbplus.c stic.c sticvar.h tfb.c
	src/sys/kern: kern_time.c uipc_syscalls.c
	src/sys/uvm: uvm_extern.h uvm_glue.c

Log Message:
eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed.  however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors.  most of
the callers of uvm_useracc() make the above incorrect assumption.  the
rest are all misguided optimizations, which optimize for the case
where an operation will fail.  we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors.  since there appear to be no good uses of uvm_useracc(), we'll
just remove it.

To generate a diff of this commit:
cvs rdiff -r1.88 -r1.89 src/sys/arch/alpha/alpha/trap.c
cvs rdiff -r1.19 -r1.20 src/sys/arch/arm/iomd/vidcvideo.c
cvs rdiff -r1.19 -r1.20 src/sys/arch/hpcmips/dev/ite8181.c
cvs rdiff -r1.22 -r1.23 src/sys/arch/hpcmips/dev/mq200.c
cvs rdiff -r1.33 -r1.34 src/sys/arch/hpcmips/dev/plumvideo.c
cvs rdiff -r1.34 -r1.35 src/sys/arch/hpcmips/tx/tx3912video.c
cvs rdiff -r1.21 -r1.22 src/sys/arch/hpcsh/dev/hd64461/hd64461video.c
cvs rdiff -r1.11 -r1.12 src/sys/arch/luna68k/dev/lunafb.c
cvs rdiff -r1.37 -r1.38 src/sys/arch/macppc/dev/ofb.c
cvs rdiff -r1.6 -r1.7 src/sys/arch/newsmips/apbus/xafb.c
cvs rdiff -r1.9 -r1.10 src/sys/arch/prep/pci/gten.c
cvs rdiff -r1.37 -r1.38 src/sys/arch/sparc/dev/cgfourteen.c
cvs rdiff -r1.156 -r1.157 src/sys/arch/sparc64/sparc64/machdep.c
cvs rdiff -r1.10 -r1.11 src/sys/compat/irix/irix_swap.c
cvs rdiff -r1.9 -r1.10 src/sys/compat/irix/irix_sysmp.c
cvs rdiff -r1.37 -r1.38 src/sys/compat/irix/irix_syssgi.c
cvs rdiff -r1.32 -r1.33 src/sys/compat/mach/mach_vm.c
cvs rdiff -r1.17 -r1.18 src/sys/dev/hpc/bivideo.c
cvs rdiff -r1.5 -r1.6 src/sys/dev/hpc/video_subr.c
cvs rdiff -r1.8 -r1.9 src/sys/dev/ic/bt463.c
cvs rdiff -r1.9 -r1.10 src/sys/dev/ic/bt485.c
cvs rdiff -r1.4 -r1.5 src/sys/dev/ic/ibm561.c
cvs rdiff -r1.16 -r1.17 src/sys/dev/ic/igsfb.c
cvs rdiff -r1.56 -r1.57 src/sys/dev/pci/tga.c
cvs rdiff -r1.12 -r1.13 src/sys/dev/sbus/zx.c
cvs rdiff -r1.7 -r1.8 src/sys/dev/sun/bt_subr.c
cvs rdiff -r1.15 -r1.16 src/sys/dev/sun/cgsix.c
cvs rdiff -r1.41 -r1.42 src/sys/dev/tc/cfb.c src/sys/dev/tc/tfb.c
cvs rdiff -r1.38 -r1.39 src/sys/dev/tc/mfb.c
cvs rdiff -r1.60 -r1.61 src/sys/dev/tc/sfb.c
cvs rdiff -r1.18 -r1.19 src/sys/dev/tc/sfbplus.c
cvs rdiff -r1.25 -r1.26 src/sys/dev/tc/stic.c
cvs rdiff -r1.13 -r1.14 src/sys/dev/tc/sticvar.h
cvs rdiff -r1.32 -r1.33 src/sys/dev/tc/xcfb.c
cvs rdiff -r1.78 -r1.79 src/sys/kern/kern_time.c
cvs rdiff -r1.83 -r1.84 src/sys/kern/uipc_syscalls.c
cvs rdiff -r1.84 -r1.85 src/sys/uvm/uvm_extern.h
cvs rdiff -r1.72 -r1.73 src/sys/uvm/uvm_glue.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.