1. 24 11月, 2022 3 次提交
  2. 18 11月, 2022 1 次提交
  3. 02 11月, 2022 1 次提交
  4. 29 9月, 2022 1 次提交
  5. 04 8月, 2022 1 次提交
  6. 17 5月, 2022 1 次提交
  7. 21 10月, 2021 3 次提交
  8. 19 10月, 2021 2 次提交
  9. 23 7月, 2021 1 次提交
  10. 06 7月, 2021 3 次提交
  11. 15 6月, 2021 2 次提交
  12. 03 6月, 2021 13 次提交
  13. 09 4月, 2021 2 次提交
  14. 19 2月, 2021 1 次提交
    • N
      iommu/vt-d: Do not use flush-queue when caching-mode is on · 208b2434
      Nadav Amit 提交于
      stable inclusion
      from stable-5.10.14
      commit c4e8fa21a30be4656c58c209038b8f4270bf972a
      bugzilla: 48051
      
      --------------------------------
      
      commit 29b32839 upstream.
      
      When an Intel IOMMU is virtualized, and a physical device is
      passed-through to the VM, changes of the virtual IOMMU need to be
      propagated to the physical IOMMU. The hypervisor therefore needs to
      monitor PTE mappings in the IOMMU page-tables. Intel specifications
      provide "caching-mode" capability that a virtual IOMMU uses to report
      that the IOMMU is virtualized and a TLB flush is needed after mapping to
      allow the hypervisor to propagate virtual IOMMU mappings to the physical
      IOMMU. To the best of my knowledge no real physical IOMMU reports
      "caching-mode" as turned on.
      
      Synchronizing the virtual and the physical IOMMU tables is expensive if
      the hypervisor is unaware which PTEs have changed, as the hypervisor is
      required to walk all the virtualized tables and look for changes.
      Consequently, domain flushes are much more expensive than page-specific
      flushes on virtualized IOMMUs with passthrough devices. The kernel
      therefore exploited the "caching-mode" indication to avoid domain
      flushing and use page-specific flushing in virtualized environments. See
      commit 78d5f0f5 ("intel-iommu: Avoid global flushes with caching
      mode.")
      
      This behavior changed after commit 13cf0174 ("iommu/vt-d: Make use
      of iova deferred flushing"). Now, when batched TLB flushing is used (the
      default), full TLB domain flushes are performed frequently, requiring
      the hypervisor to perform expensive synchronization between the virtual
      TLB and the physical one.
      
      Getting batched TLB flushes to use page-specific invalidations again in
      such circumstances is not easy, since the TLB invalidation scheme
      assumes that "full" domain TLB flushes are performed for scalability.
      
      Disable batched TLB flushes when caching-mode is on, as the performance
      benefit from using batched TLB invalidations is likely to be much
      smaller than the overhead of the virtual-to-physical IOMMU page-tables
      synchronization.
      
      Fixes: 13cf0174 ("iommu/vt-d: Make use of iova deferred flushing")
      Signed-off-by: NNadav Amit <namit@vmware.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Lu Baolu <baolu.lu@linux.intel.com>
      Cc: Joerg Roedel <joro@8bytes.org>
      Cc: Will Deacon <will@kernel.org>
      Cc: stable@vger.kernel.org
      Acked-by: NLu Baolu <baolu.lu@linux.intel.com>
      Link: https://lore.kernel.org/r/20210127175317.1600473-1-namit@vmware.comSigned-off-by: NJoerg Roedel <jroedel@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
      Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
      208b2434
  15. 09 2月, 2021 1 次提交
  16. 28 1月, 2021 3 次提交
  17. 27 1月, 2021 1 次提交