Skip to content
Snippets Groups Projects
  1. Jan 22, 2014
  2. Jan 21, 2014
  3. Jan 16, 2014
  4. Jan 15, 2014
  5. Jan 10, 2014
  6. Jan 02, 2014
  7. Dec 27, 2013
  8. Dec 20, 2013
  9. Dec 19, 2013
  10. Dec 18, 2013
  11. Dec 17, 2013
    • Nadav Har'El's avatar
      Fix assertion failure during many-cpu boot · 0b9fc40b
      Nadav Har'El authored
      
      While booting with many cpus (e.g., run.py -c 20, but I sometimes saw this
      with as few as 7), we crashed while trying to sleep with preemption disabled:
      
      Assertion failed: preemptable() (/home/nyh/osv/include/sched.hh: do_wait_until: 605)
      Aborted
      
      Turns out that since commit 223b2252 (half a year ago), main_cont()
      ran smp_launch() with preemption disabled. But smp_launch creates threads,
      and thread's constructor may sleep (e.g., on the thread_list_mutex), and
      we cannot do this with preemption disabled...
      
      So dropped the preempt_disable()/enable() from main_cont(). The reasoning for
      it as expressed in 223b2252 appears to be no longer relevant.
      
      Fixes #130.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      0b9fc40b
  12. Dec 11, 2013
  13. Dec 06, 2013
  14. Dec 05, 2013
  15. Dec 03, 2013
  16. Dec 01, 2013
    • Pekka Enberg's avatar
      virtio: Add virtio-rng driver · fd1be662
      Pekka Enberg authored
      
      This adds the virtio-rng driver to OSv.  The implementation is simple:
      
        - Start a thread that keeps 64 byte of entropy cached in internal
          buffer.  Entropy is gathered from the host with virtio-rng.
      
        - Create device nodes for "/dev/random" and "/dev/urandom" that both
          use the same virtio_rng_read() hook.
      
        - Use the entropy buffer for virtio_rng_read().  If we exhaust the
          buffer, wake up the thread and wait for more entropy to appear.
      
      We eventually should move device node creation to separate
      drivers/random.c that multiplexes between different hardware RNG
      implementations.  However, as we only support virtio-rng, I'm leaving
      that to whomever implements support for the next RNG.
      
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      fd1be662
    • Nadav Har'El's avatar
      Fix crash on malformed command line · 082ff373
      Nadav Har'El authored
      
      Before this patch, OSv crashes or continuously reboots when given unknown
      command line paramters, e.g.,
      
              scripts/run.py -c1 -e "--help --z a"
      
      With this patch, it says, as expected that the "--z" option is not
      recognized, and displays the list of known options:
      
          unrecognised option '--z'
          OSv options:
            --help                show help text
            --trace arg           tracepoints to enable
            --trace-backtrace     log backtraces in the tracepoint log
            --leak                start leak detector after boot
            --nomount             don't mount the file system
            --noshutdown          continue running after main() returns
            --env arg             set Unix-like environment variable (putenv())
            --cwd arg             set current working directory
          Aborted
      
      The problem was that to parse the command line options, we used Boost,
      which throws an exception when an unrecognized option is seen. We need
      to catch this exception, and show a message accordingly.
      
      But before this patch, C++ exceptions did not work correctly during this
      stage of the boot process, because exceptions use elf::program(), and we
      only set it up later. So this patch moves the setup of the elf::program()
      object earlier in the boot, to the beginning of main_cont().
      
      Now we'll be able to use C++ exceptions throughout main_cont(), not just
      in command line parsing.
      
      This patch also removes the unused "filesystem" paramter of
      elf::program(), rather than move the initializion of this empty object
      as well.
      
      Fixes #103.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      082ff373
    • Nadav Har'El's avatar
      Fix exception (in x86 sense, not C++) handling during boot · cba2f09a
      Nadav Har'El authored
      
      During boot, between the time main() set the IDT and when later
      smp_launch() is called, the IDT doesn't actually work correctly.
      The problem is that we use the separate stacks feature (IST), and that
      doesn't work without also setting the GDT, not only the IDT.
      
      So use init_on_cpu() to initialize not only the IDT, but other stuff
      as well. Fix smp_launch() not to repeat this initialization on the boot
      CPU, as it was already done.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      cba2f09a
  17. Nov 20, 2013
  18. Nov 15, 2013
  19. Nov 08, 2013
  20. Nov 06, 2013
  21. Oct 24, 2013
  22. Oct 23, 2013
  23. Oct 16, 2013
  24. Oct 14, 2013
    • Nadav Har'El's avatar
      Rework elf::program's API · ba3e3efa
      Nadav Har'El authored
      
      This is patch v2, incorporating most of the comments from the previous round.
      
      Solves issue #47:
      
      elf::program's API - add_object() and remove_object() was problematic in
      two respects:
      
      1. It did not do reference-counting on the loaded object, so if add_object()
         was done 5 times, a single remove_object() would unmap the object and
        its 4 other users will crash.
      
      2. It is un-C++-like.
      
      This patch replaces these two functions by a single function get_library():
      
        std::shared_ptr<elf::object>
         get_library(std::string lib, std::vector<std::string> extra_path = {});
      
      get_library() returns a shared_ptr, which is reference counting and does
      proper C++-style RAII. For example in the code:
      
      	auto lib = elf::get_program()->get_library(path);
      	auto main = lib->lookup<int (int, char**)>("main");
      	int rc = main(argc, argv);
      
      once lib out of scope, the reference count of the elf::object automatically
      goes down, and if nobody else holds another shared-pointer to the same
      library, the object is destroyed (causing the shared library to be unloaded).
      
      This patch also documents, with Doxygen, all the functions it touches.
      
      IMPORTANT NOTE: This reference count is completely unrelated to the issue
      of concurrent use of dlopen()/dlclose()/dl_iterate_phdr(), which is still
      buggy and we need to fix (I have a patch for that, but it's too long to fit
      in the margin).
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      ba3e3efa
Loading