minix/kernel/arch/earm
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
..
bsp arm-refactor:remove dependency from memory.c to omap_timer.h. 2014-07-28 17:05:09 +02:00
include arm-refactor:remove dependency from memory.c to omap_timer.h. 2014-07-28 17:05:09 +02:00
arch_clock.c Replaced common u64.h functions with operators. 2014-03-02 12:28:32 +01:00
arch_do_vmctl.c arm:indenting 2014-01-07 11:18:26 +01:00
arch_reset.c big <utmp.h>-inspired netbsd switch 2014-03-01 09:05:02 +01:00
arch_system.c <machine/signal.h> 2014-03-03 20:47:07 +01:00
direct_tty_utils.c arm:create SoC specific bsp directory and move code to there. 2014-02-07 11:14:39 +01:00
do_padconf.c arm:create SoC specific bsp directory and move code to there. 2014-02-07 11:14:39 +01:00
exc.S ARM updates 2013-01-17 10:03:58 +01:00
exception.c kernel: spelling fixes 2013-10-09 20:24:17 -04:00
glo.h ARM updates 2013-01-17 10:03:58 +01:00
head.S arm-refactor:document ARM assembly code. 2014-02-12 13:47:49 +01:00
hw_intr.c arm:create SoC specific bsp directory and move code to there. 2014-02-07 11:14:39 +01:00
kernel.lds Gold linker support for entire source tree 2013-06-11 22:51:02 +02:00
klib.S bigger message 2014-03-02 12:28:31 +01:00
Makefile.inc Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00
memory.c make vfs & filesystems use failable copying 2014-07-28 17:05:14 +02:00
mpx.S align ARM cpu.h importing & using armreg.h 2014-03-03 20:47:04 +01:00
pg_utils.c x86 multiboot.h 2014-03-03 20:47:05 +01:00
phys_copy.S Synchronize on NetBSD-CVS (2013/12/1 12:00:00 UTC) 2014-07-28 17:05:06 +02:00
phys_memset.S ARM updates 2013-01-17 10:03:58 +01:00
pre_init.c arm-refactor:remove dependency from memory.c to omap_timer.h. 2014-07-28 17:05:09 +02:00
procoffsets.cf ARM updates 2013-01-17 10:03:58 +01:00
protect.c x86 multiboot.h 2014-03-03 20:47:05 +01:00
sconst.h ARM updates 2013-01-17 10:03:58 +01:00
timer.h ARM updates 2013-01-17 10:03:58 +01:00