Skip to content
Snippets Groups Projects
  1. Apr 28, 2014
    • Gleb Natapov's avatar
      vfs: move dentry to its new location during file rename · 3f050ee4
      Gleb Natapov authored
      
      If dentry has elevated reference count during rename (a file is opened
      for instance) it is not destroyed and still hashed with old path. As a
      result renamed file can still be accessed by its old name.
      
      Signed-off-by: default avatarGleb Natapov <gleb@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      3f050ee4
    • Takuya ASADA's avatar
      libc: Move alarm implementation to itimer class, Add setitimer/getitimer · db571962
      Takuya ASADA authored
      
      Move static variables for alarm and related function to itimer class.
      itimer class offers interfaces to implement setitimer/getitimer, so added setitimer/getitimer.
      Now alarm rewrite as a just a wrapper function to call setitimer.
      
      Signed-off-by: default avatarTakuya ASADA <syuu@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      db571962
    • Takuya ASADA's avatar
    • Nadav Har'El's avatar
      malloc: Fix small allocations with alignment > size. · c8845bb5
      Nadav Har'El authored
      
      When a small allocation is requested with large alignment, we ignored
      the alignment, and as a consequence posix_memalign() or
      alloc_phys_contiguous_aligned() could crash when it failed to achieve
      the desired alignment. This is not a common case (usually, size >= alignment,
      and the new C11 aligned_alloc() even supports only this case), but still
      it might happen, and we saw it in cloudius-systems/capstan#75.
      
      When size < alignment, this patch changes the size so we can achieve the
      desired alignment. For small alignments, this means setting size=alignment,
      so for example to get an alignment of 1024 bytes we need at least 1024-byte
      allocation. This is a waste of memory, but as these allocations are rare,
      we expect this to be acceptable. For large alignments, e.g., alignment=8192,
      we don't need size=alignment but we do need size to be large enough so we'll
      use malloc_large() (malloc_large() already supports arbitrarily large
      alignments).
      
      This patch also adds test cases to tst-align.so to test alignments larger
      than the desired size.
      
      Fixes #271 and cloudius-systems/capstan#75.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      c8845bb5
    • Asias He's avatar
      ahci: Relax _cmd_table and _recv_fis alignment · a1aa5243
      Asias He authored
      
      AHCI spec says cmd_table need to be aligned to 128 bytes, respect it.
      
      AHCI spec does not specify the alignment requirement of _cmd_list and
      _recv_fis. To be safe, we align to their size, i.e. 1024 and 256 bytes.
      
      This fixes the issue reported by Roman Shaposhnik.
      
         $ capstan run -p vbox
         Created instance: i1398297574
         OSv v0.07
         Assertion failed: !(reinterpret_cast<uintptr_t>(ret) & (align - 1))
         (/home/penberg/osv/core/mempool.cc: alloc_phys_contiguous_aligned:
         1378)
      
         [backtrace]
         0x398316 <memory::alloc_phys_contiguous_aligned(unsigned long,
         unsigned long)+214>
         0x3542bb <ahci::port::setup()+283>
         0x3549ae <ahci::port::port(unsigned int, ahci::hba*)+142>
         0x354a5f <ahci::hba::scan()+111>
         0x354d34 <ahci::hba::hba(pci::device&)+148>
         0x354e07 <ahci::hba::probe(hw::hw_device*)+119>
         0x33e65c
         <hw::driver_manager::register_driver(std::function<hw::hw_driver*
         (hw::hw_device*)>)+188>
         0x33c8c3 <hw::device_manager::for_each_device(std::function<void
         (hw::hw_device*)>)+51>
         0x33e3de <hw::driver_manager::load_all()+78>
         0x20edf5 <do_main_thread(void*)+629>
         0x3ff0a5 <sync+69>
         0x3a3eaa <thread_main_c+26>
         0x361585 <thread_main+7>
      
      Signed-off-by: default avatarAsias He <asias@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      a1aa5243
  2. Apr 27, 2014
  3. Apr 25, 2014
  4. Apr 24, 2014
Loading