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

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