1. 03 7月, 2014 4 次提交
    • W
      iommu/arm-smmu: prefer stage-1 mappings where we have a choice · 9c5c92e3
      Will Deacon 提交于
      For an SMMU that supports both Stage-1 and Stage-2 mappings (but not
      nested translation), then we should prefer stage-1 mappings as we
      otherwise rely on the memory attributes of the incoming transactions
      for IOMMU_CACHE mappings.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9c5c92e3
    • W
      iommu/arm-smmu: remove support for chained SMMUs · 44680eed
      Will Deacon 提交于
      The ARM SMMU driver has supported chained SMMUs (i.e. SMMUs connected
      back-to-back in series) via the smmu-parent property in device tree.
      This was in anticipation of somebody building such a configuration,
      however that seems not to be the case.
      
      This patch removes the unused chained SMMU hack from the driver. We can
      consider adding it back later if somebody decided they need it, but for
      the time being it's just pointless mess that we're carrying in mainline.
      
      Removal of the feature also makes migration to the generic IOMMU bindings
      easier.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      44680eed
    • W
      iommu/arm-smmu: caps: add IOMMU_CAP_INTR_REMAP capability · d0948945
      Will Deacon 提交于
      MSIs are just seen as bog standard memory writes by the ARM SMMU, so
      they can be translated (and isolated) in the same way.
      
      This patch adds the IOMMU_CAP_INTR_REMAP capability to the ARM SMMU
      driver and reworks our capabaility code so that we don't assume the
      caps are organised as bits in a bitmask (since this isn't the intention).
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      d0948945
    • W
      iommu/arm-smmu: add support for PCI master devices · a9a1b0b5
      Will Deacon 提交于
      This patch extends the ARM SMMU driver so that it can handle PCI master
      devices in addition to platform devices described in the device tree.
      
      The driver is informed about the PCI host controller in the DT via a
      phandle to the host controller in the mmu-masters property. The host
      controller is then added to the master tree for that SMMU, just like a
      normal master (although it probably doesn't advertise any StreamIDs).
      
      When a device is added to the PCI bus, we set the archdata.iommu pointer
      for that device to describe its StreamID (actually its RequesterID for
      the moment). This allows us to re-use our existing data structures using
      the host controller of_node for everything apart from StreamID
      configuration, where we reach into the archdata for the information we
      require.
      
      Cc: Varun Sethi <varun.sethi@freescale.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      a9a1b0b5
  2. 02 7月, 2014 1 次提交
  3. 02 5月, 2014 2 次提交
  4. 15 4月, 2014 2 次提交
  5. 28 2月, 2014 1 次提交
  6. 25 2月, 2014 4 次提交
  7. 20 2月, 2014 1 次提交
  8. 11 2月, 2014 5 次提交
    • W
      iommu/arm-smmu: fix compilation issue when !CONFIG_ARM_AMBA · d123cf82
      Will Deacon 提交于
      If !CONFIG_ARM_AMBA, we shouldn't try to register ourselves with the
      amba_bustype.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      d123cf82
    • W
      iommu/arm-smmu: set CBARn.BPSHCFG to NSH for s1-s2-bypass contexts · 57ca90f6
      Will Deacon 提交于
      Whilst trying to bring-up an SMMUv2 implementation with the table
      walker plumbed into a coherent interconnect, I noticed that the memory
      transactions targetting the CPU caches from the SMMU were marked as
      outer-shareable instead of inner-shareable.
      
      After a bunch of digging, it seems that we actually need to program
      CBARn.BPSHCFG for s1-s2-bypass contexts to act as non-shareable in order
      for the shareability configured in the corresponding TTBCR not to be
      overridden with an outer-shareable attribute.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      57ca90f6
    • W
      iommu/arm-smmu: fix table flushing during initial allocations · 6dd35f45
      Will Deacon 提交于
      Now that we populate page tables as we traverse them ("iommu/arm-smmu:
      fix pud/pmd entry fill sequence"), we need to ensure that we flush out
      our zeroed tables after initial allocation, to prevent speculative TLB
      fills using bogus data.
      
      This patch adds additional calls to arm_smmu_flush_pgtable during
      initial table allocation, and moves the dsb required by coherent table
      walkers into the helper.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6dd35f45
    • W
      iommu/arm-smmu: really fix page table locking · c9d09e27
      Will Deacon 提交于
      Commit a44a9791 ("iommu/arm-smmu: use mutex instead of spinlock for
      locking page tables") replaced the page table spinlock with a mutex, to
      allow blocking allocations to satisfy lazy mapping requests.
      
      Unfortunately, it turns out that IOMMU mappings are created from atomic
      context (e.g. spinlock held during a dma_map), so this change doesn't
      really help us in practice.
      
      This patch is a partial revert of the offending commit, bringing back
      the original spinlock but replacing our page table allocations for any
      levels below the pgd (which is allocated during domain init) with
      GFP_ATOMIC instead of GFP_KERNEL.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: NAndreas Herrmann <andreas.herrmann@calxeda.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      c9d09e27
    • Y
      iommu/arm-smmu: fix pud/pmd entry fill sequence · 97a64420
      Yifan Zhang 提交于
      The ARM SMMU driver's population of puds and pmds is broken, since we
      iterate over the next level of table repeatedly setting the current
      level descriptor to point at the pmd being initialised. This is clearly
      wrong when dealing with multiple pmds/puds.
      
      This patch fixes the problem by moving the pud/pmd population out of the
      loop and instead performing it when we allocate the next level (like we
      correctly do for ptes already). The starting address for the next level
      is then calculated prior to entering the loop.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NYifan Zhang <zhangyf@marvell.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      97a64420
  9. 17 12月, 2013 3 次提交
  10. 07 12月, 2013 3 次提交
  11. 15 11月, 2013 1 次提交
  12. 09 10月, 2013 7 次提交
  13. 17 9月, 2013 3 次提交
  14. 14 8月, 2013 3 次提交
    • W
      iommu/arm-smmu: Simplify VMID and ASID allocation · ecfadb6e
      Will Deacon 提交于
      We only use ASIDs and VMIDs to identify individual stage-1 and stage-2
      context-banks respectively, so rather than allocate these separately
      from the context-banks, just calculate them based on the context bank
      index.
      
      Note that VMIDs are offset by 1, since VMID 0 is reserved for stage-1.
      This doesn't cause us any issues with the numberspaces, since the
      maximum number of context banks is half the minimum number of VMIDs.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      ecfadb6e
    • W
      iommu/arm-smmu: Don't use VMIDs for stage-1 translations · 1463fe44
      Will Deacon 提交于
      Although permitted by the architecture, using VMIDs for stage-1
      translations causes a complete nightmare for hypervisors, who end up
      having to virtualise the VMID space across VMs, which may be using
      multiple VMIDs each.
      
      To make life easier for hypervisors (which might just decide not to
      support this VMID virtualisation), this patch reworks the stage-1
      context-bank TLB invalidation so that:
      
      	- Stage-1 mappings are marked non-global in the ptes
      	- Each Stage-1 context-bank is assigned an ASID in TTBR0
      	- VMID 0 is reserved for Stage-1 context-banks
      
      This allows the hypervisor to overwrite the Stage-1 VMID in the CBAR
      when trapping the write from the guest.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      1463fe44
    • W
      iommu/arm-smmu: Tighten up global fault reporting · adaba320
      Will Deacon 提交于
      On systems which use a single, combined irq line for the SMMU, context
      faults may result in us spuriously reporting global faults with zero
      status registers.
      
      This patch fixes up the fsr checks in both the context and global fault
      interrupt handlers, so that we only report the fault if the fsr
      indicates something did indeed go awry.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NJoerg Roedel <joro@8bytes.org>
      adaba320