1. Sep 22, 2022
    • Will Deacon's avatar
      arm64: dma: Drop cache invalidation from arch_dma_prep_coherent() · c44094ee
      Will Deacon authored
      
      
      arch_dma_prep_coherent() is called when preparing a non-cacheable region
      for a consistent DMA buffer allocation. Since the buffer pages may
      previously have been written via a cacheable mapping and consequently
      allocated as dirty cachelines, the purpose of this function is to remove
      these dirty lines from the cache, writing them back so that the
      non-coherent device is able to see them.
      
      On arm64, this operation can be achieved with a clean to the point of
      coherency; a subsequent invalidation is not required and serves little
      purpose in the presence of a cacheable alias (e.g. the linear map),
      since clean lines can be speculatively fetched back into the cache after
      the invalidation operation has completed.
      
      Relax the cache maintenance in arch_dma_prep_coherent() so that only a
      clean, and not a clean-and-invalidate operation is performed.
      
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Ard Biesheuvel <ardb@kernel.org>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Link: https://lore.kernel.org/r/20220823122111.17439-1-will@kernel.org
      
      
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      c44094ee
  2. Sep 16, 2022
  3. Sep 10, 2022
  4. Sep 06, 2022
    • Ard Biesheuvel's avatar
      arm64: compat: Implement misalignment fixups for multiword loads · 3fc24ef3
      Ard Biesheuvel authored
      
      
      The 32-bit ARM kernel implements fixups on behalf of user space when
      using LDM/STM or LDRD/STRD instructions on addresses that are not 32-bit
      aligned. This is not something that is supported by the architecture,
      but was done anyway to increase compatibility with user space software,
      which mostly targeted x86 at the time and did not care about aligned
      accesses.
      
      This feature is one of the remaining impediments to being able to switch
      to 64-bit kernels on 64-bit capable hardware running 32-bit user space,
      so let's implement it for the arm64 compat layer as well.
      
      Note that the intent is to implement the exact same handling of
      misaligned multi-word loads and stores as the 32-bit kernel does,
      including what appears to be missing support for user space programs
      that rely on SETEND to switch to a different byte order and back. Also,
      like the 32-bit ARM version, we rely on the faulting address reported by
      the CPU to infer the memory address, instead of decoding the instruction
      fully to obtain this information.
      
      This implementation is taken from the 32-bit ARM tree, with all pieces
      removed that deal with instructions other than LDRD/STRD and LDM/STM, or
      that deal with alignment exceptions taken in kernel mode.
      
      Cc: debian-arm@lists.debian.org
      Cc: Vagrant Cascadian <vagrant@debian.org>
      Cc: Riku Voipio <riku.voipio@iki.fi>
      Cc: Steve McIntyre <steve@einval.com>
      Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
      Link: https://lore.kernel.org/r/20220701135322.3025321-1-ardb@kernel.org
      
      
      [catalin.marinas@arm.com: change the option to 'default n']
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      3fc24ef3
  5. Aug 29, 2022
  6. Aug 28, 2022
  7. Aug 27, 2022