mbox series

[0/6] memory: Introduce address_space_create(), re-use &address_space_memory

Message ID 20210819142039.2825366-1-philmd@redhat.com
Headers show
Series memory: Introduce address_space_create(), re-use &address_space_memory | expand

Message

Philippe Mathieu-Daudé Aug. 19, 2021, 2:20 p.m. UTC
Introduce address_space_create() (return .heap allocated AddressSpace)
and return directly &address_space_memory if the root MemoryRegion is
get_system_memory().

This simplifies the 'info mtree' output of some boards. Flatview is
unchanged.

Inspired by this thread:
https://www.mail-archive.com/qemu-devel@nongnu.org/msg829819.html

Based-on: <20210819141527.2821842-1-philmd@redhat.com>

Philippe Mathieu-Daudé (6):
  memory: Do not increase refcount on global system_memory region
  memory: Introduce address_space_create()
  memory: Have cpu_address_space_init() use address_space_create()
  hw/dma: Replace alloc() + address_space_init() by
    address_space_create()
  hw/usb: Replace alloc() + address_space_init() by
    address_space_create()
  memory: Have address_space_create() re-use global
    &address_space_memory

 include/exec/memory.h    | 14 ++++++++++++++
 hw/dma/xlnx-zdma.c       | 15 +++++++++------
 hw/dma/xlnx_csu_dma.c    |  9 ++-------
 hw/usb/hcd-xhci-sysbus.c | 16 ++++++++++------
 softmmu/memory.c         | 24 ++++++++++++++++++++++--
 softmmu/physmem.c        |  4 ++--
 6 files changed, 59 insertions(+), 23 deletions(-)