thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-intel_iommu-Skip-page-walking-on-device-iotlb-invali.patch

8fced6
From d8f84a8086dbe339a9f97dbcd10abd6379525068 Mon Sep 17 00:00:00 2001
8fced6
From: eperezma <eperezma@redhat.com>
8fced6
Date: Tue, 12 Jan 2021 14:36:37 -0500
8fced6
Subject: [PATCH 13/17] intel_iommu: Skip page walking on device iotlb
8fced6
 invalidations
8fced6
MIME-Version: 1.0
8fced6
Content-Type: text/plain; charset=UTF-8
8fced6
Content-Transfer-Encoding: 8bit
8fced6
8fced6
RH-Author: eperezma <eperezma@redhat.com>
8fced6
Message-id: <20210112143638.374060-13-eperezma@redhat.com>
8fced6
Patchwork-id: 100605
8fced6
O-Subject: [RHEL-8.4.0 qemu-kvm PATCH v2 12/13] intel_iommu: Skip page walking on device iotlb invalidations
8fced6
Bugzilla: 1843852
8fced6
RH-Acked-by: Xiao Wang <jasowang@redhat.com>
8fced6
RH-Acked-by: Peter Xu <peterx@redhat.com>
8fced6
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
8fced6
8fced6
Although they didn't reach the notifier because of the filtering in
8fced6
memory_region_notify_iommu_one, the vt-d was still splitting huge
8fced6
memory invalidations in chunks. Skipping it.
8fced6
8fced6
This improves performance in case of netperf with vhost-net:
8fced6
* TCP_STREAM: From 1923.6Mbit/s to 2175.13Mbit/s (13%)
8fced6
* TCP_RR: From 8464.73 trans/s to 8932.703333 trans/s (5.5%)
8fced6
* UDP_RR: From 8562.08 trans/s to 9005.62/s (5.1%)
8fced6
* UDP_STREAM: No change observed (insignificant 0.1% improvement)
8fced6
8fced6
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
8fced6
Acked-by: Jason Wang <jasowang@redhat.com>
8fced6
Message-Id: <20201116165506.31315-5-eperezma@redhat.com>
8fced6
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
8fced6
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
8fced6
(cherry picked from commit f7701e2c7983b680790af47117577b285b6a1aed)
8fced6
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
8fced6
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
8fced6
---
8fced6
 hw/i386/intel_iommu.c | 4 ++++
8fced6
 1 file changed, 4 insertions(+)
8fced6
8fced6
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
8fced6
index 3640bc2ed15..2b270f06645 100644
8fced6
--- a/hw/i386/intel_iommu.c
8fced6
+++ b/hw/i386/intel_iommu.c
8fced6
@@ -1421,6 +1421,10 @@ static int vtd_sync_shadow_page_table(VTDAddressSpace *vtd_as)
8fced6
     VTDContextEntry ce;
8fced6
     IOMMUNotifier *n;
8fced6
 
8fced6
+    if (!(vtd_as->iommu.iommu_notify_flags & IOMMU_NOTIFIER_IOTLB_EVENTS)) {
8fced6
+        return 0;
8fced6
+    }
8fced6
+
8fced6
     ret = vtd_dev_to_context_entry(vtd_as->iommu_state,
8fced6
                                    pci_bus_num(vtd_as->bus),
8fced6
                                    vtd_as->devfn, &ce);
8fced6
-- 
8fced6
2.27.0
8fced6