1. 17 12月, 2015 2 次提交
  2. 22 10月, 2015 1 次提交
  3. 15 10月, 2015 1 次提交
  4. 14 10月, 2015 2 次提交
  5. 06 8月, 2015 2 次提交
  6. 31 7月, 2015 1 次提交
    • R
      iommu/arm-smmu: Sort out coherency · bae2c2d4
      Robin Murphy 提交于
      Currently, we detect whether the SMMU has coherent page table walk
      capability from the IDR0.CTTW field, and base our cache maintenance
      decisions on that. In preparation for fixing the bogus DMA API usage,
      however, we need to ensure that the DMA API agrees about this, which
      necessitates deferring to the dma-coherent property in the device tree
      for the final say.
      
      As an added bonus, since systems exist where an external CTTW signal
      has been tied off incorrectly at integration, allowing DT to override
      it offers a neat workaround for coherency issues with such SMMUs.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      bae2c2d4
  7. 30 6月, 2015 1 次提交
  8. 29 5月, 2015 2 次提交
  9. 12 5月, 2015 1 次提交
    • W
      iommu/arm-smmu: Fix sign-extension of upstream bus addresses at stage 1 · 5dc5616e
      Will Deacon 提交于
      Stage 1 translation is controlled by two sets of page tables (TTBR0 and
      TTBR1) which grow up and down from zero respectively in the ARMv8
      translation regime. For the SMMU, we only care about TTBR0 and, in the
      case of a 48-bit virtual space, we expect to map virtual addresses 0x0
      through to 0xffff_ffff_ffff.
      
      Given that some masters may be incapable of emitting virtual addresses
      targetting TTBR1 (e.g. because they sit on a 48-bit bus), the SMMU
      architecture allows bit 47 to be sign-extended, halving the virtual
      range of TTBR0 but allowing TTBR1 to be used. This is controlled by the
      SEP field in TTBCR2.
      
      The SMMU driver incorrectly enables this sign-extension feature, which
      causes problems when userspace addresses are programmed into a master
      device with the SMMU expecting to map the incoming transactions via
      TTBR0; if the top bit of address is set, we will instead get a
      translation fault since TTBR1 walks are disabled in the TTBCR.
      
      This patch fixes the issue by disabling sign-extension of a fixed
      virtual address bit and instead basing the behaviour on the upstream bus
      size: the incoming address is zero extended unless the upstream bus is
      only 49 bits wide, in which case bit 48 is used as the sign bit and is
      replicated to the upper bits.
      
      Cc: <stable@vger.kernel.org> # v4.0+
      Reported-by: NVarun Sethi <varun.sethi@freescale.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      5dc5616e
  10. 31 3月, 2015 1 次提交
  11. 27 3月, 2015 3 次提交
  12. 23 3月, 2015 1 次提交
  13. 04 2月, 2015 1 次提交
  14. 20 1月, 2015 1 次提交
    • M
      iommu/arm-smmu: add support for iova_to_phys through ATS1PR · 859a732e
      Mitchel Humpherys 提交于
      Currently, we provide the iommu_ops.iova_to_phys service by doing a
      table walk in software to translate IO virtual addresses to physical
      addresses. On SMMUs that support it, it can be useful to ask the SMMU
      itself to do the translation. This can be used to warm the TLBs for an
      SMMU. It can also be useful for testing and hardware validation.
      
      Since the address translation registers are optional on SMMUv2, only
      enable hardware translations when using SMMUv1 or when SMMU_IDR0.S1TS=1
      and SMMU_IDR0.ATOSNS=0, as described in the ARM SMMU v1-v2 spec.
      Signed-off-by: NMitchel Humpherys <mitchelh@codeaurora.org>
      [will: reworked on top of generic iopgtbl changes]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      859a732e
  15. 19 1月, 2015 2 次提交
  16. 14 11月, 2014 4 次提交
  17. 04 11月, 2014 1 次提交
    • O
      iommu: Add iommu_map_sg() function · 315786eb
      Olav Haugan 提交于
      Mapping and unmapping are more often than not in the critical path.
      map_sg allows IOMMU driver implementations to optimize the process
      of mapping buffers into the IOMMU page tables.
      
      Instead of mapping a buffer one page at a time and requiring potentially
      expensive TLB operations for each page, this function allows the driver
      to map all pages in one go and defer TLB maintenance until after all
      pages have been mapped.
      
      Additionally, the mapping operation would be faster in general since
      clients does not have to keep calling map API over and over again for
      each physically contiguous chunk of memory that needs to be mapped to a
      virtually contiguous region.
      Signed-off-by: NOlav Haugan <ohaugan@codeaurora.org>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      315786eb
  18. 20 10月, 2014 1 次提交
  19. 25 9月, 2014 2 次提交
  20. 22 9月, 2014 1 次提交
  21. 17 9月, 2014 7 次提交
    • R
      iommu/arm-smmu: support MMU-401 · d3aba046
      Robin Murphy 提交于
      MMU-401 is similar to MMU-400, but updated with limited ARMv8 support.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      d3aba046
    • R
      iommu/arm-smmu: fix architecture version detection · 09360403
      Robin Murphy 提交于
      The SMMU driver was relying on a quirk of MMU-500 r2px to identify
      the correct architecture version. Since this does not apply to other
      implementations, make the architecture version for each supported
      implementation explicit.
      
      While we're at it, remove the unnecessary #ifdef since the dependencies
      for CONFIG_ARM_SMMU already imply CONFIG_OF.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      09360403
    • W
      iommu/arm-smmu: don't bother truncating the s1 output size to VA_BITS · 28d6007b
      Will Deacon 提交于
      In order for nested translation to work correctly, we need to ensure
      that the maximum output address size from stage-1 is <= the maximum
      supported input address size to stage-2. The latter is currently defined
      by VA_BITS, since we make use of the CPU page table functions for
      allocating out tables and so the driver currently enforces this
      restriction by truncating the stage-1 output size during probe.
      
      In reality, this doesn't make a lot of sense; the guest OS is responsible
      for managing the stage-1 page tables, so we actually just need to ensure
      that the ID registers of the virtual SMMU interface only advertise the
      supported stage-2 input size.
      
      This patch fixes the problem by treating the stage-1 and stage-2 input
      address sizes separately.
      Reported-by: NTirumalesh Chalamarla <tchalamarla@cavium.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      28d6007b
    • W
      iommu/arm-smmu: use page shift instead of page size to avoid division · c757e852
      Will Deacon 提交于
      Arbitrary integer division is not available in all ARM CPUs, so the GCC
      may spit out calls to helper functions which are not implemented in
      the kernel.
      
      This patch avoids these problems in the SMMU driver by using page shift
      instead of page size, so that divisions by the page size (as required
      by the vSMMU code) can be expressed as a simple right shift.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      c757e852
    • W
      iommu/arm-smmu: put iommu_domain pointer in dev->archdata.iommu · 844e35bd
      Will Deacon 提交于
      In preparation for nested translation support, stick a pointer to the
      iommu_domain in dev->archdata.iommu. This makes it much easier to grab
      hold of the physical group configuration (e.g. cbndx) when dealing with
      vSMMU accesses from a guest.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      844e35bd
    • W
      iommu/arm-smmu: add support for multi-master iommu groups · 8f68f8e2
      Will Deacon 提交于
      Whilst the driver currently creates one IOMMU group per device, this
      will soon change when we start supporting non-transparent PCI bridges
      which require all upstream masters to be assigned to the same address
      space.
      
      This patch reworks our IOMMU group code so that we can easily support
      multi-master groups. The master configuration (streamids and smrs) is
      stored as private iommudata on the group, whilst the low-level attach/detach
      code is updated to avoid double alloc/free when dealing with multiple
      masters sharing the same SMMU configuration. This unifies device
      handling, regardless of whether the device sits on the platform or pci
      bus.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8f68f8e2
    • W
      iommu/arm-smmu: allow translation stage to be forced on the cmdline · 4cf740b0
      Will Deacon 提交于
      When debugging and testing code on an SMMU that supports nested
      translation, it can be useful to restrict the driver to a particular
      stage of translation.
      
      This patch adds a module parameter to the ARM SMMU driver to allow this
      by restricting the ability of the probe() code to detect support for
      only the specified stage.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      4cf740b0
  22. 02 9月, 2014 2 次提交