On Mon, Oct 10, 2022 at 08:20:29PM -0400, Peter Xu wrote: > On Mon, Oct 10, 2022 at 11:58:22PM +0000, Oliver Upton wrote: > > I think this further drives the point home -- there's zero need for the > > bitmap with dirty ring on x86, so why even support it? The proposal of > > ALLOW_BITMAP && DIRTY_RING should be arm64-specific. Any other arch that > > needs to dirty memory outside of a vCPU context can opt-in to the > > behavior. > > Yeah that sounds working too, but it'll be slightly hackish as then the > user app will need some "#ifdef ARM64" blocks for e.g. sync dirty bitmap. > With the new cap the user app can implement the whole ring with generic > code. Isn't the current route of exposing ALLOW_BITMAP on other arches for no reason headed in exactly that direction? Userspace would need to know if it _really_ needs the dirty bitmap in addition to the dirty ring, which could take the form of architecture ifdeffery. OTOH, if the cap is only exposed when it is absolutely necessary, an arch-generic live migration implementation could enable the cap whenever it is advertized and scan the bitmap accordingly. The VMM must know something about the architecture it is running on, as it calls KVM_DEV_ARM_ITS_SAVE_TABLES after all... > Also more flexible to expose it as generic cap? E.g., one day x86 can > enable this too for whatever reason (even though I don't think so..). I had imagined something like this patch where the arch opts-in to some generic construct if it *requires* the use of both the ring and bitmap (very rough sketch). -- Thanks, Oliver