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

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