Skip to content

RFC Memory API

Avi Kivity kvm qemu-devel 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 RFC Latest86 patches 28 repliesIn review
  2. v4 RFC58 patches 45 repliesSuperseded
  3. v3 RFC56 patches 9 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v2 RFC20 patches21 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/86xen: fix xen-mapcache build on non-Xen capable targetsxen-mapcache.h+32 -00 replies
2/86Hierarchical memory region APIMakefile.target memory.c memory.h+856 -00 replies
3/86memory: implement dirty trackingmemory.c memory.h+32 -80 replies
4/86memory: merge adjacent segments of a single memory regionmemory.c+22 -00 replies
5/86Internal interfaces for memory APIexec-memory.h memory.c+30 -00 replies
6/86memory: abstract address space operationsmemory.c+81 -300 replies
7/86memory: rename MemoryRegion::has_ram_addr to ::terminatesmemory.c memory.h+10 -100 replies
8/86memory: late initialization of ram_addrmemory.c memory.h+21 -40 replies
9/86memory: I/O address space supportexec-memory.h memory.c memory.h+64 -10 replies
10/86memory: add backward compatibility for old portio registrationmemory.c memory.h+49 -00 replies
11/86memory: add backward compatibility for old mmio registrationmemory.c memory.h+20 -00 replies
12/86memory: add ioeventfd supportmemory.c memory.h+238 -02 replies
13/86memory: separate building the final memory map into two stepsmemory.c+29 -90 replies
14/86exec.c: initialize memory mapexec.c+19 -00 replies
15/86ioport: register ranges by byte aligned addresses alwaysioport.c+2 -20 replies
16/86pc: grab system_memoryhw/pc.c hw/pc.h hw/pc_piix.c+12 -30 replies
17/86pc: convert pc_memory_init() to memory APIhw/pc.c hw/pc.h+41 -190 replies
18/86pc: move global memory map out of pc_init1() and into its callershw/pc_piix.c+8 -70 replies
19/86pci: pass address space to pci bus when createdhw/apb_pci.c hw/bonito.c hw/grackle_pci.c +19 more+85 -350 replies
20/86pci: add MemoryRegion based BAR management APIhw/pci.c hw/pci.h+42 -80 replies
21/86sysbus: add MemoryRegion based memory management APIhw/sysbus.c hw/sysbus.h+27 -30 replies
22/86usb-ohci: convert to MemoryRegionhw/usb-ohci.c+17 -250 replies
23/86pci: add API to get a BAR's mapped addresshw/pci.c hw/pci.h+6 -00 replies
24/86vmsvga: don't remember pci BAR address in callback any morehw/vmware_vga.c+6 -60 replies
25/86vga: convert vga and its derivatives to the memory APIhw/cirrus_vga.c hw/qxl-render.c hw/qxl.c +7 more+441 -4350 replies
26/86cirrus: simplify mmio BAR access functionshw/cirrus_vga.c+8 -700 replies
27/86cirrus: simplify bitblt BAR access functionshw/cirrus_vga.c+13 -680 replies
28/86cirrus: simplify vga window mmio access functionshw/cirrus_vga.c+11 -680 replies
29/86vga: simplify vga window mmio access functionshw/cirrus_vga.c hw/vga.c hw/vga_int.h+12 -520 replies
30/86cirrus: simplify linear framebuffer access functionshw/cirrus_vga.c+8 -660 replies
31/86Integrate I/O memory regions into qemuexec-memory.h exec.c+12 -00 replies
32/86exec.c: fix initialization of system I/O memory regionexec.c+1 -10 replies
33/86pci: pass I/O address space to new PCI bushw/apb_pci.c hw/bonito.c hw/grackle_pci.c +17 more+91 -380 replies
34/86pci: allow I/O BARs to be registered with pci_register_bar_region()hw/pci.c hw/pci.h hw/pci_internals.h+26 -210 replies
35/86rtl8139: convert to memory APIhw/rtl8139.c+38 -340 replies
36/86ac97: convert to memory APIhw/ac97.c+51 -370 replies
37/86e1000: convert to memory APIhw/e1000.c+48 -660 replies
38/86eepro100: convert to memory APIhw/eepro100.c+37 -1450 replies
39/86es1370: convert to memory APIhw/es1370.c+25 -180 replies
40/86ide: convert to memory APIhw/ide/cmd646.c hw/ide/pci.c hw/ide/pci.h +2 more+261 -1200 replies
41/86ivshmem: convert to memory APIhw/ivshmem.c+50 -980 replies
42/86virtio-pci: convert to memory APIhw/virtio-pci.c hw/virtio-pci.h+31 -450 replies
43/86ahci: convert to memory APIhw/ide/ahci.c hw/ide/ahci.h hw/ide/ich.c+15 -210 replies
44/86intel-hda: convert to memory APIhw/intel-hda.c+19 -160 replies
45/86lsi53c895a: convert to memory APIhw/lsi53c895a.c+56 -2020 replies
46/86ppc: convert to memory APIhw/cuda.c hw/escc.c hw/escc.h +12 more+201 -2170 replies
47/86ne2000: convert to memory APIhw/ne2000-isa.c hw/ne2000.c hw/ne2000.h+59 -400 replies
48/86pcnet: convert to memory APIhw/lance.c hw/pcnet-pci.c hw/pcnet.h+61 -480 replies
49/86i6300esb: convert to memory APIhw/wdt_i6300esb.c+29 -140 replies
50/86isa-mmio: concert to memory APIhw/isa.h hw/isa_mmio.c+17 -150 replies
51/86sun4u: convert to memory APIhw/sun4u.c+23 -280 replies
52/86ehci: convert to memory APIhw/usb-ehci.c+9 -270 replies
53/86uhci: convert to memory APIhw/usb-uhci.c+28 -140 replies
54/86xen-platform: convert to memory APIhw/xen_platform.c+51 -320 replies
55/86msix: convert to memory APIhw/ivshmem.c hw/msix.c hw/msix.h +3 more+42 -580 replies
56/86pci: remove pci_register_bar_simple()hw/pci.c hw/pci.h+0 -200 replies
57/86pci: convert pci rom to memory APIhw/pci.c hw/pci.h+9 -140 replies
58/86pci: remove pci_register_bar()hw/pci.c hw/pci.h+17 -280 replies
59/86pci: fold BAR mapping function into its callerhw/pci.c hw/pci.h+9 -170 replies
60/86pci: rename pci_register_bar_region() to pci_register_bar()hw/ac97.c hw/cirrus_vga.c hw/e1000.c +26 more+68 -880 replies
61/86pci: remove support for pre memory API BARshw/pci.c+2 -310 replies
62/86Introduce QEMU_NEW()qemu-common.h+3 -00 replies
63/86apb_pci: convert to memory APIhw/apb_pci.c+37 -460 replies
64/86apic: convert to memory APIhw/apic.c+10 -150 replies
65/86arm_gic: convert to memory APIhw/arm_gic.c hw/armv7m_nvic.c hw/mpcore.c +1 more+45 -560 replies
66/86arm_sysctl: convert to memory APIhw/arm_sysctl.c+10 -170 replies
67/86arm_timer: convert to memory APIhw/arm_timer.c+20 -350 replies
68/86armv7m: convert to memory APIhw/armv7m.c+10 -140 replies
69/86gt64xxx.c: convert to memory APIhw/gt64xxx.c+15 -210 replies
70/86tusb6010: move declarations to new file tusb6010.hhw/devices.h hw/nseries.c hw/tusb6010.c +1 more+12 -80 replies
71/86omap_gpmc/nseries/tusb6010: convert to memory APIhw/omap.h hw/omap_gpmc.c hw/tusb6010.c +1 more+50 -440 replies
72/86onenand: convert to memory APIhw/onenand.c+38 -320 replies
73/86pcie_host: convert to memory APIhw/pcie_host.c hw/pcie_host.h+31 -790 replies
74/86ppc405_uc: convert to memory APIhw/ppc405_uc.c+52 -650 replies
75/86ppc4xx_sdram: convert to memory APIhw/ppc405.h hw/ppc405_boards.c hw/ppc405_uc.c +3 more+70 -290 replies
76/86stellaris_enet: convert to memory APIhw/stellaris_enet.c+12 -170 replies
77/86sysbus: add a variant of sysbus_init_mmio_cb with an unmap callbackhw/sysbus.c hw/sysbus.h+18 -00 replies
78/86sh_pci: convert to memory APIhw/sh_pci.c+42 -210 replies
79/86arm11mpcore: use sysbus_init_mmio_cb2hw/arm11mpcore.c+6 -10 replies
80/86versatile_pci: convert to memory APIhw/versatile_pci.c+44 -500 replies
81/86ppce500_pci: convert to sysbus_init_mmio_cb2()hw/ppce500_pci.c+11 -10 replies
82/86sysbus: remove sysbus_init_mmio_cb()hw/sysbus.c hw/sysbus.h+0 -140 replies
83/86isa: add isa_address_space()hw/isa-bus.c hw/isa.h+8 -00 replies
84/86pci: add pci_address_space()hw/pci.c hw/pci.h+6 -00 replies
85/86vga: drop get_system_memory() from vga devices and derivativeshw/cirrus_vga.c hw/mips_jazz.c hw/pc.c +8 more+39 -380 replies
86/86440fx: fix PAM, PCI holeshw/pc.c hw/pc.h hw/pc_piix.c +1 more+113 -4616 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [RFC v5 00/86] Memory API

