1. 26 7月, 2018 1 次提交
  2. 27 3月, 2018 8 次提交
  3. 17 1月, 2018 1 次提交
  4. 03 1月, 2018 2 次提交
  5. 20 10月, 2017 10 次提交
    • R
      iommu/arm-smmu-v3: Use burst-polling for sync completion · 8ff0f723
      Robin Murphy 提交于
      While CMD_SYNC is unlikely to complete immediately such that we never go
      round the polling loop, with a lightly-loaded queue it may still do so
      long before the delay period is up. If we have no better completion
      notifier, use similar logic as we have for SMMUv2 to spin a number of
      times before each backoff, so that we have more chance of catching syncs
      which complete relatively quickly and avoid delaying unnecessarily.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      8ff0f723
    • W
      iommu/arm-smmu-v3: Consolidate identical timeouts · a529ea19
      Will Deacon 提交于
      We have separate (identical) timeout values for polling for a queue to
      drain and waiting for an MSI to signal CMD_SYNC completion. In reality,
      we only wait for the command queue to drain if we're waiting on a sync,
      so just merged these two timeouts into a single constant.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      a529ea19
    • W
      iommu/arm-smmu-v3: Split arm_smmu_cmdq_issue_sync in half · 49806599
      Will Deacon 提交于
      arm_smmu_cmdq_issue_sync is a little unwieldy now that it supports both
      MSI and event-based polling, so split it into two functions to make things
      easier to follow.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      49806599
    • R
      iommu/arm-smmu-v3: Use CMD_SYNC completion MSI · 37de98f8
      Robin Murphy 提交于
      As an IRQ, the CMD_SYNC interrupt is not particularly useful, not least
      because we often need to wait for sync completion within someone else's
      IRQ handler anyway. However, when the SMMU is both coherent and supports
      MSIs, we can have a lot more fun by not using it as an interrupt at all.
      Following the example suggested in the architecture and using a write
      targeting normal memory, we can let callers wait on a status variable
      outside the lock instead of having to stall the entire queue or even
      touch MMIO registers. Since multiple sync commands are guaranteed to
      complete in order, a simple incrementing sequence count is all we need
      to unambiguously support any realistic number of overlapping waiters.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      37de98f8
    • R
      iommu/arm-smmu-v3: Forget about cmdq-sync interrupt · dce032a1
      Robin Murphy 提交于
      The cmdq-sync interrupt is never going to be particularly useful, since
      for stage 1 DMA at least we'll often need to wait for sync completion
      within someone else's IRQ handler, thus have to implement polling
      anyway. Beyond that, the overhead of taking an interrupt, then still
      having to grovel around in the queue to figure out *which* sync command
      completed, doesn't seem much more attractive than simple polling either.
      
      Furthermore, if an implementation both has wired interrupts and supports
      MSIs, then we don't want to be taking the IRQ unnecessarily if we're
      using the MSI write to update memory. Let's just make life simpler by
      not even bothering to claim it in the first place.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      dce032a1
    • R
      iommu/arm-smmu-v3: Specialise CMD_SYNC handling · 2f657add
      Robin Murphy 提交于
      CMD_SYNC already has a bit of special treatment here and there, but as
      we're about to extend it with more functionality for completing outside
      the CMDQ lock, things are going to get rather messy if we keep trying to
      cram everything into a single generic command interface. Instead, let's
      break out the issuing of CMD_SYNC into its own specific helper where
      upcoming changes will have room to breathe.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      2f657add
    • R
      iommu/arm-smmu-v3: Correct COHACC override message · 2a22baa2
      Robin Murphy 提交于
      Slightly confusingly, when reporting a mismatch of the ID register
      value, we still refer to the IORT COHACC override flag as the
      "dma-coherent property" if we booted with ACPI. Update the message
      to be firmware-agnostic in line with SMMUv2.
      Acked-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Reported-by: NWill Deacon <will.deacon@arm.com>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      2a22baa2
    • Y
      iommu/arm-smmu-v3: Avoid ILLEGAL setting of STE.S1STALLD and CD.S · 9cff86fd
      Yisheng Xie 提交于
      According to Spec, it is ILLEGAL to set STE.S1STALLD if STALL_MODEL
      is not 0b00, which means we should not disable stall mode if stall
      or terminate mode is not configuable.
      
      Meanwhile, it is also ILLEGAL when STALL_MODEL==0b10 && CD.S==0 which
      means if stall mode is force we should always set CD.S.
      
      As Jean-Philippe's suggestion, this patch introduce a feature bit
      ARM_SMMU_FEAT_STALL_FORCE, which means smmu only supports stall force.
      Therefore, we can avoid the ILLEGAL setting of STE.S1STALLD.by checking
      ARM_SMMU_FEAT_STALL_FORCE.
      
      This patch keeps the ARM_SMMU_FEAT_STALLS as the meaning of stall supported
      (force or configuable) to easy to expand the future function, i.e. we can
      only use ARM_SMMU_FEAT_STALLS to check whether we should register fault
      handle or enable master can_stall, etc to supporte platform SVM.
      
      The feature bit, STE.S1STALLD and CD.S setting will be like:
      
      STALL_MODEL  FEATURE                                         S1STALLD CD.S
      0b00         ARM_SMMU_FEAT_STALLS                                 0b1 0b0
      0b01         !ARM_SMMU_FEAT_STALLS && !ARM_SMMU_FEAT_STALL_FORCE  0b0 0b0
      0b10         ARM_SMMU_FEAT_STALLS && ARM_SMMU_FEAT_STALL_FORCE    0b0 0b1
      
      after apply this patch.
      Signed-off-by: NYisheng Xie <xieyisheng1@huawei.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      9cff86fd
    • W
      iommu/arm-smmu-v3: Ensure we sync STE when only changing config field · 704c0382
      Will Deacon 提交于
      The SMMUv3 architecture permits caching of data structures deemed to be
      "reachable" by the SMU, which includes STEs marked as invalid. When
      transitioning an STE to a bypass/fault configuration at init or detach
      time, we mistakenly elide the CMDQ_OP_CFGI_STE operation in some cases,
      therefore potentially leaving the old STE state cached in the SMMU.
      
      This patch fixes the problem by ensuring that we perform the
      CMDQ_OP_CFGI_STE operation irrespective of the validity of the previous
      STE.
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Reported-by: NEric Auger <eric.auger@redhat.com>
      Reviewed-by: NEric Auger <eric.auger@redhat.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      704c0382
    • R
      iommu/arm-smmu: Remove ACPICA workarounds · 6948d4a7
      Robin Murphy 提交于
      Now that the kernel headers have synced with the relevant upstream
      ACPICA updates, it's time to clean up the temporary local definitions.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      6948d4a7
  6. 02 10月, 2017 1 次提交
  7. 17 8月, 2017 1 次提交
  8. 24 6月, 2017 9 次提交
  9. 26 4月, 2017 1 次提交
  10. 20 4月, 2017 1 次提交
  11. 06 4月, 2017 3 次提交
  12. 22 3月, 2017 2 次提交
    • R
      iommu/dma: Make PCI window reservation generic · 273df963
      Robin Murphy 提交于
      Now that we're applying the IOMMU API reserved regions to our IOVA
      domains, we shouldn't need to privately special-case PCI windows, or
      indeed anything else which isn't specific to our iommu-dma layer.
      However, since those aren't IOMMU-specific either, rather than start
      duplicating code into IOMMU drivers let's transform the existing
      function into an iommu_get_resv_regions() helper that they can share.
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      273df963
    • R
      iommu: Disambiguate MSI region types · 9d3a4de4
      Robin Murphy 提交于
      The introduction of reserved regions has left a couple of rough edges
      which we could do with sorting out sooner rather than later. Since we
      are not yet addressing the potential dynamic aspect of software-managed
      reservations and presenting them at arbitrary fixed addresses, it is
      incongruous that we end up displaying hardware vs. software-managed MSI
      regions to userspace differently, especially since ARM-based systems may
      actually require one or the other, or even potentially both at once,
      (which iommu-dma currently has no hope of dealing with at all). Let's
      resolve the former user-visible inconsistency ASAP before the ABI has
      been baked into a kernel release, in a way that also lays the groundwork
      for the latter shortcoming to be addressed by follow-up patches.
      
      For clarity, rename the software-managed type to IOMMU_RESV_SW_MSI, use
      IOMMU_RESV_MSI to describe the hardware type, and document everything a
      little bit. Since the x86 MSI remapping hardware falls squarely under
      this meaning of IOMMU_RESV_MSI, apply that type to their regions as well,
      so that we tell the same story to userspace across all platforms.
      
      Secondly, as the various region types require quite different handling,
      and it really makes little sense to ever try combining them, convert the
      bitfield-esque #defines to a plain enum in the process before anyone
      gets the wrong impression.
      
      Fixes: d30ddcaa ("iommu: Add a new type field in iommu_resv_region")
      Reviewed-by: NEric Auger <eric.auger@redhat.com>
      CC: Alex Williamson <alex.williamson@redhat.com>
      CC: David Woodhouse <dwmw2@infradead.org>
      CC: kvm@vger.kernel.org
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      9d3a4de4