1. 26 3月, 2021 1 次提交
    • M
      RDMA: Support more than 255 rdma ports · 1fb7f897
      Mark Bloch 提交于
      Current code uses many different types when dealing with a port of a RDMA
      device: u8, unsigned int and u32. Switch to u32 to clean up the logic.
      
      This allows us to make (at least) the core view consistent and use the
      same type. Unfortunately not all places can be converted. Many uverbs
      functions expect port to be u8 so keep those places in order not to break
      UAPIs.  HW/Spec defined values must also not be changed.
      
      With the switch to u32 we now can support devices with more than 255
      ports. U32_MAX is reserved to make control logic a bit easier to deal
      with. As a device with U32_MAX ports probably isn't going to happen any
      time soon this seems like a non issue.
      
      When a device with more than 255 ports is created uverbs will report the
      RDMA device as having 255 ports as this is the max currently supported.
      
      The verbs interface is not changed yet because the IBTA spec limits the
      port size in too many places to be u8 and all applications that relies in
      verbs won't be able to cope with this change. At this stage, we are
      extending the interfaces that are using vendor channel solely
      
      Once the limitation is lifted mlx5 in switchdev mode will be able to have
      thousands of SFs created by the device. As the only instance of an RDMA
      device that reports more than 255 ports will be a representor device and
      it exposes itself as a RAW Ethernet only device CM/MAD/IPoIB and other
      ULPs aren't effected by this change and their sysfs/interfaces that are
      exposes to userspace can remain unchanged.
      
      While here cleanup some alignment issues and remove unneeded sanity
      checks (mainly in rdmavt),
      
      Link: https://lore.kernel.org/r/20210301070420.439400-1-leon@kernel.orgSigned-off-by: NMark Bloch <mbloch@nvidia.com>
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      1fb7f897
  2. 24 3月, 2021 2 次提交
  3. 23 3月, 2021 1 次提交
  4. 22 3月, 2021 4 次提交
  5. 12 3月, 2021 13 次提交
  6. 11 3月, 2021 2 次提交
  7. 06 3月, 2021 3 次提交
  8. 05 3月, 2021 11 次提交
  9. 04 3月, 2021 3 次提交
    • Z
      iommu/vt-d: Fix status code for Allocate/Free PASID command · 444d66a2
      Zenghui Yu 提交于
      As per Intel vt-d spec, Rev 3.0 (section 10.4.45 "Virtual Command Response
      Register"), the status code of "No PASID available" error in response to
      the Allocate PASID command is 2, not 1. The same for "Invalid PASID" error
      in response to the Free PASID command.
      
      We will otherwise see confusing kernel log under the command failure from
      guest side. Fix it.
      
      Fixes: 24f27d32 ("iommu/vt-d: Enlightened PASID allocation")
      Signed-off-by: NZenghui Yu <yuzenghui@huawei.com>
      Acked-by: NLu Baolu <baolu.lu@linux.intel.com>
      Link: https://lore.kernel.org/r/20210227073909.432-1-yuzenghui@huawei.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      444d66a2
    • L
      iommu: Don't use lazy flush for untrusted device · 82c3cefb
      Lu Baolu 提交于
      The lazy IOTLB flushing setup leaves a time window, in which the device
      can still access some system memory, which has already been unmapped by
      the device driver. It's not suitable for untrusted devices. A malicious
      device might use this to attack the system by obtaining data that it
      shouldn't obtain.
      
      Fixes: c588072b ("iommu/vt-d: Convert intel iommu driver to the iommu ops")
      Signed-off-by: NLu Baolu <baolu.lu@linux.intel.com>
      Link: https://lore.kernel.org/r/20210225061454.2864009-1-baolu.lu@linux.intel.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      82c3cefb
    • N
      iommu/tegra-smmu: Fix mc errors on tegra124-nyan · 765a9d1d
      Nicolin Chen 提交于
      Commit 25938c73 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()")
      removed certain hack in the tegra_smmu_probe() by relying on IOMMU core to
      of_xlate SMMU's SID per device, so as to get rid of tegra_smmu_find() and
      tegra_smmu_configure() that are typically done in the IOMMU core also.
      
      This approach works for both existing devices that have DT nodes and other
      devices (like PCI device) that don't exist in DT, on Tegra210 and Tegra3
      upon testing. However, Page Fault errors are reported on tegra124-Nyan:
      
        tegra-mc 70019000.memory-controller: display0a: read @0xfe056b40:
      	 EMEM address decode error (SMMU translation error [--S])
        tegra-mc 70019000.memory-controller: display0a: read @0xfe056b40:
      	 Page fault (SMMU translation error [--S])
      
      After debugging, I found that the mentioned commit changed some function
      callback sequence of tegra-smmu's, resulting in enabling SMMU for display
      client before display driver gets initialized. I couldn't reproduce exact
      same issue on Tegra210 as Tegra124 (arm-32) differs at arch-level code.
      
      Actually this Page Fault is a known issue, as on most of Tegra platforms,
      display gets enabled by the bootloader for the splash screen feature, so
      it keeps filling the framebuffer memory. A proper fix to this issue is to
      1:1 linear map the framebuffer memory to IOVA space so the SMMU will have
      the same address as the physical address in its page table. Yet, Thierry
      has been working on the solution above for a year, and it hasn't merged.
      
      Therefore, let's partially revert the mentioned commit to fix the errors.
      
      The reason why we do a partial revert here is that we can still set priv
      in ->of_xlate() callback for PCI devices. Meanwhile, devices existing in
      DT, like display, will go through tegra_smmu_configure() at the stage of
      bus_set_iommu() when SMMU gets probed(), as what it did before we merged
      the mentioned commit.
      
      Once we have the linear map solution for framebuffer memory, this change
      can be cleaned away.
      
      [Big thank to Guillaume who reported and helped debugging/verification]
      
      Fixes: 25938c73 ("iommu/tegra-smmu: Rework tegra_smmu_probe_device()")
      Reported-by: NGuillaume Tucker <guillaume.tucker@collabora.com>
      Signed-off-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Tested-by: NGuillaume Tucker <guillaume.tucker@collabora.com>
      Acked-by: NThierry Reding <treding@nvidia.com>
      Link: https://lore.kernel.org/r/20210218220702.1962-1-nicoleotsuka@gmail.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      765a9d1d