On Tue, Apr 04, 2023 at 09:23:21PM +0100, Peter Maydell wrote: > On Tue, 4 Apr 2023 at 20:13, Michael S. Tsirkin <m...@redhat.com> wrote: > > > > On Tue, Apr 04, 2023 at 07:00:04PM +0100, Peter Maydell wrote: > > > On Thu, 2 Mar 2023 at 08:26, Michael S. Tsirkin <m...@redhat.com> wrote: > > > > > > > > From: Zhenzhong Duan <zhenzhong.d...@intel.com> > > > > > > > > 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. > > > > > > Hi. This patch seems to have regressed the mps3-an547 board, > > > which now asserts on startup: > > > > > > $ ./build/x86/qemu-system-arm --machine mps3-an547 -serial stdio > > > -kernel /tmp/an547-mwe/build/test.elf > > > qemu-system-arm: ../../softmmu/memory.c:1903: > > > memory_region_register_iommu_notifier: Assertion `n->end <= > > > memory_region_size(mr)' failed. > > > Aborted (core dumped) > > > > > > (reported under https://gitlab.com/qemu-project/qemu/-/issues/1488) > > > > > > Since this commit says it's just an optimization, for the 8.0 > > > release can we simply revert it without breaking anything? > > > Fine to revert by me. Zhenzhong Duan can you pls fix up > > this regression and repost? Maybe fix typos in commit log > > when reposting. Thanks! > > Would somebody also like to send the 'revert' patch, please?
Assuming it's just the technicality of sending it I sent it but it's night here, didn't test at all. Just check it's same as yours and we are good to go ;) > I had that all ready to go, but my git send-email setup > seems to have mysteriously broken and I don't have time to > fix it this evening :-( > > This is the commit message I wrote: > > > Revert "memory: Optimize replay of guest mapping" > > This reverts commit 6da24341866fa940fd7d575788a2319514941c77 > ("memory: Optimize replay of guest mapping"). > > This change breaks the mps3-an547 board under TCG (and > probably other TCG boards using an IOMMU), which now > assert: > > $ ./build/x86/qemu-system-arm --machine mps3-an547 -serial stdio > -kernel /tmp/an547-mwe/build/test.elf > qemu-system-arm: ../../softmmu/memory.c:1903: > memory_region_register_iommu_notifier: Assertion `n->end <= > memory_region_size(mr)' failed. > > This is because tcg_register_iommu_notifier() registers > an IOMMU notifier which covers the entire address space, > so the assertion added in this commit is not correct. > > For the 8.0 release, just revert this commit as it is > only an optimization. > > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> > > > thanks > -- PMM