qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/8] acpi: make ROMs resizeable
@ 2014-12-16 16:14 Michael S. Tsirkin
  2014-12-16 16:14 ` [Qemu-devel] [PATCH v2 1/8] cpu: add cpu_physical_memory_clear_dirty_range_nocode Michael S. Tsirkin
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Michael S. Tsirkin @ 2014-12-16 16:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Amit Shah, pbonzini, imammedo, dgilbert, Juan Quintela

This is v2 of the patchset.
Changes since v1:
    - Any RAM can now be resizeable - there's no requirement
      that it's device RAM any longer.
    - For simplicity, max_size RAM is always pre-allocated
    - Added memory_region_set_size, to keep MR size consistent
      in case MR is guest visible (even though for current users,
      it never is)

At the moment we migrate ROMs which reside in fw cfg, which allows
changing ROM code at will, and supports migrating largish blocks early,
with good performance.
However, we are running into a problem: changing size breaks
migration every time.
This already requires somewhat messy compatibility support in
acpi generation code, and it looks like there'll be more to come.

In particular, recent patchsets by Igor et al. change table sizes in
unpredictable ways.

Rather than try to guess the correct size once and for all,
this patchset tries to make code future-proof, by
adding support for resizeable ram blocks.

A (possibly very high) amount of space in ram_addr_t space is reserved
and allocated in host for each block, but never used by fw cfg.
If incoming block size differs from current size, block is
reallocated. FW CFG is also notified and updated accordingly.

As reviewers felt that making all RAM "resizeable" in this
way might make debugging migration harder, these patches
set a per-block flag and only allow resizing for blocks
where this was explicitly requested.

Note: migration stream is unaffected by these patches.
This makes it possible to enable this functionality
unconditionally, for all machine types.

In the future, this API might be handy for other things, besides ROMs.

Michael S. Tsirkin (8):
  cpu: add cpu_physical_memory_clear_dirty_range_nocode
  memory: add memory_region_set_size
  exec: cpu_physical_memory_set/clear_dirty_range
  exec: split length -> used_length/max_length
  exec: qemu_ram_alloc_resizeable, qemu_ram_resize
  arch_init: support resizing on incoming migration
  memory: API to allocate resizeable RAM MR
  acpi-build: make ROMs RAM blocks resizeable

 hw/lm32/lm32_hwsetup.h  |   3 +-
 include/exec/cpu-all.h  |  12 +++--
 include/exec/memory.h   |  34 +++++++++++++
 include/exec/ram_addr.h |  22 +++++++--
 include/hw/loader.h     |   4 +-
 arch_init.c             |  28 ++++++-----
 exec.c                  | 129 +++++++++++++++++++++++++++++++++++++-----------
 hw/core/loader.c        |  18 +++++--
 hw/i386/acpi-build.c    |  19 +++++--
 memory.c                |  33 +++++++++++++
 10 files changed, 242 insertions(+), 60 deletions(-)

-- 
MST

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

end of thread, other threads:[~2014-12-18 21:49 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16 16:14 [Qemu-devel] [PATCH v2 0/8] acpi: make ROMs resizeable Michael S. Tsirkin
2014-12-16 16:14 ` [Qemu-devel] [PATCH v2 1/8] cpu: add cpu_physical_memory_clear_dirty_range_nocode Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 2/8] memory: add memory_region_set_size Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 3/8] exec: cpu_physical_memory_set/clear_dirty_range Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 4/8] exec: split length -> used_length/max_length Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 5/8] exec: qemu_ram_alloc_resizeable, qemu_ram_resize Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 6/8] arch_init: support resizing on incoming migration Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 7/8] memory: API to allocate resizeable RAM MR Michael S. Tsirkin
2014-12-16 16:15 ` [Qemu-devel] [PATCH v2 8/8] acpi-build: make ROMs RAM blocks resizeable Michael S. Tsirkin
2014-12-18 18:49 ` [Qemu-devel] [PATCH v2 0/8] acpi: make ROMs resizeable Dr. David Alan Gilbert
2014-12-18 19:43   ` Michael S. Tsirkin
2014-12-18 20:16     ` Dr. David Alan Gilbert
2014-12-18 21:49       ` Michael S. Tsirkin

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).