- 03 Apr, 2017 1 commit
-
-
Vikram Narayanan authored
Define helpers for __get_free_page(s) and free_page(s) Signed-off-by:
Vikram Narayanan <vikram186@gmail.com>
-
- 19 Dec, 2016 1 commit
-
-
- 26 Oct, 2016 18 commits
-
-
- rename functions - add them to mem.h Signed-off-by:
Abhiram Balasubramanian <abhiram@cs.utah.edu>
-
Updated kliblcd, liblcd, and string example.
-
This allows me to get all information - base address, size, cptr, and so on.
-
Host can successfully load LCD, using new interval tree/memory object logic. (Still get EPT fault while booting LCD.) Some fixes/changes: 1 - Need to use page-level granularity for memory objects. Unlike alloc_pages, vmalloc is page-granularity (rather than power-of-2 page granularity). 2 - The kernel module region base virtual address needs to match the host's upper 2GB address, because of how address calculations are done internally and because we use the host module loader with no linkage changes (it's possible, but not worth it right now). Add assertion to make sure this is the case. 3 - Needed to make LCD the owner of its cspace (set owner pointer).
-
-
Now that microkernel libcap build is separated from microkernel build itself, when we trigger a top-level microkernel build, it doesn't rebuild the whole thing every time. Kind of nice.
-
Easier to have caller pass memory object order and gpa base for _lcd_mmap and _lcd_munmap, since in liblcd we can look those things up easily.
-
I needed to clarify this part of the liblcd interface and ensure I have it right. Non-isolated code *must* invoke lcd_map_phys, lcd_map_virt, or _lcd_mmap on memory objects it either volunteers or is granted. This gives kliblcd an opportunity to insert the memory object into one of the two resource trees used for address -> cptr translation. I changed the names of the two trees to clarify what is stored in there - contiguous vs non-contiguous. (This is only a kliblcd internal thing.) It doesn't matter if you map contiguous memory via lcd_map_phys or lcd_map_virt; it always goes in the contiguous resource tree. Similar or non-contiguous (e.g. vmalloc) mem.
-
Memory itree code initializes resource tree needed for address -> cptr translation. Provides interface for other liblcd code to add/remove from tree (page allocator will use that). Removed redundant nr_pages_order field from resource tree node. Its size can be computed from the interval tree node. Filled in some simple functions that are part of the liblcd interface. Some are no-ops for isolated code.
-
Following the Linux kernel src layout, moved the vt-x code into a separate arch folder. Moved headers around: -- Microkernel/kliblcd arch-independent headers are in include/lcd_domains -- Microkernel arch-dependent headers are in arch/x86/include -- liblcd headers are in include/liblcd Switched some file/dir names to use `_` instead of `-`.
-
Microkernel and kliblcd compile. Some linker errors due to missing resource tree and create objects. Going to refactor build now, more code shuffling fun.
-
Similar to alloc pages. Call into the microkernel to vmalloc memory. Then, add it to the vmalloc resource tree so we can do address -> cptr translation.
-
-
When non-isolated code wants to "volunteer" host memory to the microkernel's capability system, it invokes lcd_volunteer_pages, lcd_volunteer_dev_mem, or lcd_volunteer_vmalloc_mem, depending on the type of memory. Internally, these check to see if the memory has already been volunteered (so we don't get duplicates -- this is checked via the global memory interval tree). If not, it inserts the memory into the caller's cspace. The caller can subsequently share the memory with e.g. an isolated LCD via the capability mediated interfaces. I had support for this before, but there was no checking for duplicate inserts (and this is a real problem with the pmfs example for string sharing): Non-isolated code has no way of knowing (without implementing data structures on its own) whether it inserted host memory already or not, or whether some other non-isolated code has. Furthermore, now we have full support for address -> cptr translation in the non-isolated side. This is also needed for the pmfs example with string sharing: before, the non-isolated code just always inserted memory every time to share strings, even if this lead to duplicate inserts. I think this is one of the "friction points" of embedding a capability system inside a kernel: translation from host objects to capabilities and back. For some objects, you can just embed the cptr in the object itself (our "container structs"). But for some things -- like memory -- it's not so easy. (For device memory, the host kernel doesn't use a struct page to represent it. So we're faced with creating our own giant array of data structures to represent each page of device memory, and embedding the cptr in that. Or instead -- as I have done -- use a data structure like a tree to do a reverse lookup.)
-
Motivation: An LCD needs to keep track of address -> cptr correspondences. The resource trees fulfill that role. Each kLCD has two resource trees: one for physical memory (RAM, dev mem, etc.) and one for vmalloc memory (non-contiguous physical memory that is contiguous in the virtual address space). To mirror isolated code, when the kLCD maps/unmaps a memory object in host physical, we update its resource trees. (Of course, we don't bother / can't modify the host's physical mappings, so this is all that happens.) It gives kliblcd a chance to update the trees.
-
I'm no longer providing the option of embedding resource nodes in the metadata. The caller can just reserve a static array of the appropriate size (shouldn't be too big in common cases). Makes the metadata size calculation simpler. And the caller will most likely need to do tuning regardless.
-
Mostly complete except for the bits that need the rb tree I'm planning to put in place for translating physical addresses to cptr's. This may seem like silly refactoring, but it's cleaning up and unifying a bunch of crap (including the more recent feature for passing strings back and forth).
-
I wanted to do this first before re-factoring kliblcd, so I know what I need to do. This is a step toward unifying the old isolated and non-isolated interfaces. The semantics of each function will be a bit different depending on the execution context. -- address_spaces.h: from old types.h, with few changes -- boot_info.h: bootstrap page data; from old types.h; small changes to struct -- create.h: LCD and kLCD creation; from old kliblcd.h; doc cleaned up and interface -- mem.h: unified memory interface; coalesces functions from old liblcd.h and kliblcd.h -- sync_ipc.h: unifies ipc and utcb headers -- syscall.h: same as before Removes old capability and data store crap. Also, fixes small bug for edge case in cap types.
-