memory: Optimize replay of guest mapping
authorZhenzhong Duan <zhenzhong.duan@intel.com>
Wed, 15 Feb 2023 06:52:38 +0000 (14:52 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 3 Mar 2023 00:13:52 +0000 (19:13 -0500)
commit6da24341866fa940fd7d575788a2319514941c77
treedd3853fb464808e5efc93ab351e9b51e881b0078
parentb8a7f51f59e28d5a8e0c07ed3919cc9695560ed2
memory: Optimize replay of guest mapping

On x86, there are two notifiers registered due to vtd-ir memory region
splitting the whole address space. During replay of the address space
for each notifier, the whole address space is scanned which is
unnecessory.

We only need to scan the space belong to notifier montiored space.

Assert when notifier is used to monitor beyond iommu memory region's
address space.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Message-Id: <20230215065238.713041-1-zhenzhong.duan@intel.com>
Acked-by: Peter Xu <peterx@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/i386/intel_iommu.c
softmmu/memory.c