On 09/11/2015 11:59, Peter Maydell wrote: >>> >> + as = g_malloc0(sizeof *as); >>> >> + address_space_init(as, root, name); >>> >> + as->malloced = true; >>> >> + return as; >>> >> } >> > >> > You shouldn't return a non-shareable address space here, I think, >> > because it might be contained into another object and that object might >> > disappear. I haven't thought this through very much, but adding an " && >> > as->malloced" to the conditional seems easy and safe. > That would prevent sharing the system address space, which is one > you really commonly want to share. I guess we could make that one > be alloced-shareable.
You would only allocate one duplicate of the system address space though. The second call to address_space_init_shareable would not create a new AS. Paolo