Commit graph

24 commits

Author SHA1 Message Date
Tomas Hruby 975efeac31 Typo in VM server 2010-03-02 10:53:17 +00:00
Kees van Reeuwijk 9a755c3a1f Removed unused code in the ethernet driver that was left from an old implementation
Removed/rewritten the use of uninitialized variables in error messages.
2010-01-20 17:02:55 +00:00
Cristiano Giuffrida c5b309ff07 Merge of Wu's GSOC 09 branch (src.20090525.r4372.wu)
Main changes:
- COW optimization for safecopy.
- safemap, a grant-based interface for sharing memory regions between processes.
- Integration with safemap and complete rework of DS, supporting new data types
  natively (labels, memory ranges, memory mapped ranges).
- For further information:
  http://wiki.minix3.org/en/SummerOfCode2009/MemoryGrants

Additional changes not included in the original Wu's branch:
- Fixed unhandled case in VM when using COW optimization for safecopy in case
  of a block that has already been shared as SMAP.
- Better interface and naming scheme for sys_saferevmap and ds_retrieve_map
  calls.
- Better input checking in syslib: check for page alignment when creating
  memory mapping grants.
- DS notifies subscribers when an entry is deleted.
- Documented the behavior of indirect grants in case of memory mapping.
- Test suite in /usr/src/test/safeperf|safecopy|safemap|ds/* reworked
  and extended.
- Minor fixes and general cleanup.
- TO-DO: Grant ids should be generated and managed the way endpoints are to make
sure grant slots are never misreused.
2010-01-14 15:24:16 +00:00
Tomas Hruby d96360e4d4 Uninitialized variable fix in VM to kernel protocol
- index must be initialized to 0 otherwise bad things happen like the mappings
  for local APIC are not correct after turning paging on.
2010-01-14 11:30:02 +00:00
Ben Gras 8d800b3df7 Make VM fix up memory for kernel that crosses region boundaries
too.

Add a test to make this happen (triggers a vm panic before this commit).
2009-12-08 13:35:52 +00:00
Ben Gras f0db9bb328 - map in as much memory as is necessary in 4MB chunks to
let boot processes run with segments
 - allow segment-only processes to fork() by copying them
   and giving them an identity page table
2009-12-07 12:10:44 +00:00
Tomas Hruby ec1fec6c3f A debug print with no meaning removed from VM. 2009-12-03 10:53:56 +00:00
Tomas Hruby f98bea8f67 The rest of the r5641 commit 2009-11-11 17:02:45 +00:00
Ben Gras 0e43db1375 disable address space randomisation feature in normal mode. 2009-09-29 12:10:30 +00:00
Ben Gras 5cf59f9225 verbose printing and sanity checking functions. 2009-09-27 12:36:48 +00:00
Ben Gras f236d1dd9c throw out the debugging stuff again. 2009-09-23 16:26:05 +00:00
Ben Gras af77f4e964 debug output in SANITYCHECKS mode 2009-09-23 16:02:27 +00:00
Ben Gras f87a91ce95 missing level-- in out-of-memory case. 2009-09-23 15:19:36 +00:00
Ben Gras 4c11d7e6f5 - simplify findhole() for use for 1 page only
- do WMF_FREE
 - added WMF_VERIFY to check page table contents
 - randomize address space usage in vm self
2009-09-23 13:33:01 +00:00
Ben Gras 32fbbd370c - pages that points to page directory values of all processes,
shared with the kernel, mapped into kernel address space; 
   kernel is notified of its location. kernel segment size is
   increased to make it fit.
 - map in kernel and other processes that don't have their
   own page table using single 4MB (global) mapping.
 - new sanity check facility: objects that are allocated with
   the slab allocator are, when running with sanity checking on,
   marked readonly until they are explicitly unlocked using the USE()
   macro.
 - another sanity check facility: collect all uses of memory and
   see if they don't overlap with (a) eachother and (b) free memory
 - own munmap() and munmap_text() functions.
 - exec() recovers from out-of-memory conditions properly now; this
   solves some weird exec() behaviour
 - chew off memory from the same side of the chunk as where we
   start scanning, solving some memory fragmentation issues
 - use avl trees for freelist and phys_ranges in regions
 - implement most useful part of munmap()
 - remap() stuff is GQ's for shared memory
2009-09-21 14:49:49 +00:00
Ben Gras f86da99e67 map in kernel in 4MB, global-bit-set 'pages' if hardware
supports it. helps performance.

broken use of region data structure for kernel mapping to be fixed.
2009-05-18 15:34:42 +00:00
Ben Gras bdab3c4cfb Library call for cpu features; make kernel and vm use this to query cpu
features (specifically: 4MB pages and TLB global bit).  Only enable
these features in CR4 if available. 4MB pages to be used in the near
future.
2009-05-15 17:07:36 +00:00
Ben Gras 909c1bb8a7 don't bother with unmapping physical memory in non-sanitycheck mode. 2009-05-12 11:51:53 +00:00
Ben Gras 581e68433a basic sparepage optimisation
some simplification of linear/virtual address translation
(less hardcoding and more use of arch_*2* functions)
2009-05-12 11:38:29 +00:00
Ben Gras d2caeb6146 start all processes, including VM, in VM_PROCSTART in linear address space,
to make space for kernel to be able to map in things below there.
2009-05-11 19:11:37 +00:00
Ben Gras ef8a741301 set global flag for kernel pages, so tlb entries for kernel aren't thrown
away on cr3 reload. minor optimization.
2009-04-23 15:11:16 +00:00
Ben Gras 866a4a667e phys addr arg of 0 must be possible for pt_writemap too (instead of meaning
unmap).
2008-12-19 13:29:12 +00:00
Ben Gras 3121eec6bd . map text (kernel's and processes') in readonly
. map kernel in non-user
 . don't map in first pages of kernel code and data
   if possible

these first pages could actually be freed but as the
kernel isn't allowed to touch them either we can't reuse
them until VM has totally taken over page table management
and kernel doesn't rely on identity mapping any more.
2008-12-18 15:35:22 +00:00
Ben Gras c078ec0331 Basic VM and other minor improvements.
Not complete, probably not fully debugged or optimized.
2008-11-19 12:26:10 +00:00