Skip to content
Snippets Groups Projects
  1. Apr 11, 2013
  2. Apr 10, 2013
  3. Apr 08, 2013
  4. Apr 07, 2013
  5. Apr 04, 2013
    • Nadav Har'El's avatar
      abort() instead of errno when mprotect()ing malloc()ed memory · 7d49d9f8
      Nadav Har'El authored
      Though the application should test mprotect()'s success before assuming it
      succeeded, let's be extra sure and kill it. (By Avi's request)
      7d49d9f8
    • Nadav Har'El's avatar
      Don't allow mprotect() to modify the linear map · 4a6ec45e
      Nadav Har'El authored
      mprotect() is normally used on mmap()ed memory. It usually makes little
      sense to for applications to mprotect() memory they got from malloc()ed,
      for several reasons including the fact that free()ing this memory without
      mprotect()ing it back to normal back is a recipe for big trouble (while
      with munmap(), there is no need to mprotect() back). We therefore don't
      expect Java to use mprotect() on malloc()ed memory.
      
      For us, mprotect() on malloc() memory is particularly undesirable, because
      malloc() returns addresses in the linear map, and mprotect()ing that can
      "downgrade" this map (change huge pages into small pages) which will never
      be fixed later, not even when if mprotect()ing the memory back to normal.
      So for now, I'll just forbid mprotect() on addresses in the linear map.
      4a6ec45e
  6. Apr 02, 2013
  7. Mar 25, 2013
    • Dor Laor's avatar
      Comment out the recieve function since it blocks and w/o a tap · ebff95c6
      Dor Laor authored
      interface we cannot get an answer and it stalls the test execution.
      ebff95c6
    • Nadav Har'El's avatar
      TLB flush and other fixes to mmap/munmap/protect · 8eca17eb
      Nadav Har'El authored
      Added the missing TLB flush to the mmap()/munmap()/mprotect() operations.
      Note that currently I only do this on the processor running mmap(), which
      is incorrect (I put in a TODO), but is good enough for Java's use case
      (which is to do these things on startup).
      
      Also added more tests, and fixed a bug on mmap(PROT_NONE) (mprotect(PROT_NONE)
      used to work, but mmap(PROT_NONE) didn't).
      8eca17eb
    • Nadav Har'El's avatar
      Add working mprotect() tests. · 4072fd82
      Nadav Har'El authored
      Automate the tests for mprotect() using sigaction() - verifing that writing
      to read-only page causes SIGSEGV, and so on.
      
      One *failing* test is left commented out - currently we're missing a TLB
      flush on mprotect(), so if we write to a page and then make it read-only,
      the new read-only status isn't noticed by the processor.
      4072fd82
  8. Mar 24, 2013
    • Avi Kivity's avatar
      tests: fix fpu test for testrunner.so · 0c25c95f
      Avi Kivity authored
      The fpu test was written to be run standalone, but that doesn't work
      running from testrunner.so since the entry points are different (main vs.
      osv_main).
      0c25c95f
  9. Mar 22, 2013
  10. Mar 19, 2013
    • Nadav Har'El's avatar
      Implement mprotect(PROT_NONE) · d1e83a59
      Nadav Har'El authored
      Java uses mprotect(..., PROT_NONE) for guard pages (e.g., to catch stack
      overflow). This patch implements it by removing the present bit on these
      pages' mappings, which does not mean the pages have been unmapped (their
      memory is kept intact, and running mprotect again can make them readable
      again.
      d1e83a59
    • Avi Kivity's avatar
      tests: add fpu test · 58e0c0b5
      Avi Kivity authored
      Test that preemption does not corrupt fpu registers.
      58e0c0b5
  11. Mar 18, 2013
    • Nadav Har'El's avatar
      Implement mprotect(). There's still one missing feature though - PROT_NONE · 51d0ebd5
      Nadav Har'El authored
      is not currently supported, and PROT_READ is used instead (i.e., instead of
      inaccessible memory, one gets read-only memory). Inaccessible memory
      complicates the code because it means using the non-present bit on
      still-allocated pages, and then unpopulate() can't use the present bit to
      decide which pages are allocated and need to be freed.
      To fix this, I'll need to:
      1. unpopulate_page() and unpopulate_huge_page() should assume it is only
      ever called on allocated pages (evacute() actually ensures that!), and not
      return on non-present ptes.
      2. change_perm() should use the read_perm to set the present bit.
      3. protect() shouldn't rely on present bit to know when to return 0 or 1,
         rather it must be wrapped in something like evacute() which knows to
         find mapped ranges, and only call protect() for actually mapped ranges.
      I'll try this tomorrow.
      51d0ebd5
    • Nadav Har'El's avatar
      Fixed git accident - apparently "git add" adds the current version, not · cb1f611a
      Nadav Har'El authored
      the version at the time of commit. Git is overrated :(
      cb1f611a
    • Nadav Har'El's avatar
      Implemented munmap(), as well as mmap() over mmap(). The previous · 3e2a55b3
      Nadav Har'El authored
      implementation of both was completely broken - not only did evacuate()
      never free the physical memory backing the removed mapping, it was
      sometimes even called with wrong parameters ;-)
      Added tests to check that some of the mmap/munmap combinations no longer
      leak memory.
      3e2a55b3
  12. Mar 11, 2013
  13. Mar 07, 2013
  14. Mar 06, 2013
  15. Mar 05, 2013
Loading