Skip to content
Snippets Groups Projects
  1. Jun 03, 2020
    • Bodo Stroesser's avatar
      scsi: target: tcmu: Fix size in calls to tcmu_flush_dcache_range · 8c4e0f21
      Bodo Stroesser authored
      1) If remaining ring space before the end of the ring is smaller then the
         next cmd to write, tcmu writes a padding entry which fills the remaining
         space at the end of the ring.
      
         Then tcmu calls tcmu_flush_dcache_range() with the size of struct
         tcmu_cmd_entry as data length to flush.  If the space filled by the
         padding was smaller then tcmu_cmd_entry, tcmu_flush_dcache_range() is
         called for an address range reaching behind the end of the vmalloc'ed
         ring.
      
         tcmu_flush_dcache_range() in a loop calls
         flush_dcache_page(virt_to_page(start)); for every page being part of the
         range. On x86 the line is optimized out by the compiler, as
         flush_dcache_page() is empty on x86.
      
         But I assume the above can cause trouble on other architectures that
         really have a flush_dcache_page().  For paddings only the header part of
         an entry is relevant due to alignment rules the header always fits in
         the remaining space, if pa...
      8c4e0f21
  2. May 27, 2020
  3. May 20, 2020