minix/kernel
Ben Gras 565f13088f make vfs & filesystems use failable copying
Change the kernel to add features to vircopy and safecopies so that
transparent copy fixing won't happen to avoid deadlocks, and such copies
fail with EFAULT.

Transparently making copying work from filesystems (as normally done by
the kernel & VM when copying fails because of missing/readonly memory)
is problematic as it can happen that, for file-mapped ranges, that that
same filesystem that is blocked on the copy request is needed to satisfy
the memory range, leading to deadlock. Dito for VFS itself, if done with
a blocking call.

This change makes the copying done from a filesystem fail in such cases
with EFAULT by VFS adding the CPF_TRY flag to the grants. If a FS call
fails with EFAULT, VFS will then request the range to be made available
to VM after the FS is unblocked, allowing it to be used to satisfy the
range if need be in another VFS thread.

Similarly, for datacopies that VFS itself does, it uses the failable
vircopy variant and callers use a wrapper that talk to VM if necessary
to get the copy to work.

	. kernel: add CPF_TRY flag to safecopies
	. kernel: only request writable ranges to VM for the
	  target buffer when copying fails
	. do copying in VFS TRY-first
	. some fixes in VM to build SANITYCHECK mode
	. add regression test for the cases where
	  - a FS system call needs memory mapped in a process that the
	    FS itself must map.
	  - such a range covers more than one file-mapped region.
	. add 'try' mode to vircopy, physcopy
	. add flags field to copy kernel call messages
	. if CP_FLAG_TRY is set, do not transparently try
	  to fix memory ranges
	. for use by VFS when accessing user buffers to avoid
	  deadlock
	. remove some obsolete backwards compatability assignments
        . VFS: let thread scheduling work for VM requests too
          Allows VFS to make calls to VM while suspending and resuming
          the currently running thread. Does currently not work for the
          main thread.
        . VM: add fix memory range call for use by VFS

Change-Id: I295794269cea51a3163519a9cfe5901301d90b32
2014-07-28 17:05:14 +02:00
..
arch make vfs & filesystems use failable copying 2014-07-28 17:05:14 +02:00
system make vfs & filesystems use failable copying 2014-07-28 17:05:14 +02:00
clock.c Replacing timer_t by netbsd's timer_t 2014-03-01 09:04:54 +01:00
clock.h kernel: spelling fixes 2013-10-09 20:24:17 -04:00
config.h Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL 2014-03-01 09:04:59 +01:00
const.h No more intel/minix segments. 2012-07-15 22:30:15 +02:00
cpulocals.c Libraries updates and cleanup 2013-01-14 11:36:26 +01:00
cpulocals.h Kernel: clean up include statements a bit 2012-08-14 16:29:05 +00:00
debug.c kernel: fixes for DEBUG_DUMPIPC mode 2013-09-24 08:26:53 +00:00
debug.h kernel ipc debug: various fixes 2013-05-01 21:40:23 +00:00
extract-errno.sh kernel: fixes for DEBUG_DUMPIPC mode 2013-09-24 08:26:53 +00:00
extract-mfield.sh libsys: various updates 2014-03-01 09:05:00 +01:00
extract-mtype.sh Clean up interface to PM and VFS 2014-03-01 09:05:01 +01:00
glo.h kernel: spelling fixes 2013-10-09 20:24:17 -04:00
interrupt.c kernel: spelling fixes 2013-10-09 20:24:17 -04:00
interrupt.h SMP - trully idle APs 2010-09-15 14:10:57 +00:00
ipc.h machine/ipcconst.h for arch-specific constants 2012-08-27 19:46:41 -04:00
kernel.h Replacing timer_t by netbsd's timer_t 2014-03-01 09:04:54 +01:00
main.c x86 multiboot.h 2014-03-03 20:47:05 +01:00
Makefile Remove support for MKTRACE, MKMCONTEXT, MKSTATECTL 2014-03-01 09:04:59 +01:00
priv.h Kernel: make SIGKMESS target process list dynamic 2014-03-01 09:04:54 +01:00
proc.c Changing the message union to anonymous. 2014-03-03 20:46:47 +01:00
proc.h Adding ipc_ prefix to ipc primitives 2014-03-01 09:05:01 +01:00
profile.c Libraries updates and cleanup 2013-01-14 11:36:26 +01:00
profile.h retire _PROTOTYPE 2012-03-25 16:17:10 +02:00
proto.h make vfs & filesystems use failable copying 2014-07-28 17:05:14 +02:00
smp.c kernel: spelling fixes 2013-10-09 20:24:17 -04:00
smp.h kernel: spelling fixes 2013-10-09 20:24:17 -04:00
spinlock.h Libraries updates and cleanup 2013-01-14 11:36:26 +01:00
system.c use netbsd <sys/signal.h> and sigset_t 2014-03-02 12:28:31 +01:00
system.h kernel: add padconf kernel call 2013-08-28 12:53:05 -04:00
table.c Take LOG out of the boot image 2014-03-01 09:04:55 +01:00
type.h No more intel/minix segments. 2012-07-15 22:30:15 +02:00
usermapped_data.c Libraries updates and cleanup 2013-01-14 11:36:26 +01:00
utility.c Kernel: make SIGKMESS target process list dynamic 2014-03-01 09:04:54 +01:00
vm.h No linear addresses in message delivery 2010-06-11 08:16:10 +00:00
watchdog.c kernel: spelling fixes 2013-10-09 20:24:17 -04:00
watchdog.h kernel: spelling fixes 2013-10-09 20:24:17 -04:00