1. 16 7月, 2021 3 次提交
  2. 03 6月, 2021 1 次提交
  3. 19 2月, 2021 1 次提交
  4. 29 9月, 2020 1 次提交
  5. 22 9月, 2020 1 次提交
    • R
      iommu/io-pgtable-arm: Clean up faulty sanity check · b9bb694b
      Robin Murphy 提交于
      Checking for a nonzero dma_pfn_offset was a quick shortcut to validate
      whether the DMA == phys assumption could hold at all. Checking for a
      non-NULL dma_range_map is not quite equivalent, since a map may be
      present to describe a limited DMA window even without an offset, and
      thus this check can now yield false positives.
      
      However, it only ever served to short-circuit going all the way through
      to __arm_lpae_alloc_pages(), failing the canonical test there, and
      having a bit more to clean up. As such, we can simply remove it without
      loss of correctness.
      Reported-by: NNaresh Kamboju <naresh.kamboju@linaro.org>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      b9bb694b
  6. 18 9月, 2020 1 次提交
  7. 24 7月, 2020 1 次提交
  8. 09 7月, 2020 1 次提交
  9. 03 3月, 2020 1 次提交
  10. 10 1月, 2020 7 次提交
    • R
      iommu/io-pgtable-arm: Prepare for TTBR1 usage · db690301
      Robin Murphy 提交于
      Now that we can correctly extract top-level indices without relying on
      the remaining upper bits being zero, the only remaining impediments to
      using a given table for TTBR1 are the address validation on map/unmap
      and the awkward TCR translation granule format. Add a quirk so that we
      can do the right thing at those points.
      Tested-by: NJordan Crouse <jcrouse@codeaurora.org>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      db690301
    • W
      iommu/io-pgtable-arm: Rationalise VTCR handling · ac4b80e5
      Will Deacon 提交于
      Commit 05a648cd2dd7 ("iommu/io-pgtable-arm: Rationalise TCR handling")
      reworked the way in which the TCR register value is returned from the
      io-pgtable code when targetting the Arm long-descriptor format, in
      preparation for allowing page-tables to target TTBR1.
      
      As it turns out, the new interface is a lot nicer to use, so do the same
      conversion for the VTCR register even though there is only a single base
      register for stage-2 translation.
      
      Cc: Robin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      ac4b80e5
    • R
      iommu/io-pgtable-arm: Rationalise TCR handling · fb485eb1
      Robin Murphy 提交于
      Although it's conceptually nice for the io_pgtable_cfg to provide a
      standard VMSA TCR value, the reality is that no VMSA-compliant IOMMU
      looks exactly like an Arm CPU, and they all have various other TCR
      controls which io-pgtable can't be expected to understand. Thus since
      there is an expectation that drivers will have to add to the given TCR
      value anyway, let's strip it down to just the essentials that are
      directly relevant to io-pgtable's inner workings - namely the various
      sizes and the walk attributes.
      Tested-by: NJordan Crouse <jcrouse@codeaurora.org>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      [will: Add missing include of bitfield.h]
      Signed-off-by: NWill Deacon <will@kernel.org>
      fb485eb1
    • W
      iommu/io-pgtable-arm: Ensure ARM_64_LPAE_S2_TCR_RES1 is unsigned · 6f932ad3
      Will Deacon 提交于
      ARM_64_LPAE_S2_TCR_RES1 is intended to map to bit 31 of the VTCR register,
      which is required to be set to 1 by the architecture. Unfortunately, we
      accidentally treat this as a signed quantity which means we also set the
      upper 32 bits of the VTCR to one, and they are required to be zero.
      
      Treat ARM_64_LPAE_S2_TCR_RES1 as unsigned to avoid the unwanted
      sign-extension up to 64 bits.
      
      Cc: Robin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      6f932ad3
    • R
      iommu/io-pgtable-arm: Improve attribute handling · 7618e479
      Robin Murphy 提交于
      By VMSA rules, using Normal Non-Cacheable type with a shareability
      attribute of anything other than Outer Shareable is liable to lead into
      unpredictable territory:
      
      | Overlaying the shareability attribute (B3-1377, ARM DDI 0406C.c)
      |
      | A memory region with a resultant memory type attribute of Normal, and
      | a resultant cacheability attribute of Inner Non-cacheable, Outer
      | Non-cacheable, must have a resultant shareability attribute of Outer
      | Shareable, otherwise shareability is UNPREDICTABLE
      
      Although the SMMU architectures seem to give some slightly stronger
      guarantees of Non-Cacheable output types becoming implicitly Outer
      Shareable in most cases, we may as well be explicit and not take any
      chances. It's also weird that LPAE attribute handling is currently split
      between prot_to_pte() and init_pte() given that it can all be statically
      determined up-front. Thus, collect *all* the LPAE attributes into
      prot_to_pte() in order to logically pick the shareability based on the
      incoming IOMMU API prot value, and tweak the short-descriptor code to
      stop setting TTBR0.NOS for Non-Cacheable walks.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      7618e479
    • W
      iommu/io-pgtable-arm: Support non-coherent stage-2 page tables · 30d2acb6
      Will Deacon 提交于
      Commit 9e6ea59f ("iommu/io-pgtable: Support non-coherent page tables")
      added support for non-coherent page-table walks to the Arm IOMMU page-table
      backends. Unfortunately, it left the stage-2 allocator unchanged, so let's
      hook that up in the same way.
      
      Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will@kernel.org>
      30d2acb6
    • R
      iommu/io-pgtable-arm: Rationalise TTBRn handling · d1e5f26f
      Robin Murphy 提交于
      TTBR1 values have so far been redundant since no users implement any
      support for split address spaces. Crucially, though, one of the main
      reasons for wanting to do so is to be able to manage each half entirely
      independently, e.g. context-switching one set of mappings without
      disturbing the other. Thus it seems unlikely that tying two tables
      together in a single io_pgtable_cfg would ever be particularly desirable
      or useful.
      
      Streamline the configs to just a single conceptual TTBR value
      representing the allocated table. This paves the way for future users to
      support split address spaces by simply allocating a table and dealing
      with the detailed TTBRn logistics themselves.
      Tested-by: NJordan Crouse <jcrouse@codeaurora.org>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      [will: Drop change to ttbr value]
      Signed-off-by: NWill Deacon <will@kernel.org>
      d1e5f26f
  11. 07 11月, 2019 1 次提交
    • W
      iommu/io-pgtable-arm: Rename IOMMU_QCOM_SYS_CACHE and improve doc · dd5ddd3c
      Will Deacon 提交于
      The 'IOMMU_QCOM_SYS_CACHE' IOMMU protection flag is exposed to all
      users of the IOMMU API. Despite its name, the idea behind it isn't
      especially tied to Qualcomm implementations and could conceivably be
      used by other systems.
      
      Rename it to 'IOMMU_SYS_CACHE_ONLY' and update the comment to describe
      a bit better the idea behind it.
      
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: "Isaac J. Manjarres" <isaacm@codeaurora.org>
      Signed-off-by: NWill Deacon <will@kernel.org>
      dd5ddd3c
  12. 05 11月, 2019 7 次提交
  13. 01 10月, 2019 3 次提交
  14. 30 7月, 2019 5 次提交
  15. 24 7月, 2019 2 次提交
    • W
      iommu/io-pgtable: Rename iommu_gather_ops to iommu_flush_ops · 298f7889
      Will Deacon 提交于
      In preparation for TLB flush gathering in the IOMMU API, rename the
      iommu_gather_ops structure in io-pgtable to iommu_flush_ops, which
      better describes its purpose and avoids the potential for confusion
      between different levels of the API.
      
      $ find linux/ -type f -name '*.[ch]' | xargs sed -i 's/gather_ops/flush_ops/g'
      Signed-off-by: NWill Deacon <will@kernel.org>
      298f7889
    • W
      iommu/io-pgtable-arm: Remove redundant call to io_pgtable_tlb_sync() · f71da467
      Will Deacon 提交于
      Commit b6b65ca2 ("iommu/io-pgtable-arm: Add support for non-strict
      mode") added an unconditional call to io_pgtable_tlb_sync() immediately
      after the case where we replace a block entry with a table entry during
      an unmap() call. This is redundant, since the IOMMU API will call
      iommu_tlb_sync() on this path and the patch in question mentions this:
      
       | To save having to reason about it too much, make sure the invalidation
       | in arm_lpae_split_blk_unmap() just performs its own unconditional sync
       | to minimise the window in which we're technically violating the break-
       | before-make requirement on a live mapping. This might work out redundant
       | with an outer-level sync for strict unmaps, but we'll never be splitting
       | blocks on a DMA fastpath anyway.
      
      However, this sync gets in the way of deferred TLB invalidation for leaf
      entries and is at best a questionable, unproven hack. Remove it.
      Signed-off-by: NWill Deacon <will@kernel.org>
      f71da467
  16. 25 6月, 2019 2 次提交
  17. 19 6月, 2019 2 次提交
    • T
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 · caab277b
      Thomas Gleixner 提交于
      Based on 1 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license version 2 as
        published by the free software foundation this program is
        distributed in the hope that it will be useful but without any
        warranty without even the implied warranty of merchantability or
        fitness for a particular purpose see the gnu general public license
        for more details you should have received a copy of the gnu general
        public license along with this program if not see http www gnu org
        licenses
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-only
      
      has been chosen to replace the boilerplate/reference in 503 file(s).
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NAlexios Zavras <alexios.zavras@intel.com>
      Reviewed-by: NAllison Randal <allison@lohutok.net>
      Reviewed-by: NEnrico Weigelt <info@metux.net>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190602204653.811534538@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      caab277b
    • V
      iommu/io-pgtable-arm: Add support to use system cache · 90ec7a76
      Vivek Gautam 提交于
      Few Qualcomm platforms such as, sdm845 have an additional outer
      cache called as System cache, aka. Last level cache (LLC) that
      allows non-coherent devices to upgrade to using caching.
      This cache sits right before the DDR, and is tightly coupled
      with the memory controller. The clients using this cache request
      their slices from this system cache, make it active, and can then
      start using it.
      
      There is a fundamental assumption that non-coherent devices can't
      access caches. This change adds an exception where they *can* use
      some level of cache despite still being non-coherent overall.
      The coherent devices that use cacheable memory, and CPU make use of
      this system cache by default.
      
      Looking at memory types, we have following -
      a) Normal uncached :- MAIR 0x44, inner non-cacheable,
                            outer non-cacheable;
      b) Normal cached :-   MAIR 0xff, inner read write-back non-transient,
                            outer read write-back non-transient;
                            attribute setting for coherenet I/O devices.
      and, for non-coherent i/o devices that can allocate in system cache
      another type gets added -
      c) Normal sys-cached :- MAIR 0xf4, inner non-cacheable,
                              outer read write-back non-transient
      
      Coherent I/O devices use system cache by marking the memory as
      normal cached.
      Non-coherent I/O devices should mark the memory as normal
      sys-cached in page tables to use system cache.
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NVivek Gautam <vivek.gautam@codeaurora.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      90ec7a76