Move addr_range class to a separate file

It will be used outsize of mmu code.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
mmu: delegate file_vma creation to file class

Some kind of files may want to handle mmap differently. By delegating
file_vma creation to the file class it is possible for each file to
create customized vma.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
mmu: rename map_page_ops related structures

map_page_ops is used by page mapper to managed individual page
allocations and freeing, but the name is not reflects that.
page_allocator describes better the purpose of the structure.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
mmu: provide page_allocator specialization for files that support mmap semantic

Implement page_allocator specialization that delegates page
allocation/deallocation to mmaped file. It will be used to mmap files
that support get_page/put_page calls. Others fall back to old way of
reading file.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
mmu: implement shared memory file

shmfd is a pseudo file that allows sharing of anonymous memory. Each
mapping for this file points to the same memory. Only huge pages are
supported for now.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
mmu: mark address parameter as const

shmdt() is defined to get const pointer. Next patch implements shmdt
using unmap(), so const qualifier either need to be casted off or
unmap() and friends need to get const pointer as a parameter too. This
patch implement the later.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
libc: implement System V shared memory interface

Implement shmget/shmat/shmdt/shmctl function required by System V shared
memory interface.

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
tests: add System V shared memory test

Signed-off-by: Gleb Natapov <gleb@cloudius-systems.com>
Merge branch 'shm' of https://github.com/gleb-cloudius/osv

"
System V shared memory implementation

It looks like fio needs it although with single address space any memory
is shared anyway.
"

Signed-off-by: Avi Kivity <avi@cloudius-systems.com>