Blame SOURCES/kvm-intel-iommu-pass-in-address-space-when-page-walk.patch

357786
From 6e4599e1863990d7f8aa409fb67ca115b99c2fdf Mon Sep 17 00:00:00 2001
357786
From: Peter Xu <peterx@redhat.com>
357786
Date: Mon, 3 Sep 2018 04:52:38 +0200
357786
Subject: [PATCH 23/29] intel-iommu: pass in address space when page walk
357786
357786
RH-Author: Peter Xu <peterx@redhat.com>
357786
Message-id: <20180903045241.6456-7-peterx@redhat.com>
357786
Patchwork-id: 82027
357786
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 6/9] intel-iommu: pass in address space when page walk
357786
Bugzilla: 1623859
357786
RH-Acked-by: Xiao Wang <jasowang@redhat.com>
357786
RH-Acked-by: Auger Eric <eric.auger@redhat.com>
357786
RH-Acked-by: Michael S. Tsirkin <mst@redhat.com>
357786
357786
We pass in the VTDAddressSpace too.  It'll be used in the follow up
357786
patches.
357786
357786
CC: QEMU Stable <qemu-stable@nongnu.org>
357786
Signed-off-by: Peter Xu <peterx@redhat.com>
357786
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
357786
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
357786
(cherry picked from commit 2f764fa87d2a81812b313dd6d998e10126292653)
357786
Signed-off-by: Peter Xu <peterx@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 hw/i386/intel_iommu.c | 4 ++++
357786
 1 file changed, 4 insertions(+)
357786
357786
diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
357786
index e247269..a882894 100644
357786
--- a/hw/i386/intel_iommu.c
357786
+++ b/hw/i386/intel_iommu.c
357786
@@ -754,9 +754,11 @@ typedef int (*vtd_page_walk_hook)(IOMMUTLBEntry *entry, void *private);
357786
  * @hook_fn: hook func to be called when detected page
357786
  * @private: private data to be passed into hook func
357786
  * @notify_unmap: whether we should notify invalid entries
357786
+ * @as: VT-d address space of the device
357786
  * @aw: maximum address width
357786
  */
357786
 typedef struct {
357786
+    VTDAddressSpace *as;
357786
     vtd_page_walk_hook hook_fn;
357786
     void *private;
357786
     bool notify_unmap;
357786
@@ -1463,6 +1465,7 @@ static void vtd_iotlb_page_invalidate_notify(IntelIOMMUState *s,
357786
                     .private = (void *)&vtd_as->iommu,
357786
                     .notify_unmap = true,
357786
                     .aw = s->aw_bits,
357786
+                    .as = vtd_as,
357786
                 };
357786
 
357786
                 /*
357786
@@ -2943,6 +2946,7 @@ static void vtd_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n)
357786
                 .private = (void *)n,
357786
                 .notify_unmap = false,
357786
                 .aw = s->aw_bits,
357786
+                .as = vtd_as,
357786
             };
357786
 
357786
             vtd_page_walk(&ce, 0, ~0ULL, &info;;
357786
-- 
357786
1.8.3.1
357786