qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: patches@linaro.org, Eduardo Habkost <ehabkost@redhat.com>,
	Marcel Apfelbaum <marcel@redhat.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 00/11] Make memory_region_init_ram() and friends handle migration
Date: Mon, 10 Jul 2017 12:05:00 +0200	[thread overview]
Message-ID: <438bc671-4d94-9efc-540a-151be39583e2@redhat.com> (raw)
In-Reply-To: <1499438577-7674-1-git-send-email-peter.maydell@linaro.org>



On 07/07/2017 16:42, Peter Maydell wrote:
> This patchset changes the memory region functions
>  - memory_region_init_ram()
>  - memory_region_init_rom()
>  - memory_region_init_rom_device()
> to all automatically register the backing memory they allocate
> for migration using vmstate_register_ram(). Renamed functions
>  - memory_region_init_ram_nomigrate()
>  - memory_region_init_rom_nomigrate()
>  - memory_region_init_rom_device_nomigrate()
> are provided which only do the MR init, for the oddball
> cases which want to manage migration of the backing memory
> themselves (and to avoid behavioural changes for callers
> which weren't managing correctly migration themselves...)
> 
> The idea is based on discussion from a previous patchset:
>  https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg00764.html
> 
> The series includes a largish coccinelle-scripted patch and a
> few by-hand conversions which change callsites which previously
> manually created the region and registered its backing ram in
> two separate steps to use the new functions.
> 
> This series does not include any patches to fix bugs like:
>  * caller forgot to call vmstate_register_ram() so region
>    is not actually migrated (eg hw/arm/highbank.c)
>  * caller used vmstate_register_ram_global() even though it is
>    a device, so you can't create 2 copies of the device (eg sm501)
> because I wanted to stick to strictly no-behaviour-change
> for this patch -- we can fix the bugs separately (fixes will
> tend to imply migration compat breaks so can only be done
> for some boards.) Most of the remaining callers of the
> _nomigrate functions are buggy, I think (and a demonstration
> that our current API does not score well on the "hard to
> get wrong by accident" scale).

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks,

Paolo

> 
> thanks
> -- PMM
> 
> Peter Maydell (11):
>   include/hw/boards.h: Document memory_region_allocate_system_memory()
>   memory: Document that the RAM MR initializers do not handle migration
>   memory: Rename memory_region_init_ram() to
>     memory_region_init_ram_nomigrate()
>   memory: Rename memory_region_init_rom() and _rom_device() to
>     _nomigrate()
>   memory.h: Add memory_region_init_{ram,rom,rom_device}() handling
>     migration
>   scripts/coccinelle/memory-region-init-ram.cocci: New script
>   hw: Use new memory_region_init_{ram,rom,rom_device}() functions
>   hw/block/pflash_cfi01, pflash_cfi02: Use
>     memory_region_init_rom_device()
>   hw/pci/pci.c: Use memory_region_init_rom()
>   hw/display/qxl.c Use memory_region_init_ram()
>   docs/devel/memory.txt: Add section about RAM migration
> 
>  docs/devel/memory.txt                           |  31 +++++
>  include/exec/memory.h                           | 161 ++++++++++++++++++++----
>  include/hw/boards.h                             |  29 +++++
>  backends/hostmem-ram.c                          |   2 +-
>  hw/arm/aspeed.c                                 |   2 +-
>  hw/arm/aspeed_soc.c                             |   2 +-
>  hw/arm/exynos4210.c                             |   2 -
>  hw/arm/exynos4_boards.c                         |   2 -
>  hw/arm/fsl-imx25.c                              |   5 +-
>  hw/arm/fsl-imx31.c                              |   5 +-
>  hw/arm/fsl-imx6.c                               |   5 +-
>  hw/arm/highbank.c                               |   2 +-
>  hw/arm/integratorcp.c                           |   2 +-
>  hw/arm/mainstone.c                              |   1 -
>  hw/arm/musicpal.c                               |   1 -
>  hw/arm/omap1.c                                  |   1 -
>  hw/arm/omap2.c                                  |   1 -
>  hw/arm/omap_sx1.c                               |   6 +-
>  hw/arm/palm.c                                   |   1 -
>  hw/arm/pxa2xx.c                                 |   4 -
>  hw/arm/realview.c                               |   3 -
>  hw/arm/spitz.c                                  |   1 -
>  hw/arm/stellaris.c                              |   2 -
>  hw/arm/stm32f205_soc.c                          |   3 -
>  hw/arm/tosa.c                                   |   1 -
>  hw/arm/vexpress.c                               |   3 -
>  hw/arm/virt.c                                   |   4 +-
>  hw/arm/xilinx_zynq.c                            |   1 -
>  hw/arm/xlnx-zynqmp.c                            |   1 -
>  hw/block/onenand.c                              |   2 +-
>  hw/block/pflash_cfi01.c                         |   1 -
>  hw/block/pflash_cfi02.c                         |   1 -
>  hw/cris/axis_dev88.c                            |   5 +-
>  hw/display/cg3.c                                |   3 +-
>  hw/display/qxl.c                                |   3 -
>  hw/display/sm501.c                              |   2 +-
>  hw/display/tc6393xb.c                           |   1 -
>  hw/display/tcx.c                                |   4 +-
>  hw/display/vga.c                                |   2 +-
>  hw/display/vmware_vga.c                         |   1 -
>  hw/i386/pc.c                                    |   1 -
>  hw/i386/pc_sysfw.c                              |   2 -
>  hw/i386/pci-assign-load-rom.c                   |   2 +-
>  hw/i386/xen/xen-hvm.c                           |   1 -
>  hw/input/milkymist-softusb.c                    |   4 +-
>  hw/m68k/an5206.c                                |   1 -
>  hw/m68k/mcf5208.c                               |   1 -
>  hw/microblaze/petalogix_ml605_mmu.c             |   2 -
>  hw/microblaze/petalogix_s3adsp1800_mmu.c        |   2 -
>  hw/mips/boston.c                                |   2 +-
>  hw/mips/mips_fulong2e.c                         |   1 -
>  hw/mips/mips_jazz.c                             |   2 -
>  hw/mips/mips_malta.c                            |   2 +-
>  hw/mips/mips_mipssim.c                          |   1 -
>  hw/mips/mips_r4k.c                              |   1 -
>  hw/moxie/moxiesim.c                             |   4 +-
>  hw/net/dp8393x.c                                |   2 +-
>  hw/net/milkymist-minimac2.c                     |   2 +-
>  hw/nios2/10m50_devboard.c                       |   8 +-
>  hw/openrisc/openrisc_sim.c                      |   1 -
>  hw/pci-host/prep.c                              |   2 +-
>  hw/pci-host/xilinx-pcie.c                       |   2 +-
>  hw/pci/pci.c                                    |   1 -
>  hw/ppc/mac_newworld.c                           |   1 -
>  hw/ppc/mac_oldworld.c                           |   1 -
>  hw/ppc/ppc405_boards.c                          |   3 -
>  hw/ppc/ppc405_uc.c                              |   1 -
>  hw/s390x/sclp.c                                 |   1 -
>  hw/sh4/r2d.c                                    |   1 -
>  hw/sh4/shix.c                                   |   3 -
>  hw/sparc/leon3.c                                |   1 -
>  hw/sparc/sun4m.c                                |   6 +-
>  hw/sparc64/sun4u.c                              |   4 +-
>  hw/tricore/tricore_testboard.c                  |  26 ++--
>  hw/unicore32/puv3.c                             |   1 -
>  hw/xtensa/sim.c                                 |   4 +-
>  hw/xtensa/xtfpga.c                              |   4 +-
>  memory.c                                        | 110 +++++++++++++---
>  numa.c                                          |   4 +-
>  scripts/coccinelle/memory-region-init-ram.cocci |  38 ++++++
>  80 files changed, 385 insertions(+), 180 deletions(-)
>  create mode 100644 scripts/coccinelle/memory-region-init-ram.cocci
> 

  parent reply	other threads:[~2017-07-10 10:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 14:42 [Qemu-devel] [PATCH 00/11] Make memory_region_init_ram() and friends handle migration Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 01/11] include/hw/boards.h: Document memory_region_allocate_system_memory() Peter Maydell
2017-07-10  9:42   ` Paolo Bonzini
2017-07-07 14:42 ` [Qemu-devel] [PATCH 02/11] memory: Document that the RAM MR initializers do not handle migration Peter Maydell
2017-07-10 10:01   ` Paolo Bonzini
2017-07-10 10:04     ` Peter Maydell
2017-07-10 10:05       ` Paolo Bonzini
2017-07-10 10:08         ` Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 03/11] memory: Rename memory_region_init_ram() to memory_region_init_ram_nomigrate() Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 04/11] memory: Rename memory_region_init_rom() and _rom_device() to _nomigrate() Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 05/11] memory.h: Add memory_region_init_{ram, rom, rom_device}() handling migration Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 06/11] scripts/coccinelle/memory-region-init-ram.cocci: New script Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 07/11] hw: Use new memory_region_init_{ram, rom, rom_device}() functions Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 08/11] hw/block/pflash_cfi01, pflash_cfi02: Use memory_region_init_rom_device() Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 09/11] hw/pci/pci.c: Use memory_region_init_rom() Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 10/11] hw/display/qxl.c Use memory_region_init_ram() Peter Maydell
2017-07-07 14:42 ` [Qemu-devel] [PATCH 11/11] docs/devel/memory.txt: Add section about RAM migration Peter Maydell
2017-07-10 10:05 ` Paolo Bonzini [this message]
2017-07-14 17:01   ` [Qemu-devel] [PATCH 00/11] Make memory_region_init_ram() and friends handle migration Peter Maydell
2017-07-17  9:01     ` Peter Maydell
2017-07-22  4:47 ` Philippe Mathieu-Daudé
2017-07-23 19:58   ` Peter Maydell
2017-07-25  5:28     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=438bc671-4d94-9efc-540a-151be39583e2@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=marcel@redhat.com \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).