qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC v2 00/20] Memory API
@ 2011-06-27 13:21 Avi Kivity
  2011-06-27 13:21 ` [Qemu-devel] [RFC v2 01/20] Hierarchical memory region API Avi Kivity
                   ` (21 more replies)
  0 siblings, 22 replies; 42+ messages in thread
From: Avi Kivity @ 2011-06-27 13:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: kvm

As expected, this is taking longer than expected, so I'm releasing something
less complete than I'd have liked.  Not even all of the PC machine is
converted, but the difficult parts are (cirrus).  It appears to work well.

The major change compared to v1 is the introduction of
memory_region_init_alias(), which defines a memory region in terms of another.
With the current API, the ability to alias is provided by address arithmetic
on ram_addr_t:

  ram_addr = qemu_ram_alloc(...);
  cpu_register_physical_memory(..., ram_addr, size, ...);
  /* alias: */
  cpu_register_physical_memory(..., ram_addr + offset, another_size, ...);

With the new API, you have to create an alias:

  memory_region_init_ram(&mem, ...);
  memory_region_register_subregion(..., &mem);
  /* alias: */
  memory_region_init_alias(&alias, ..., &mem, offset, another_size);
  memory_region_register_subregion(..., &alias);

The patchset is somewhat churny.  One of the reasons is that we move from a
handle/pointer scheme in ram_addr_t to an object constructor/destructor scheme.
Another is that region size becomes a property of a region instead of being
maintained externally.  Also, container memory regions must be passed around,
though we don't do that as well as we should.

Todo:
  - eliminate calls to get_system_memory() (where we ignore the bus hierarchy)
  - add PCI APIs for the VGA window
  - support the PIO address space using the memory API (allowing simplified
    PCI BAR registration)
  - convert 440FX
  - convert everything else

Also available in

  git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git memory-region

with a complementary pair of noisy debug patches.

Avi Kivity (20):
  Hierarchical memory region API
  memory: implement dirty tracking
  memory: merge adjacent segments of a single memory region
  Internal interfaces for memory API
  exec.c: initialize memory map
  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

 Makefile.target    |    1 +
 exec-memory.h      |   17 ++
 exec.c             |   19 ++
 hw/apb_pci.c       |    2 +
 hw/bonito.c        |    4 +-
 hw/cirrus_vga.c    |  476 ++++++++++++------------------------
 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           |   68 ++++-
 hw/pci.h           |   16 +-
 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 +
 hw/vga-isa-mm.c    |   66 ++++--
 hw/vga-isa.c       |   13 +-
 hw/vga-pci.c       |   28 +--
 hw/vga.c           |  178 +++++---------
 hw/vga_int.h       |   24 +-
 hw/vmware_vga.c    |   94 +++++---
 memory.c           |  704 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 memory.h           |  202 +++++++++++++++
 38 files changed, 1525 insertions(+), 629 deletions(-)
 create mode 100644 exec-memory.h
 create mode 100644 memory.c
 create mode 100644 memory.h

-- 
1.7.5.3

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2011-06-28 16:28 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 13:21 [Qemu-devel] [RFC v2 00/20] Memory API Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 01/20] Hierarchical memory region API Avi Kivity
2011-06-28 10:03   ` Michael S. Tsirkin
2011-06-28 10:28     ` Jan Kiszka
2011-06-28 11:53       ` Avi Kivity
2011-06-28 12:07         ` Jan Kiszka
2011-06-28 12:09           ` Avi Kivity
2011-06-28 12:46             ` Jan Kiszka
2011-06-28 12:53               ` Avi Kivity
2011-06-28 13:25             ` Peter Maydell
2011-06-28 13:36               ` Avi Kivity
2011-06-28 16:27             ` Olivier Galibert
2011-06-28 11:51     ` Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 02/20] memory: implement dirty tracking Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 03/20] memory: merge adjacent segments of a single memory region Avi Kivity
2011-06-27 13:56   ` Jan Kiszka
2011-06-27 14:11     ` Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 04/20] Internal interfaces for memory API Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 05/20] exec.c: initialize memory map Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 06/20] pc: grab system_memory Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 07/20] pc: convert pc_memory_init() to memory API Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 08/20] pc: move global memory map out of pc_init1() and into its callers Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 09/20] pci: pass address space to pci bus when created Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 10/20] pci: add MemoryRegion based BAR management API Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 11/20] sysbus: add MemoryRegion based memory " Avi Kivity
2011-06-27 13:21 ` [Qemu-devel] [RFC v2 12/20] usb-ohci: convert to MemoryRegion Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 13/20] pci: add API to get a BAR's mapped address Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 14/20] vmsvga: don't remember pci BAR address in callback any more Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 15/20] vga: convert vga and its derivatives to the memory API Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 16/20] cirrus: simplify mmio BAR access functions Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 17/20] cirrus: simplify bitblt " Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 18/20] cirrus: simplify vga window mmio " Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 19/20] vga: " Avi Kivity
2011-06-27 13:22 ` [Qemu-devel] [RFC v2 20/20] cirrus: simplify linear framebuffer " Avi Kivity
2011-06-27 15:13 ` [Qemu-devel] [RFC v2 00/20] Memory API Avi Kivity
2011-06-27 15:52   ` Michael S. Tsirkin
2011-06-27 15:54     ` Avi Kivity
2011-06-27 15:59       ` Michael S. Tsirkin
2011-06-27 16:10         ` Avi Kivity
2011-06-27 20:28         ` Anthony Liguori
2011-06-27 15:37 ` Anthony Liguori
2011-06-27 15:44   ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).