Skip to content
Snippets Groups Projects
  1. Apr 24, 2014
  2. Apr 23, 2014
  3. Apr 22, 2014
  4. Apr 20, 2014
    • Avi Kivity's avatar
      virtio: fix virtio-blk under debug allocator · a888df1a
      Avi Kivity authored
      
      The debug allocator can allocate non-contiguous memory for large requests,
      but since b7de9871 it uses only one sg entry for the entire buffer.
      
      One possible fix is to allocate contiguous memory even under the debug
      allocator, but in the future we may wish to allow discontiguous allocation
      when not enough contiguous space is available.  So instead we implement
      a virt_to_phys() variant that takes a range, and outputs the physical
      segments that make it up, and use that to construct a minimal sg list
      depending on the input.
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      a888df1a
    • Avi Kivity's avatar
      mmu: separate lock for vpopulate and friends · 87883d8a
      Avi Kivity authored
      
      When the debug allocator is active, it will call vpopulate() to manage the
      page table.  This causes a deadlock, as vpopulate() takes vma_list_mutex,
      while other operations that hold vma_list_mutex may allocate memory.
      
      Fix by using a separate mutex for the debug range.  This is safe since the
      page table root is pre-allocated, and any lower page tables will be either
      in the vma list range, or the debug range, but not both.
      
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      87883d8a
    • Nadav Har'El's avatar
      malloc: fix MALLOC_ALIGNMENT constant · ffd40f68
      Nadav Har'El authored
      
      The MALLOC_ALIGNMENT constant is supposed to be the default minimum
      alignment returned by malloc(). I set it to 8, but this is actually not
      what is normally done by recent modern of glibc on Linux, which takes
      the maximum of 2*sizeof(size_t) (which is indeed 8) and the
      alignof(long double), which is 16 bytes. So to be ABI compatible with
      Linux, we should do the same.
      
      Note that while this patch is good for future reference, it doesn't
      actually have any practical consequences in the current implementation:
      In our current small-malloc implementation, MALLOC_ALIGNMENT is not used
      at all, and the alignment is determined just by the size of the allocated
      object: A 16-byte object would have 16-byte alignment anyway. For large
      allocations the alignment will always be a full page, so again this
      change doesn't matter either.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      ffd40f68
  5. Apr 17, 2014
  6. Apr 16, 2014
Loading