New in this version:
- more mindless conversions; I believe there are no longer any destructive operations in the tree (IO_MEM_UNASSIGNED)
- fix memory map generation bug (patch 13)
- proper 440FX PAM/SMRAM and PCI holes

Caveats:
- some devices (mostly boards) still grab a global memory region instead of inheriting it from their bus. Seen in the code as #include "exec-memory.h"
- pc RAM initialization is a mess - needs to be refactored; this is because memory is set up before the memory controller.

Avi Kivity (86):
xen: fix xen-mapcache build on non-Xen capable targets Hierarchical memory region API
memory: implement dirty tracking
memory: merge adjacent segments of a single memory region Internal interfaces for memory API
memory: abstract address space operations
memory: rename MemoryRegion::has_ram_addr to ::terminates
memory: late initialization of ram_addr
memory: I/O address space support
memory: add backward compatibility for old portio registration
memory: add backward compatibility for old mmio registration
memory: add ioeventfd support
memory: separate building the final memory map into two steps exec.c: initialize memory map
ioport: register ranges by byte aligned addresses always
pc: grab system_memory
pc: convert pc_memory_init() to memory API
pc: move global memory map out of pc_init1() and into its callers
pci: pass address space to pci bus when created
pci: add MemoryRegion based BAR management API
sysbus: add MemoryRegion based memory management API
usb-ohci: convert to MemoryRegion
pci: add API to get a BAR's mapped address
vmsvga: don't remember pci BAR address in callback any more
vga: convert vga and its derivatives to the memory API
cirrus: simplify mmio BAR access functions
cirrus: simplify bitblt BAR access functions
cirrus: simplify vga window mmio access functions
vga: simplify vga window mmio access functions
cirrus: simplify linear framebuffer access functions Integrate I/O memory regions into qemu
exec.c: fix initialization of system I/O memory region
pci: pass I/O address space to new PCI bus
pci: allow I/O BARs to be registered with pci_register_bar_region()
rtl8139: convert to memory API
ac97: convert to memory API
e1000: convert to memory API
eepro100: convert to memory API
es1370: convert to memory API
ide: convert to memory API
ivshmem: convert to memory API
virtio-pci: convert to memory API
ahci: convert to memory API
intel-hda: convert to memory API
lsi53c895a: convert to memory API
ppc: convert to memory API
ne2000: convert to memory API
pcnet: convert to memory API
i6300esb: convert to memory API
isa-mmio: concert to memory API
sun4u: convert to memory API
ehci: convert to memory API
uhci: convert to memory API
xen-platform: convert to memory API
msix: convert to memory API
pci: remove pci_register_bar_simple()
pci: convert pci rom to memory API
pci: remove pci_register_bar()
pci: fold BAR mapping function into its caller
pci: rename pci_register_bar_region() to pci_register_bar()
pci: remove support for pre memory API BARs
Introduce QEMU_NEW()
apb_pci: convert to memory API
apic: convert to memory API
arm_gic: convert to memory API
arm_sysctl: convert to memory API
arm_timer: convert to memory API
armv7m: convert to memory API
gt64xxx.c: convert to memory API
tusb6010: move declarations to new file tusb6010.h omap_gpmc/nseries/tusb6010: convert to memory API
onenand: convert to memory API
pcie_host: convert to memory API
ppc405_uc: convert to memory API
ppc4xx_sdram: convert to memory API
stellaris_enet: convert to memory API
sysbus: add a variant of sysbus_init_mmio_cb with an unmap callback
sh_pci: convert to memory API
arm11mpcore: use sysbus_init_mmio_cb2
versatile_pci: convert to memory API
ppce500_pci: convert to sysbus_init_mmio_cb2()
sysbus: remove sysbus_init_mmio_cb()
isa: add isa_address_space()
pci: add pci_address_space()
vga: drop get_system_memory() from vga devices and derivatives 440fx: fix PAM, PCI holes

 Makefile.target     |    1 +
 exec-memory.h       |   28 ++
 exec.c              |   29 ++
 hw/ac97.c           |   88 +++--
 hw/apb_pci.c        |   86 ++---
 hw/apic.c           |   25 +-
 hw/arm11mpcore.c    |    7 +-
 hw/arm_gic.c        |   22 +-
 hw/arm_sysctl.c     |   27 +-
 hw/arm_timer.c      |   55 +--
 hw/armv7m.c         |   24 +-
 hw/armv7m_nvic.c    |    4 +-
 hw/bonito.c         |    5 +-
 hw/cirrus_vga.c     |  469 +++++++---------------
 hw/cuda.c           |    6 +-
 hw/devices.h        |    7 -
 hw/e1000.c          |  113 +++---
 hw/eepro100.c       |  181 ++-------
 hw/es1370.c         |   43 ++-
 hw/escc.c           |   42 +-
 hw/escc.h           |    2 +-
 hw/grackle_pci.c    |    9 +-
 hw/gt64xxx.c        |   42 +-
 hw/heathrow_pic.c   |   29 +-
 hw/ide.h            |    2 +-
 hw/ide/ahci.c       |   31 +-
 hw/ide/ahci.h       |    2 +-
 hw/ide/cmd646.c     |  204 ++++++----
 hw/ide/ich.c        |    3 +-
 hw/ide/macio.c      |   36 +-
 hw/ide/pci.c        |   25 +-
 hw/ide/pci.h        |   19 +-
 hw/ide/piix.c       |   63 +++-
 hw/ide/via.c        |   64 +++-
 hw/intel-hda.c      |   35 +-
 hw/isa-bus.c        |    7 +
 hw/isa.h            |    3 +
 hw/isa_mmio.c       |   30 +-
 hw/ivshmem.c        |  158 +++-----
 hw/lance.c          |   31 +-
 hw/lsi53c895a.c     |  257 +++----------
 hw/mac_dbdma.c      |   32 +-
 hw/mac_dbdma.h      |    4 +-
 hw/mac_nvram.c      |   39 +--
 hw/macio.c          |   73 ++--
 hw/mips_jazz.c      |    4 +-
 hw/mpcore.c         |   37 +-
 hw/msix.c           |   64 +--
 hw/msix.h           |    6 +-
 hw/ne2000-isa.c     |   14 +-
 hw/ne2000.c         |   77 +++--
 hw/ne2000.h         |    8 +-
 hw/nseries.c        |    1 +
 hw/omap.h           |    3 +-
 hw/omap_gpmc.c      |   54 ++--
 hw/onenand.c        |   70 ++--
 hw/openpic.c        |   81 ++--
 hw/openpic.h        |    2 +-
 hw/pc.c             |   71 +++-
 hw/pc.h             |   27 +-
 hw/pc_piix.c        |   43 ++-
 hw/pci.c            |  113 +++---
 hw/pci.h            |   32 +-
 hw/pci_host.h       |    1 +
 hw/pci_internals.h  |    2 +
 hw/pcie_host.c      |   98 ++----
 hw/pcie_host.h      |   12 +-
 hw/pcnet-pci.c      |   74 ++--
 hw/pcnet.h          |    4 +-
 hw/piix_pci.c       |  123 +++++--
 hw/ppc405.h         |    9 +-
 hw/ppc405_boards.c  |   18 +-
 hw/ppc405_uc.c      |  129 +++----
 hw/ppc440.c         |    7 +-
 hw/ppc4xx.h         |    2 +
 hw/ppc4xx_devs.c    |   51 ++-
 hw/ppc4xx_pci.c     |    6 +-
 hw/ppc_mac.h        |   30 +-
 hw/ppc_newworld.c   |   35 +-
 hw/ppc_oldworld.c   |   28 +-
 hw/ppc_prep.c       |    3 +-
 hw/ppce500_pci.c    |   19 +-
 hw/prep_pci.c       |    9 +-
 hw/prep_pci.h       |    5 +-
 hw/qxl-render.c     |    2 +-
 hw/qxl.c            |  131 +++----
 hw/qxl.h            |    6 +-
 hw/realview_gic.c   |   38 +-
 hw/rtl8139.c        |   70 ++--
 hw/sh_pci.c         |   69 +++-
 hw/stellaris_enet.c |   29 +-
 hw/sun4u.c          |   53 +--
 hw/sysbus.c         |   36 ++-
 hw/sysbus.h         |    8 +-
 hw/tusb6010.c       |   32 +-
 hw/tusb6010.h       |   13 +
 hw/unin_pci.c       |   18 +-
 hw/usb-ehci.c       |   36 +--
 hw/usb-ohci.c       |   42 +--
 hw/usb-uhci.c       |   41 ++-
 hw/versatile_pci.c  |   96 +++---
 hw/vga-isa-mm.c     |   55 ++-
 hw/vga-isa.c        |   11 +-
 hw/vga-pci.c        |   31 +--
 hw/vga.c            |  180 +++------
 hw/vga_int.h        |   23 +-
 hw/virtio-pci.c     |   89 ++---
 hw/virtio-pci.h     |    3 +-
 hw/vmware_vga.c     |  160 ++++----
 hw/wdt_i6300esb.c   |   43 ++-
 hw/xen_platform.c   |   82 +++--
 ioport.c            |    4 +-
 memory.c            | 1112 +++++++++++++++++++++++++++++++++++++++++++++++++++
 memory.h            |  251 ++++++++++++
 qemu-common.h       |    3 +
 xen-mapcache.h      |   32 ++
 116 files changed, 3916 insertions(+), 2717 deletions(-)
 create mode 100644 exec-memory.h
 create mode 100644 hw/tusb6010.h
 create mode 100644 memory.c
 create mode 100644 memory.h
Signature · 1 line
1.7.5.3