Re: [Qemu-devel] [PATCH 11/16] memory: Add address_space_init_shareable()

2015-11-09 Thread Paolo Bonzini
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

Re: [Qemu-devel] [PATCH 11/16] memory: Add address_space_init_shareable()

2015-11-09 Thread Peter Maydell
On 9 November 2015 at 10:55, Paolo Bonzini wrote: > > > On 05/11/2015 19:15, Peter Maydell wrote: >> +AddressSpace *address_space_init_shareable(MemoryRegion *root, const char >> *name) >> +{ >> +AddressSpace *as; >> + >> +QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) { >> +

Re: [Qemu-devel] [PATCH 11/16] memory: Add address_space_init_shareable()

2015-11-09 Thread Paolo Bonzini
On 05/11/2015 19:15, Peter Maydell wrote: > +AddressSpace *address_space_init_shareable(MemoryRegion *root, const char > *name) > +{ > +AddressSpace *as; > + > +QTAILQ_FOREACH(as, &address_spaces, address_spaces_link) { > +if (root == as->root) { > +as->ref_count++; >

Re: [Qemu-devel] [PATCH 11/16] memory: Add address_space_init_shareable()

2015-11-06 Thread Peter Maydell
On 6 November 2015 at 14:29, Edgar E. Iglesias wrote: > On Thu, Nov 05, 2015 at 06:15:53PM +, Peter Maydell wrote: >> +AddressSpace *address_space_init_shareable(MemoryRegion *root, const char >> *name) >> +{ >> +AddressSpace *as; >> + >> +QTAILQ_FOREACH(as, &address_spaces, address_

Re: [Qemu-devel] [PATCH 11/16] memory: Add address_space_init_shareable()

2015-11-06 Thread Edgar E. Iglesias
On Thu, Nov 05, 2015 at 06:15:53PM +, Peter Maydell wrote: > From: Peter Crosthwaite > > This will either create a new AS or return a pointer to an > already existing equivalent one, if we have already created > an AS for the specified root memory region. > > The motivation is to reuse addre

[Qemu-devel] [PATCH 11/16] memory: Add address_space_init_shareable()

2015-11-05 Thread Peter Maydell
From: Peter Crosthwaite This will either create a new AS or return a pointer to an already existing equivalent one, if we have already created an AS for the specified root memory region. The motivation is to reuse address spaces as much as possible. It's going to be quite common that bus masters