qemu/include/exec
Peter Crosthwaite f0c02d15b5 memory: Add address_space_init_shareable()
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 out in device land
have pointers to the same memory region for their mastering yet
each will need to create its own address space. Let the memory
API implement sharing for them.

Aside from the perf optimisations, this should reduce the amount
of redundant output on info mtree as well.

Thee returned value will be malloced, but the malloc will be
automatically freed when the AS runs out of refs.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
[PMM: dropped check for NULL root as unused; added doc-comment;
 squashed Peter C's reference-counting patch into this one;
 don't compare name string when deciding if we can share ASes;
 read as->malloced before the unref of as->root to avoid possible
 read-after-free if as->root was the owner of as]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Acked-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
2016-01-21 14:15:06 +00:00
..
user linux-user: Allocate thunk size dynamically 2015-06-15 11:36:58 +03:00
address-spaces.h exec: move include files to include/exec/ 2012-12-19 08:31:31 +01:00
cpu_ldst_template.h softmmu: add helper function to pass through retaddr 2015-09-11 08:15:32 -07:00
cpu_ldst_useronly_template.h softmmu: add helper function to pass through retaddr 2015-09-11 08:15:32 -07:00
cpu_ldst.h softmmu: remove now unused functions 2015-09-11 08:16:05 -07:00
cpu-all.h translate-all: ensure host page mask is always extended with 1's 2015-12-02 13:12:30 +01:00
cpu-common.h qemu_ram_block_by_name 2015-11-10 14:51:48 +01:00
cpu-defs.h cpu_defs: Simplify CPUTLB padding logic 2015-08-06 12:04:08 +02:00
cputlb.h include/exec: Move cputlb exec.c defs out 2015-09-16 17:33:33 +02:00
exec-all.h exec.c: Add cpu_get_address_space() 2016-01-21 14:15:05 +00:00
gdbstub.h gdbstub: Implement gdb_do_syscallv() 2015-09-07 10:39:27 +01:00
gen-icount.h tcg: Change translator-side labels to a pointer 2015-03-13 12:28:18 -07:00
helper-gen.h trace: [tcg] Include TCG-tracing helpers 2014-08-12 14:26:12 +01:00
helper-head.h tcg: Move size effects out of dh_arg 2014-05-28 09:33:55 -07:00
helper-proto.h trace: [tcg] Include TCG-tracing helpers 2014-08-12 14:26:12 +01:00
helper-tcg.h trace: [tcg] Include TCG-tracing helpers 2014-08-12 14:26:12 +01:00
hwaddr.h hwaddr: Make hwaddr type usable beyond softmmu 2013-06-28 13:25:13 +02:00
ioport.h portio: Allow to mark portio lists as coalesced MMIO flushing 2013-10-17 17:24:15 +02:00
memattrs.h hw/pci: Introduce pci_requester_id() 2015-10-19 10:13:07 +02:00
memory-internal.h memory: unregister AddressSpace MemoryListener within BQL 2015-02-10 10:25:44 -07:00
memory.h memory: Add address_space_init_shareable() 2016-01-21 14:15:06 +00:00
poison.h exec: Remove env from list of poisoned names 2013-07-27 11:22:54 +04:00
ram_addr.h ivshmem: Store file descriptor for vhost-user negotiation 2016-01-09 23:20:20 +02:00
semihost.h semihosting: add --semihosting-config arg sub-argument 2015-06-19 14:17:45 +01:00
softmmu-semi.h include/exec/softmmu-semi.h: Add support for 64-bit values 2015-09-07 10:39:27 +01:00
tb-hash.h cpu-defs: Move out TB_JMP defines 2015-06-26 16:00:51 +02:00