diff mbox series

[v3,3/5] intel_iommu: Fix flag check in replay

Message ID 20230608095231.225450-4-zhenzhong.duan@intel.com (mailing list archive)
State New, archived
Headers show
Series Optimize UNMAP call and bug fix | expand

Commit Message

Duan, Zhenzhong June 8, 2023, 9:52 a.m. UTC
Replay doesn't notify registered notifiers but the one passed
to it. So it's meaningless to check the registered notifier's
synthetic flag.

There is no issue currently as all replay use cases have MAP
flag set, but let's be robust.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 hw/i386/intel_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Xu June 8, 2023, 1:43 p.m. UTC | #1
On Thu, Jun 08, 2023 at 05:52:29PM +0800, Zhenzhong Duan wrote:
> Replay doesn't notify registered notifiers but the one passed
> to it. So it's meaningless to check the registered notifier's
> synthetic flag.
> 
> There is no issue currently as all replay use cases have MAP
> flag set, but let's be robust.
> 
> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>

Reviewed-by: Peter Xu <peterx@redhat.com>
diff mbox series

Patch

diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c
index 34af12f392f5..f046f8591335 100644
--- a/hw/i386/intel_iommu.c
+++ b/hw/i386/intel_iommu.c
@@ -3837,7 +3837,7 @@  static void vtd_iommu_replay(IOMMUMemoryRegion *iommu_mr, IOMMUNotifier *n)
                                   PCI_FUNC(vtd_as->devfn),
                                   vtd_get_domain_id(s, &ce, vtd_as->pasid),
                                   ce.hi, ce.lo);
-        if (vtd_as_has_map_notifier(vtd_as)) {
+        if (n->notifier_flags & IOMMU_NOTIFIER_MAP) {
             /* This is required only for MAP typed notifiers */
             vtd_page_walk_info info = {
                 .hook_fn = vtd_replay_hook,