Skip to content
  1. Apr 28, 2017
  2. Apr 26, 2017
  3. Apr 25, 2017
  4. Apr 22, 2017
  5. Apr 21, 2017
  6. Apr 19, 2017
  7. Apr 18, 2017
    • Elena Reshetova's avatar
      PCI: hv: Convert hv_pci_dev.refs from atomic_t to refcount_t · 24196f0c
      Elena Reshetova authored
      
      
      refcount_t type and corresponding API should be used instead of atomic_t
      when the variable is used as a reference counter.  This allows to avoid
      accidental refcounter overflows that might lead to use-after-free
      situations.
      
      Signed-off-by: default avatarElena Reshetova <elena.reshetova@intel.com>
      Signed-off-by: default avatarHans Liljestrand <ishkamiel@gmail.com>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarDavid Windsor <dwindsor@gmail.com>
      Reviewed-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
      24196f0c
    • Jayachandran C's avatar
      PCI: Avoid generating invalid ThunderX2 DMA aliases · 45a23293
      Jayachandran C authored
      
      
      On Cavium ThunderX2 arm64 SoCs (formerly known as Broadcom Vulcan), the PCI
      topology is slightly unusual.  For a multi-node system, it looks like:
      
          00:00.0 PCI bridge to [bus 01-1e]
          01:0a.0 PCI-to-PCIe bridge to [bus 02-04]
          02:00.0 PCIe Root Port bridge to [bus 03-04] (XLATE_ROOT)
          03:00.0 PCIe Endpoint
      
      pci_for_each_dma_alias() assumes IOMMU translation is done at the root of
      the PCI hierarchy.  It generates 03:00.0, 01:0a.0, and 00:00.0 as DMA
      aliases for 03:00.0 because buses 01 and 00 are non-PCIe buses that don't
      carry the Requester ID.
      
      Because the ThunderX2 IOMMU is at 02:00.0, the Requester IDs 01:0a.0 and
      00:00.0 are never valid for the endpoint.  This quirk stops alias
      generation at the XLATE_ROOT bridge so we won't generate 01:0a.0 or
      00:00.0.
      
      The current IOMMU code only maps the last alias (this is a separate bug in
      itself).  Prior to this quirk, we only created IOMMU mappings for the
      invalid Requester ID 00:00:0, which never matched any DMA transactions.
      
      With this quirk, we create IOMMU mappings for a valid Requester ID, which
      fixes devices with no aliases but leaves devices with aliases still broken.
      
      The last alias for the endpoint is also used by the ARM GICv3 MSI-X code.
      Without this quirk, the GIC Interrupt Translation Tables are setup with the
      invalid Requester ID, and the MSI-X generated by the device fails to be
      translated and routed.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=195447
      Signed-off-by: default avatarJayachandran C <jnair@caviumnetworks.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Acked-by: default avatarDavid Daney <david.daney@cavium.com>
      45a23293
  8. Apr 14, 2017
    • Jayachandran C's avatar
      PCI: Add device flag PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT · ffff8858
      Jayachandran C authored
      
      
      Add a new quirk flag PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT to limit the DMA alias
      search to go no further than the bridge where the IOMMU unit is attached.
      
      The flag will be used to indicate a bridge device which forwards the
      address translation requests to the IOMMU, i.e., where the interrupt and
      DMA requests leave the PCIe hierarchy and go into the system blocks.
      
      Usually this happens at the PCI RC, so this flag is not needed.  But on
      systems where there are bridges that introduce aliases above the IOMMU,
      this flag prevents pci_for_each_dma_alias() from generating aliases that
      the IOMMU will never see.
      
      The function pci_for_each_dma_alias() is updated to stop when it see a
      bridge with this flag set.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=195447
      Signed-off-by: default avatarJayachandran C <jnair@caviumnetworks.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarRobin Murphy <robin.murphy@arm.com>
      Acked-by: default avatarDavid Daney <david.daney@cavium.com>
      ffff8858
  9. Apr 13, 2017