Skip to content

Memory API, batch 1

Avi Kivity kvm qemu-devel 2 versions – Applied

Status from this message: Applied all. Thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest23 patches 7 repliesApplied
  2. v123 patches 42 repliesSuperseded

Changes in v2 from the cover letter

- switched to gtk-doc
- more copyright blurbs
- simplified flatview_simplify()
- use assert() instead of abort() for invariant checks (but keep abort() for runtime errors)
- commit log fixups

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/23Add memory API documentationdocs/memory.txt+172 -00 replies
2/23Hierarchical memory region APIMakefile.target memory.c memory.h+1039 -00 replies
3/23memory: implement dirty trackingmemory.c memory.h+32 -80 replies
4/23memory: merge adjacent segments of a single memory regionmemory.c+29 -06 replies
5/23Internal interfaces for memory APIexec-memory.h memory.c+43 -00 replies
6/23memory: abstract address space operationsmemory.c+81 -300 replies
7/23memory: rename MemoryRegion::has_ram_addr to ::terminatesmemory.c memory.h+10 -100 replies
8/23memory: late initialization of ram_addrmemory.c memory.h+21 -40 replies
9/23memory: I/O address space supportexec-memory.h memory.c memory.h+64 -10 replies
10/23memory: add backward compatibility for old portio registrationmemory.c memory.h+49 -00 replies
11/23memory: add backward compatibility for old mmio registrationmemory.c memory.h+20 -00 replies
12/23memory: add ioeventfd supportmemory.c memory.h+269 -00 replies
13/23memory: separate building the final memory map into two stepsmemory.c+29 -90 replies
14/23memory: transaction APImemory.c memory.h+26 -00 replies
15/23exec.c: initialize memory mapexec.c+19 -00 replies
16/23ioport: register ranges by byte aligned addresses alwaysioport.c+2 -20 replies
17/23pc: grab system_memoryhw/pc.c hw/pc.h hw/pc_piix.c+12 -30 replies
18/23pc: convert pc_memory_init() to memory APIhw/pc.c hw/pc.h+41 -190 replies
19/23pc: move global memory map out of pc_init1() and into its callershw/pc_piix.c+8 -70 replies
20/23pci: pass address space to pci bus when createdhw/apb_pci.c hw/bonito.c hw/grackle_pci.c +19 more+85 -350 replies
21/23pci: add MemoryRegion based BAR management APIhw/pci.c hw/pci.h+42 -80 replies
22/23sysbus: add MemoryRegion based memory management APIhw/sysbus.c hw/sysbus.h+27 -30 replies
23/23usb-ohci: convert to MemoryRegionhw/usb-ohci.c+17 -250 replies

Reviews trailers per patch

15 of 23 patches have a Reviewed-by or Acked-by.

PatchAnthony Liguori
1/23
2/23R-b
3/23R-b
4/23
5/23R-b
6/23R-b
7/23R-b
8/23
9/23R-b
10/23R-b
11/23R-b
12/23
13/23
14/23
15/23
16/23R-b
17/23R-b
18/23R-b
19/23
20/23R-b
21/23R-b
22/23R-b
23/23R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/23] Memory API, batch 1

This patchset contains the core of the memory API, with one device (usb-ohci) coverted for reference. The API is currently implemented on top of the old ram_addr_t/cpu_register_physical_memory() API, but the plan is to make it standalone later.

The goals of the API are:
- correctness: by modelling the memory hierarchy, things like the 440FX PAM registers and movable, overlapping PCI BARs can be modelled accurately.
- efficiency: by maintaining an object tree describing guest memory, we can eventually get rid of the page descriptor array
- security: by having more information available declaratively, we reduce coding errors that may be exploited by malicious guests

Also available from

git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git
refs/tags/memory-region-batch-1-v2

Changes from v1:
- switched to gtk-doc
- more copyright blurbs
- simplified flatview_simplify()
- use assert() instead of abort() for invariant checks (but keep abort() for runtime errors)
- commit log fixups

Avi Kivity (23):
Add memory API documentation
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
memory: transaction API
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

 Makefile.target    |    1 +
 docs/memory.txt    |  172 ++++++++
 exec-memory.h      |   39 ++
 exec.c             |   19 +
 hw/apb_pci.c       |    2 +
 hw/bonito.c        |    4 +-
 hw/grackle_pci.c   |    5 +-
 hw/gt64xxx.c       |    4 +-
 hw/pc.c            |   62 ++-
 hw/pc.h            |    9 +-
 hw/pc_piix.c       |   20 +-
 hw/pci.c           |   63 +++-
 hw/pci.h           |   15 +-
 hw/pci_host.h      |    1 +
 hw/pci_internals.h |    1 +
 hw/piix_pci.c      |   13 +-
 hw/ppc4xx_pci.c    |    5 +-
 hw/ppc_mac.h       |    9 +-
 hw/ppc_newworld.c  |    5 +-
 hw/ppc_oldworld.c  |    3 +-
 hw/ppc_prep.c      |    3 +-
 hw/ppce500_pci.c   |    6 +-
 hw/prep_pci.c      |    5 +-
 hw/prep_pci.h      |    3 +-
 hw/sh_pci.c        |    4 +-
 hw/sysbus.c        |   27 ++-
 hw/sysbus.h        |    3 +
 hw/unin_pci.c      |   10 +-
 hw/usb-ohci.c      |   42 +--
 hw/versatile_pci.c |    2 +
 ioport.c           |    4 +-
 memory.c           | 1141 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 memory.h           |  469 +++++++++++++++++++++
 33 files changed, 2072 insertions(+), 99 deletions(-)
 create mode 100644 docs/memory.txt
 create mode 100644 exec-memory.h
 create mode 100644 memory.c
 create mode 100644 memory.h
Signature · 1 line
1.7.5.3