> > If cpu-memory address space is same as memory address space, > > use memory address space for cpu-memory address space. > > > > any memory region change causeaddress space to rebuild PhysPageMap, > > rebuilding PhysPageMap is very expensive. > > > > removing cpu-memory address space reduces the guest boot time and > > memory usage. > > > > Signed-off-by: Anthony Xu <anthony...@intel.com> > > --- > > cpus.c | 9 +++++++-- > > 1 file changed, 7 insertions(+), 2 deletions(-) > > > > diff --git a/cpus.c b/cpus.c > > index 740b8dc..15c7a6a 100644 > > --- a/cpus.c > > +++ b/cpus.c > > @@ -1748,8 +1748,13 @@ void qemu_init_vcpu(CPUState *cpu) > > /* If the target cpu hasn't set up any address spaces itself, > > * give it the default one. > > */ > > - AddressSpace *as = address_space_init_shareable(cpu->memory, > > - "cpu-memory"); > > + AddressSpace *as; > > + if (cpu->memory == address_space_memory.root) { > > + address_space_memory.ref_count++; > probably this would cause reference leak when vcpu is destroyed
I thought address_space_destroy is called when vcpu is unplugged, seems that's not the case, then ref_count++ is not needed. Any other comments? Thanks, Anthony