On 21/10/20 00:44, Alex Williamson wrote: > Do we necessarily need a memory map ioctl for this or could it be the > QEMU code that compares the old and new maps to trigger map and unmap > ioctls? For example (aiui) our race is that if we have contiguous > memory regions A and B and flatview_simplify() tries to expand A and > delete B we'll see a series of listener notifications deleting A and B > and adding A'. But the vfio QEMU code could parse the memory map to > determine that old A + B is functionally equivalent to A' and do > nothing.
I think the issue is a bit different, and in fact there are two sides of the same issue. Say you have A (large) and it is replaced by A' (smaller) + B, then: * the first part of A disappears for a moment before A' appears. This is something that QEMU can work around, by not doing anything * the second part of A disappears for a moment before B appears. This is the root API issue and not something that QEMU can work around; and in fact it is not even fixed by removing flatview_simplify. Felix, did you identify the regions whose simplification causes the bug? Is this RAM (for example due to the PAM registers) or something else? Paolo