Skip to content
Snippets Groups Projects
  1. Jan 16, 2014
  2. Jan 15, 2014
  3. Jan 10, 2014
  4. Jan 02, 2014
  5. Dec 27, 2013
  6. Dec 20, 2013
  7. Dec 19, 2013
  8. Dec 18, 2013
  9. 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
  10. Dec 11, 2013
  11. Dec 06, 2013
  12. Dec 05, 2013
  13. Dec 03, 2013
  14. 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
  15. Nov 20, 2013
  16. Nov 15, 2013
  17. Nov 08, 2013
  18. Nov 06, 2013
  19. Oct 24, 2013
  20. Oct 23, 2013
  21. Oct 16, 2013
  22. 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
  23. Oct 04, 2013
  24. Sep 15, 2013
  25. Sep 14, 2013
    • Glauber Costa's avatar
      only run dhcp if we have a network interface · 1f18e2e2
      Glauber Costa authored
      As I have stated previously, what is true for qemu (that we always have
      a user-provided network interface) is not true for Xen. It is quite possible
      that we boot with no network interface at all. In that case, we will get stuck
      asking for an IP that will never come.
      
      This patch takes care to call for dhcp only if our interface is really up. Since
      networking is such a core service, we'll print a message if we can't do that.
      1f18e2e2
    • Glauber Costa's avatar
      initialize console later · bc209ae9
      Glauber Costa authored
      Some time ago I have moved the console initialization a bit earlier, so
      messages could be seen earlier. This has been, however, creating spurious
      problems (1 at each 10 - 15 boots) on Xen HVM. The reason is that the isa
      serial reset code enables interrupts upon reset, and the isa irq interrupt
      will call wake() in the pool thread, which at this point is not yet started.
      
      Since these days we already have simple_write() dealing with the early stuff,
      move it back to where it used to be.
      
      P.S: Dima found a way to make this problem 100 % reproduceable, by queueing
      data in the input line before the console starts. With this patch, the problem
      is gone even if Dima's method is used.
      bc209ae9
Loading