Restrict uva2kva() to only work for user addresses
authorBarret Rhoden <brho@cs.berkeley.edu>
Mon, 25 Jan 2016 19:34:53 +0000 (14:34 -0500)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 2 Feb 2016 22:43:52 +0000 (17:43 -0500)
commitb1cfd072d46a554d17b649f002d578754941b541
treef1705e7827cf18a047cc2f34358475b52f6c1fe4
parent53232d622f56bf90d663d1a90736f097a46006b0
Restrict uva2kva() to only work for user addresses

Previously, we were allowing uva2kva() to work on KVAs.  That's a little
surprising, given the name.

The new version takes a length and protection field, so the caller can
check permissions at the same time.  Note the permissions check is only for
the address space limit - not an actual mmap() permission.

Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/arch/x86/vmm/intel/vmx.c
kern/include/umem.h
kern/src/umem.c