On 06/11/2015 14:34, Peter Maydell wrote: >> > IIUC, g_renew may move the entire cpu_ases area. The internals of >> > memory_listener_register (called below) seem to put away the pointers to >> > listeners >> > so a renew+move would leave invalid pointers to listeners in memory.c >> > wouldn't it? >> > >> > There are various ways of solving this, (e.g dynamic allocation of the >> > listener, >> > static allocation of the cpu_ases, invalidate all listeners and restore >> > them after >> > each as init and more). I'm sure you'll figure something out. > Oops, yes, you're right. > > Maybe we should just have the target CPU say in advance what the > maximum number of AddressSpaces it will have is -- my expectation > is that this will be (a) small (b) known in advance anyway.
I agree. Or even just allocate room statically, for the largest amount that all targets in QEMU use. My expectation is that this will be 2. :) Paolo