mbox series

[REPOST,v3,00/80] refactor main RAM allocation to use hostmem backend

Message ID 1579779525-20065-1-git-send-email-imammedo@redhat.com
Headers show
Series refactor main RAM allocation to use hostmem backend | expand

Message

Igor Mammedov Jan. 23, 2020, 11:37 a.m. UTC
v3:
  - due to libvirt not being ready, postpone till 5.1
     * [PATCH v2 82/86] numa: forbid '-numa node,  mem' for 5.0 and newer machine types
     and depended
       [PATCH v2 86/86] numa: remove deprecated implicit RAM distribution  between nodes
  - drop as not related "[PATCH v2 85/86] numa: make exit() usage consistent"
  - drop "[PATCH v2 76/86] post conversion default_ram_id cleanup"
    so that default memory-backedend won't be created for boards that do not care
    about -m. Which makes -m optin feature. We should decide  what do in  case
    board doesn't use -m (but that's out of scope of this series)
  - use object_register_sugar_prop() instead of hacking compat props directly
  - simplified/reworked aspeed patches
  - s/RAM_ADDR_FMT/size_to_str()/
  - rename 'ram-memdev' property to 'memory-backend'
  - minor fixes to numa-test
  - fixes for issues noticed during review of
       [PATCH v2 66/86] ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup

v2:
  - fix compile errors on mingw32 host by introducing RAM_ADDR_UFMT [11/86]
  - replace "[PATCH 43/86] hppa: drop RAM size fixup" with alternative
    patches made by Philippe (which effectively do the same thing but other
    way around)
  - ppc440: fix crash and add suggested valid RAM size in error output.
    s/ppc4xx_sdram_adjust/ppc4xx_sdram_prep/ and simplify it by removing
    not necessary nested loop
  - rebase on current master due to new conflicts


Series removes ad hoc RAM allocation API (memory_region_allocate_system_memory)
and consolidates it around hostmem backend. It allows to
 * resolve conflicts between global -mem-prealloc and hostmem's "policy" option
   fixing premature allocation before binding policy is applied
 * simplify complicated memory allocation routines which had to deal with 2 ways
   to allocate RAM.
 * it allows to reuse hostmem backends of a choice for main RAM without adding
   extra CLI options to duplicate hostmem features.
   Recent case was -mem-shared, to enable vhost-user on targets that don't
   support hostmem backends [1] (ex: s390)
 * move RAM allocation from individual boards into generic machine code and
   provide them with prepared MemoryRegion.
 * clean up deprecated NUMA features which were tied to the old API (see patches)
    - "numa: remove deprecated -mem-path fallback to anonymous RAM"
    - (POSTPONED, waiting on libvirt side) "forbid '-numa node,mem' for 5.0 and newer machine types"
    - (POSTPONED) "numa: remove deprecated implicit RAM distribution between nodes"

Conversion introduces a new machine.memory-backend property and wrapper code that
aliases global -mem-path and -mem-alloc into automatically created hostmem
backend properties (provided memory-backend was not set explicitly given by user).
And then follows bulk of trivial patches that incrementally convert individual
boards to using machine.memory-backend provided MemoryRegion.

Board conversion typically involves:
 * providing MachineClass::default_ram_size and MachineClass::default_ram_id
   so generic code could create default backend if user didn't explicitly provide
   memory-backend or -m options
 * dropping memory_region_allocate_system_memory() call
 * using convenience MachineState::ram MemoryRegion, which points to MemoryRegion
   allocated by ram-memdev
On top of that for some boards:
 * added missing ram_size checks (typically it were boards with fixed ram size)
 * ram_size fixups were replaced by checks and hard errors, forcing user to
   provide correct "-m" values instead of ignoring it and continuing running.

After all boards are converted the old API is removed and memory allocation
routines are cleaned up.

git tree for testing:
  https://github.com/imammedo/qemu convert_main_ram_to_memdev_v3

previous rev:
  https://github.com/imammedo/qemu convert_main_ram_to_memdev_v2
  https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg02960.html


Igor Mammedov (77):
  numa: remove deprecated -mem-path fallback to anonymous RAM
  machine: introduce memory-backend property
  machine: alias -mem-path and -mem-prealloc into memory-foo backend
  machine: introduce convenience MachineState::ram
  initialize MachineState::ram in NUMA case
  alpha:dp264: use memdev for RAM
  arm/aspeed: actually check RAM size
  arm/aspeed: use memdev for RAM
  arm/collie: use memdev for RAM
  arm/cubieboard: use memdev for RAM
  arm/digic_boards: use memdev for RAM
  arm/highbank: use memdev for RAM
  arm/imx25_pdk: drop RAM size fixup
  arm/imx25_pdk: use memdev for RAM
  arm/integratorcp: use memdev for RAM
  arm/kzm: drop RAM size fixup
  arm/kzm: use memdev for RAM
  arm/mcimx6ul-evk: use memdev for RAM
  arm/mcimx7d-sabre: use memdev for RAM
  arm/mps2-tz: use memdev for RAM
  arm/mps2: use memdev for RAM
  arm/musicpal: use memdev for RAM
  arm/nseries: use memdev for RAM
  arm/omap_sx1: use memdev for RAM
  arm/palm: use memdev for RAM
  arm/raspi: use memdev for RAM
  arm/sabrelite: use memdev for RAM
  arm/sbsa-ref: use memdev for RAM
  arm/versatilepb: use memdev for RAM
  arm/vexpress: use memdev for RAM
  arm/virt: use memdev for RAM
  arm/xilinx_zynq: drop RAM size fixup
  arm/xilinx_zynq: use memdev for RAM
  arm/xlnx-versal-virt: use memdev for RAM
  arm/xlnx-zcu102: use memdev for RAM
  s390x/s390-virtio-ccw: use memdev for RAM
  null-machine: use memdev for RAM
  cris/axis_dev88: use memdev for RAM
  hppa: use memdev for RAM
  x86/microvm: use memdev for RAM
  x86/pc: use memdev for RAM
  lm32/lm32_boards: use memdev for RAM
  lm32/milkymist: use memdev for RAM
  m68k/an5206: use memdev for RAM
  m68k/mcf5208: use memdev for RAM
  m68k/next-cube: use memdev for RAM
  mips/boston-cube: use memdev for RAM
  mips/mips_fulong2e: drop RAM size fixup
  mips/mips_fulong2e: use memdev for RAM
  mips/mips_jazz: use memdev for RAM
  mips/mips_malta: use memdev for RAM
  mips/mips_mipssim: use memdev for RAM
  mips/mips_r4k: use memdev for RAM
  ppc/e500: drop RAM size fixup
  ppc/e500: use memdev for RAM
  ppc/mac_newworld: use memdev for RAM
  ppc/mac_oldworld: use memdev for RAM
  ppc/pnv: use memdev for RAM
  ppc/ppc405_boards: add RAM size checks
  ppc/ppc405_boards: use memdev for RAM
  ppc/{ppc440_bamboo,sam460ex}: drop RAM size fixup
  ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM
  ppc/prep: use memdev for RAM
  ppc/spapr: use memdev for RAM
  ppc/virtex_ml507: remove unused arguments
  ppc/virtex_ml507: use memdev for RAM
  sparc/leon3: use memdev for RAM
  sparc/sun4m: use memdev for RAM
  sparc/niagara: use memdev for RAM
  remove no longer used memory_region_allocate_system_memory()
  exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()
  exec: drop bogus mem_path from qemu_ram_alloc_from_fd()
  make mem_path local variable
  hostmem: introduce "prealloc-threads" property
  hostmem: fix strict bind policy
  tests:numa-test: make top level args dynamic and g_autofree(cli)
    cleanups
  tests:numa-test: use explicit memdev to specify node RAM

Philippe Mathieu-Daudé (3):
  hw/hppa/machine: Correctly check the firmware is in PDC range
  hw/hppa/machine: Restrict the total memory size to 3GB
  hw/hppa/machine: Map the PDC memory region with higher priority

 hw/alpha/alpha_sys.h          |   2 +-
 include/hw/boards.h           |  48 +++++----------
 include/hw/misc/aspeed_sdmc.h |   1 +
 include/hw/ppc/ppc4xx.h       |   9 ++-
 include/sysemu/hostmem.h      |  20 +++++-
 include/sysemu/numa.h         |   1 +
 include/sysemu/sysemu.h       |   2 -
 backends/hostmem-file.c       |   8 ---
 backends/hostmem-memfd.c      |   1 -
 backends/hostmem-ram.c        |   2 -
 backends/hostmem.c            |  53 +++++++++++-----
 exec.c                        |  66 +++-----------------
 hw/alpha/dp264.c              |   3 +-
 hw/alpha/typhoon.c            |   8 +--
 hw/arm/aspeed.c               |  18 +++---
 hw/arm/collie.c               |  17 ++++--
 hw/arm/cubieboard.c           |  25 +++-----
 hw/arm/digic_boards.c         |  40 ++++++------
 hw/arm/highbank.c             |  10 ++-
 hw/arm/imx25_pdk.c            |  13 ++--
 hw/arm/integratorcp.c         |   9 ++-
 hw/arm/kzm.c                  |  18 +++---
 hw/arm/mcimx6ul-evk.c         |  25 +++-----
 hw/arm/mcimx7d-sabre.c        |  25 +++-----
 hw/arm/mps2-tz.c              |  15 +++--
 hw/arm/mps2.c                 |  15 +++--
 hw/arm/musicpal.c             |  18 ++++--
 hw/arm/nseries.c              |  32 ++++++----
 hw/arm/omap_sx1.c             |  20 ++++--
 hw/arm/palm.c                 |  20 ++++--
 hw/arm/raspi.c                |  34 ++++-------
 hw/arm/sabrelite.c            |  23 +++----
 hw/arm/sbsa-ref.c             |   7 +--
 hw/arm/versatilepb.c          |   7 +--
 hw/arm/vexpress.c             |  14 ++---
 hw/arm/virt.c                 |   7 +--
 hw/arm/xilinx_zynq.c          |  20 +++---
 hw/arm/xlnx-versal-virt.c     |   7 +--
 hw/arm/xlnx-zcu102.c          |   7 +--
 hw/core/machine.c             |  30 +++++++++
 hw/core/null-machine.c        |   8 +--
 hw/core/numa.c                | 101 +++++++++----------------------
 hw/cris/axis_dev88.c          |   8 +--
 hw/hppa/machine.c             |  19 +++---
 hw/i386/microvm.c             |  12 ++--
 hw/i386/pc.c                  |  19 +++---
 hw/lm32/lm32_boards.c         |  39 ++++++++----
 hw/lm32/milkymist.c           |  21 ++++---
 hw/m68k/an5206.c              |   5 +-
 hw/m68k/mcf5208.c             |   5 +-
 hw/m68k/next-cube.c           |   5 +-
 hw/mips/boston.c              |  11 ++--
 hw/mips/mips_fulong2e.c       |  15 ++---
 hw/mips/mips_jazz.c           |   7 +--
 hw/mips/mips_malta.c          |  10 ++-
 hw/mips/mips_mipssim.c        |   9 +--
 hw/mips/mips_r4k.c            |  12 ++--
 hw/misc/aspeed_sdmc.c         |  83 +++++++++++++++++++------
 hw/ppc/e500.c                 |  17 +++---
 hw/ppc/e500plat.c             |   1 +
 hw/ppc/mac_newworld.c         |   6 +-
 hw/ppc/mac_oldworld.c         |   6 +-
 hw/ppc/mpc8544ds.c            |   1 +
 hw/ppc/pnv.c                  |   8 +--
 hw/ppc/ppc405_boards.c        |  48 +++++++++------
 hw/ppc/ppc440_bamboo.c        |  12 ++--
 hw/ppc/ppc4xx_devs.c          |  63 +++++++++----------
 hw/ppc/prep.c                 |  15 +++--
 hw/ppc/sam460ex.c             |   6 +-
 hw/ppc/spapr.c                |   8 +--
 hw/ppc/virtex_ml507.c         |  19 +++---
 hw/s390x/s390-virtio-ccw.c    |   7 +--
 hw/sparc/leon3.c              |   6 +-
 hw/sparc/sun4m.c              |  73 +++++++++++-----------
 hw/sparc64/niagara.c          |   7 +--
 qemu-deprecated.texi          |   9 ---
 tests/qtest/numa-test.c       | 138 ++++++++++++++++++++++--------------------
 vl.c                          |  37 ++++++++++-
 78 files changed, 785 insertions(+), 791 deletions(-)

Comments

no-reply@patchew.org Jan. 23, 2020, 1:04 p.m. UTC | #1
Patchew URL: https://patchew.org/QEMU/1579779525-20065-1-git-send-email-imammedo@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 1579779525-20065-1-git-send-email-imammedo@redhat.com
Subject: [PATCH REPOST v3 00/80] refactor main RAM allocation to use hostmem backend

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/1579779525-20065-1-git-send-email-imammedo@redhat.com -> patchew/1579779525-20065-1-git-send-email-imammedo@redhat.com
 - [tag update]      patchew/20200122223247.30419-1-philmd@redhat.com -> patchew/20200122223247.30419-1-philmd@redhat.com
Switched to a new branch 'test'
28f0d42 tests:numa-test: use explicit memdev to specify node RAM
64e4393 tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups
e6ea9bb hostmem: fix strict bind policy
339ae3c hostmem: introduce "prealloc-threads" property
a0a8b7f make mem_path local variable
cac7077 exec: drop bogus mem_path from qemu_ram_alloc_from_fd()
937af3d exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()
294588b remove no longer used memory_region_allocate_system_memory()
6a13317 sparc/niagara: use memdev for RAM
6b50ac9 sparc/sun4m: use memdev for RAM
6c88353 sparc/leon3: use memdev for RAM
c35345c ppc/virtex_ml507: use memdev for RAM
2b9aeb4 ppc/virtex_ml507: remove unused arguments
7f5e309 ppc/spapr: use memdev for RAM
d5ec039 ppc/prep: use memdev for RAM
4f02b90 ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM
d02eb66 ppc/{ppc440_bamboo, sam460ex}: drop RAM size fixup
dd10982 ppc/ppc405_boards: use memdev for RAM
9741a0e ppc/ppc405_boards: add RAM size checks
fe790ac ppc/pnv: use memdev for RAM
3bec0ee ppc/mac_oldworld: use memdev for RAM
46e6217 ppc/mac_newworld: use memdev for RAM
281b13d ppc/e500: use memdev for RAM
8f31839 ppc/e500: drop RAM size fixup
06ffc73 mips/mips_r4k: use memdev for RAM
6c48078 mips/mips_mipssim: use memdev for RAM
74f382e mips/mips_malta: use memdev for RAM
49962be mips/mips_jazz: use memdev for RAM
b4e5189 mips/mips_fulong2e: use memdev for RAM
f7ef86f mips/mips_fulong2e: drop RAM size fixup
2349c09 mips/boston-cube: use memdev for RAM
288b0f9 m68k/next-cube: use memdev for RAM
d664fda m68k/mcf5208: use memdev for RAM
0ed8640 m68k/an5206: use memdev for RAM
2bafeaa lm32/milkymist: use memdev for RAM
5d13e10 lm32/lm32_boards: use memdev for RAM
1d97c07 x86/pc: use memdev for RAM
0628c4d x86/microvm: use memdev for RAM
f420b0e hppa: use memdev for RAM
a2a5383 hw/hppa/machine: Map the PDC memory region with higher priority
ce86cda hw/hppa/machine: Restrict the total memory size to 3GB
f451860 hw/hppa/machine: Correctly check the firmware is in PDC range
1220207 cris/axis_dev88: use memdev for RAM
0bf39f2 null-machine: use memdev for RAM
21613ae s390x/s390-virtio-ccw: use memdev for RAM
3641332 arm/xlnx-zcu102: use memdev for RAM
478a2a9 arm/xlnx-versal-virt: use memdev for RAM
07e35dd arm/xilinx_zynq: use memdev for RAM
ec3ff8e arm/xilinx_zynq: drop RAM size fixup
c73467d arm/virt: use memdev for RAM
a03708e arm/vexpress: use memdev for RAM
9dfd635 arm/versatilepb: use memdev for RAM
6b6397a arm/sbsa-ref: use memdev for RAM
10babd5 arm/sabrelite: use memdev for RAM
33a4e2b arm/raspi: use memdev for RAM
85cd733 arm/palm: use memdev for RAM
e587591 arm/omap_sx1: use memdev for RAM
44b7506 arm/nseries: use memdev for RAM
310bbb2 arm/musicpal: use memdev for RAM
cc5a043 arm/mps2: use memdev for RAM
e032a25 arm/mps2-tz: use memdev for RAM
0abbf17 arm/mcimx7d-sabre: use memdev for RAM
a44bded arm/mcimx6ul-evk: use memdev for RAM
395bc05 arm/kzm: use memdev for RAM
90a7cd2 arm/kzm: drop RAM size fixup
ca13b69 arm/integratorcp: use memdev for RAM
0893e7d arm/imx25_pdk: use memdev for RAM
021caf5 arm/imx25_pdk: drop RAM size fixup
af2dbf9 arm/highbank: use memdev for RAM
6e9dc93 arm/digic_boards: use memdev for RAM
64313e8 arm/cubieboard: use memdev for RAM
425d057 arm/collie: use memdev for RAM
73e2bc8 arm/aspeed: use memdev for RAM
6de64f3 arm/aspeed: actually check RAM size
954e0ec alpha:dp264: use memdev for RAM
34f13c1 initialize MachineState::ram in NUMA case
fdfae56 machine: introduce convenience MachineState::ram
065fc14 machine: alias -mem-path and -mem-prealloc into memory-foo backend
76900f9 machine: introduce memory-backend property
6a49dc0 numa: remove deprecated -mem-path fallback to anonymous RAM

=== OUTPUT BEGIN ===
1/80 Checking commit 6a49dc0538bc (numa: remove deprecated -mem-path fallback to anonymous RAM)
2/80 Checking commit 76900f97f62a (machine: introduce memory-backend property)
3/80 Checking commit 065fc1476423 (machine: alias -mem-path and -mem-prealloc into memory-foo backend)
4/80 Checking commit fdfae5645ca1 (machine: introduce convenience MachineState::ram)
5/80 Checking commit 34f13c129a81 (initialize MachineState::ram in NUMA case)
6/80 Checking commit 954e0ec8737b (alpha:dp264: use memdev for RAM)
ERROR: spaces required around that '*' (ctx:WxV)
#30: FILE: hw/alpha/alpha_sys.h:14:
+PCIBus *typhoon_init(MemoryRegion *, ISABus **, qemu_irq *, AlphaCPU *[4],
                                                                      ^

total: 1 errors, 0 warnings, 49 lines checked

Patch 6/80 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

7/80 Checking commit 6de64f38ddf7 (arm/aspeed: actually check RAM size)
8/80 Checking commit 73e2bc8bb37e (arm/aspeed: use memdev for RAM)
9/80 Checking commit 425d057fe70e (arm/collie: use memdev for RAM)
10/80 Checking commit 64313e86133a (arm/cubieboard: use memdev for RAM)
11/80 Checking commit 6e9dc93c1ae2 (arm/digic_boards: use memdev for RAM)
12/80 Checking commit af2dbf980370 (arm/highbank: use memdev for RAM)
13/80 Checking commit 021caf507b43 (arm/imx25_pdk: drop RAM size fixup)
14/80 Checking commit 0893e7d219c7 (arm/imx25_pdk: use memdev for RAM)
15/80 Checking commit ca13b699384c (arm/integratorcp: use memdev for RAM)
16/80 Checking commit 90a7cd27125c (arm/kzm: drop RAM size fixup)
17/80 Checking commit 395bc059e5e6 (arm/kzm: use memdev for RAM)
18/80 Checking commit a44bded9b399 (arm/mcimx6ul-evk: use memdev for RAM)
19/80 Checking commit 0abbf178464e (arm/mcimx7d-sabre: use memdev for RAM)
20/80 Checking commit e032a25b1bdf (arm/mps2-tz: use memdev for RAM)
21/80 Checking commit cc5a04303320 (arm/mps2: use memdev for RAM)
22/80 Checking commit 310bbb26a5d0 (arm/musicpal: use memdev for RAM)
23/80 Checking commit 44b7506173d1 (arm/nseries: use memdev for RAM)
24/80 Checking commit e5875912377a (arm/omap_sx1: use memdev for RAM)
25/80 Checking commit 85cd73342f55 (arm/palm: use memdev for RAM)
26/80 Checking commit 33a4e2b7e025 (arm/raspi: use memdev for RAM)
27/80 Checking commit 10babd50e8f7 (arm/sabrelite: use memdev for RAM)
28/80 Checking commit 6b6397ae93b6 (arm/sbsa-ref: use memdev for RAM)
29/80 Checking commit 9dfd635f4a05 (arm/versatilepb: use memdev for RAM)
30/80 Checking commit a03708e51b2d (arm/vexpress: use memdev for RAM)
31/80 Checking commit c73467dcc7bd (arm/virt: use memdev for RAM)
32/80 Checking commit ec3ff8eaf9c7 (arm/xilinx_zynq: drop RAM size fixup)
33/80 Checking commit 07e35dd85c30 (arm/xilinx_zynq: use memdev for RAM)
34/80 Checking commit 478a2a976000 (arm/xlnx-versal-virt: use memdev for RAM)
35/80 Checking commit 364133212cca (arm/xlnx-zcu102: use memdev for RAM)
36/80 Checking commit 21613ae37fe5 (s390x/s390-virtio-ccw: use memdev for RAM)
37/80 Checking commit 0bf39f2f5bfd (null-machine: use memdev for RAM)
38/80 Checking commit 1220207531bd (cris/axis_dev88: use memdev for RAM)
39/80 Checking commit f45186045981 (hw/hppa/machine: Correctly check the firmware is in PDC range)
40/80 Checking commit ce86cda1a8e7 (hw/hppa/machine: Restrict the total memory size to 3GB)
41/80 Checking commit a2a538392cf6 (hw/hppa/machine: Map the PDC memory region with higher priority)
42/80 Checking commit f420b0e2cd93 (hppa: use memdev for RAM)
43/80 Checking commit 0628c4d5d8be (x86/microvm: use memdev for RAM)
44/80 Checking commit 1d97c07c047f (x86/pc: use memdev for RAM)
45/80 Checking commit 5d13e105726d (lm32/lm32_boards: use memdev for RAM)
46/80 Checking commit 2bafeaab1467 (lm32/milkymist: use memdev for RAM)
47/80 Checking commit 0ed8640372a0 (m68k/an5206: use memdev for RAM)
48/80 Checking commit d664fdabf784 (m68k/mcf5208: use memdev for RAM)
49/80 Checking commit 288b0f9f7c1a (m68k/next-cube: use memdev for RAM)
50/80 Checking commit 2349c09ed98b (mips/boston-cube: use memdev for RAM)
51/80 Checking commit f7ef86f11f0b (mips/mips_fulong2e: drop RAM size fixup)
52/80 Checking commit b4e5189ba317 (mips/mips_fulong2e: use memdev for RAM)
53/80 Checking commit 49962bea6cb5 (mips/mips_jazz: use memdev for RAM)
54/80 Checking commit 74f382e62b3c (mips/mips_malta: use memdev for RAM)
55/80 Checking commit 6c48078f9a68 (mips/mips_mipssim: use memdev for RAM)
56/80 Checking commit 06ffc734cd43 (mips/mips_r4k: use memdev for RAM)
57/80 Checking commit 8f3183989d32 (ppc/e500: drop RAM size fixup)
58/80 Checking commit 281b13dcac57 (ppc/e500: use memdev for RAM)
59/80 Checking commit 46e62170c054 (ppc/mac_newworld: use memdev for RAM)
60/80 Checking commit 3bec0ee0a72c (ppc/mac_oldworld: use memdev for RAM)
61/80 Checking commit fe790ac8de76 (ppc/pnv: use memdev for RAM)
62/80 Checking commit 9741a0e38c44 (ppc/ppc405_boards: add RAM size checks)
63/80 Checking commit dd1098217df9 (ppc/ppc405_boards: use memdev for RAM)
64/80 Checking commit d02eb66b089e (ppc/{ppc440_bamboo, sam460ex}: drop RAM size fixup)
65/80 Checking commit 4f02b90b6cec (ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM)
WARNING: Block comments use a leading /* on a separate line
#48: FILE: hw/ppc/ppc4xx_devs.c:669:
+/* Split RAM between SDRAM banks.

total: 0 errors, 1 warnings, 103 lines checked

Patch 65/80 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
66/80 Checking commit d5ec039191e8 (ppc/prep: use memdev for RAM)
67/80 Checking commit 7f5e309237cf (ppc/spapr: use memdev for RAM)
68/80 Checking commit 2b9aeb4d5e28 (ppc/virtex_ml507: remove unused arguments)
69/80 Checking commit c35345cc9c8e (ppc/virtex_ml507: use memdev for RAM)
70/80 Checking commit 6c883537133c (sparc/leon3: use memdev for RAM)
71/80 Checking commit 6b50ac9a623d (sparc/sun4m: use memdev for RAM)
72/80 Checking commit 6a13317c51a2 (sparc/niagara: use memdev for RAM)
73/80 Checking commit 294588be8a80 (remove no longer used memory_region_allocate_system_memory())
74/80 Checking commit 937af3df4f2d (exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize())
75/80 Checking commit cac70772ccef (exec: drop bogus mem_path from qemu_ram_alloc_from_fd())
76/80 Checking commit a0a8b7fc4f32 (make mem_path local variable)
77/80 Checking commit 339ae3c25248 (hostmem: introduce "prealloc-threads" property)
78/80 Checking commit e6ea9bb4c870 (hostmem: fix strict bind policy)
79/80 Checking commit 64e4393761e9 (tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups)
80/80 Checking commit 28f0d4235892 (tests:numa-test: use explicit memdev to specify node RAM)
=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/1579779525-20065-1-git-send-email-imammedo@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com
Laurent Vivier Jan. 23, 2020, 2:45 p.m. UTC | #2
Le 23/01/2020 à 12:37, Igor Mammedov a écrit :
> 
> v3:
>   - due to libvirt not being ready, postpone till 5.1
>      * [PATCH v2 82/86] numa: forbid '-numa node,  mem' for 5.0 and newer machine types
>      and depended
>        [PATCH v2 86/86] numa: remove deprecated implicit RAM distribution  between nodes
>   - drop as not related "[PATCH v2 85/86] numa: make exit() usage consistent"
>   - drop "[PATCH v2 76/86] post conversion default_ram_id cleanup"
>     so that default memory-backedend won't be created for boards that do not care
>     about -m. Which makes -m optin feature. We should decide  what do in  case
>     board doesn't use -m (but that's out of scope of this series)
>   - use object_register_sugar_prop() instead of hacking compat props directly
>   - simplified/reworked aspeed patches
>   - s/RAM_ADDR_FMT/size_to_str()/
>   - rename 'ram-memdev' property to 'memory-backend'
>   - minor fixes to numa-test
>   - fixes for issues noticed during review of
>        [PATCH v2 66/86] ppc/{ppc440_bamboo,sam460x}: drop RAM size fixup
> 
> v2:
>   - fix compile errors on mingw32 host by introducing RAM_ADDR_UFMT [11/86]
>   - replace "[PATCH 43/86] hppa: drop RAM size fixup" with alternative
>     patches made by Philippe (which effectively do the same thing but other
>     way around)
>   - ppc440: fix crash and add suggested valid RAM size in error output.
>     s/ppc4xx_sdram_adjust/ppc4xx_sdram_prep/ and simplify it by removing
>     not necessary nested loop
>   - rebase on current master due to new conflicts
> 
> 
> Series removes ad hoc RAM allocation API (memory_region_allocate_system_memory)
> and consolidates it around hostmem backend. It allows to
>  * resolve conflicts between global -mem-prealloc and hostmem's "policy" option
>    fixing premature allocation before binding policy is applied
>  * simplify complicated memory allocation routines which had to deal with 2 ways
>    to allocate RAM.
>  * it allows to reuse hostmem backends of a choice for main RAM without adding
>    extra CLI options to duplicate hostmem features.
>    Recent case was -mem-shared, to enable vhost-user on targets that don't
>    support hostmem backends [1] (ex: s390)
>  * move RAM allocation from individual boards into generic machine code and
>    provide them with prepared MemoryRegion.
>  * clean up deprecated NUMA features which were tied to the old API (see patches)
>     - "numa: remove deprecated -mem-path fallback to anonymous RAM"
>     - (POSTPONED, waiting on libvirt side) "forbid '-numa node,mem' for 5.0 and newer machine types"
>     - (POSTPONED) "numa: remove deprecated implicit RAM distribution between nodes"
> 
> Conversion introduces a new machine.memory-backend property and wrapper code that
> aliases global -mem-path and -mem-alloc into automatically created hostmem
> backend properties (provided memory-backend was not set explicitly given by user).
> And then follows bulk of trivial patches that incrementally convert individual
> boards to using machine.memory-backend provided MemoryRegion.
> 
> Board conversion typically involves:
>  * providing MachineClass::default_ram_size and MachineClass::default_ram_id
>    so generic code could create default backend if user didn't explicitly provide
>    memory-backend or -m options
>  * dropping memory_region_allocate_system_memory() call
>  * using convenience MachineState::ram MemoryRegion, which points to MemoryRegion
>    allocated by ram-memdev
> On top of that for some boards:
>  * added missing ram_size checks (typically it were boards with fixed ram size)
>  * ram_size fixups were replaced by checks and hard errors, forcing user to
>    provide correct "-m" values instead of ignoring it and continuing running.
> 
> After all boards are converted the old API is removed and memory allocation
> routines are cleaned up.
> 
> git tree for testing:
>   https://github.com/imammedo/qemu convert_main_ram_to_memdev_v3
> 
> previous rev:
>   https://github.com/imammedo/qemu convert_main_ram_to_memdev_v2
>   https://lists.nongnu.org/archive/html/qemu-devel/2020-01/msg02960.html
> 
> 
> Igor Mammedov (77):
>   numa: remove deprecated -mem-path fallback to anonymous RAM
>   machine: introduce memory-backend property
>   machine: alias -mem-path and -mem-prealloc into memory-foo backend
>   machine: introduce convenience MachineState::ram
>   initialize MachineState::ram in NUMA case
>   alpha:dp264: use memdev for RAM
>   arm/aspeed: actually check RAM size
>   arm/aspeed: use memdev for RAM
>   arm/collie: use memdev for RAM
>   arm/cubieboard: use memdev for RAM
>   arm/digic_boards: use memdev for RAM
>   arm/highbank: use memdev for RAM
>   arm/imx25_pdk: drop RAM size fixup
>   arm/imx25_pdk: use memdev for RAM
>   arm/integratorcp: use memdev for RAM
>   arm/kzm: drop RAM size fixup
>   arm/kzm: use memdev for RAM
>   arm/mcimx6ul-evk: use memdev for RAM
>   arm/mcimx7d-sabre: use memdev for RAM
>   arm/mps2-tz: use memdev for RAM
>   arm/mps2: use memdev for RAM
>   arm/musicpal: use memdev for RAM
>   arm/nseries: use memdev for RAM
>   arm/omap_sx1: use memdev for RAM
>   arm/palm: use memdev for RAM
>   arm/raspi: use memdev for RAM
>   arm/sabrelite: use memdev for RAM
>   arm/sbsa-ref: use memdev for RAM
>   arm/versatilepb: use memdev for RAM
>   arm/vexpress: use memdev for RAM
>   arm/virt: use memdev for RAM
>   arm/xilinx_zynq: drop RAM size fixup
>   arm/xilinx_zynq: use memdev for RAM
>   arm/xlnx-versal-virt: use memdev for RAM
>   arm/xlnx-zcu102: use memdev for RAM
>   s390x/s390-virtio-ccw: use memdev for RAM
>   null-machine: use memdev for RAM
>   cris/axis_dev88: use memdev for RAM
>   hppa: use memdev for RAM
>   x86/microvm: use memdev for RAM
>   x86/pc: use memdev for RAM
>   lm32/lm32_boards: use memdev for RAM
>   lm32/milkymist: use memdev for RAM
>   m68k/an5206: use memdev for RAM
>   m68k/mcf5208: use memdev for RAM
>   m68k/next-cube: use memdev for RAM
>   mips/boston-cube: use memdev for RAM
>   mips/mips_fulong2e: drop RAM size fixup
>   mips/mips_fulong2e: use memdev for RAM
>   mips/mips_jazz: use memdev for RAM
>   mips/mips_malta: use memdev for RAM
>   mips/mips_mipssim: use memdev for RAM
>   mips/mips_r4k: use memdev for RAM
>   ppc/e500: drop RAM size fixup
>   ppc/e500: use memdev for RAM
>   ppc/mac_newworld: use memdev for RAM
>   ppc/mac_oldworld: use memdev for RAM
>   ppc/pnv: use memdev for RAM
>   ppc/ppc405_boards: add RAM size checks
>   ppc/ppc405_boards: use memdev for RAM
>   ppc/{ppc440_bamboo,sam460ex}: drop RAM size fixup
>   ppc/{ppc440_bamboo, sam460ex}: use memdev for RAM
>   ppc/prep: use memdev for RAM
>   ppc/spapr: use memdev for RAM
>   ppc/virtex_ml507: remove unused arguments
>   ppc/virtex_ml507: use memdev for RAM
>   sparc/leon3: use memdev for RAM
>   sparc/sun4m: use memdev for RAM
>   sparc/niagara: use memdev for RAM
>   remove no longer used memory_region_allocate_system_memory()
>   exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()
>   exec: drop bogus mem_path from qemu_ram_alloc_from_fd()
>   make mem_path local variable
>   hostmem: introduce "prealloc-threads" property
>   hostmem: fix strict bind policy
>   tests:numa-test: make top level args dynamic and g_autofree(cli)
>     cleanups
>   tests:numa-test: use explicit memdev to specify node RAM
> 
> Philippe Mathieu-Daudé (3):
>   hw/hppa/machine: Correctly check the firmware is in PDC range
>   hw/hppa/machine: Restrict the total memory size to 3GB
>   hw/hppa/machine: Map the PDC memory region with higher priority
> 
>  hw/alpha/alpha_sys.h          |   2 +-
>  include/hw/boards.h           |  48 +++++----------
>  include/hw/misc/aspeed_sdmc.h |   1 +
>  include/hw/ppc/ppc4xx.h       |   9 ++-
>  include/sysemu/hostmem.h      |  20 +++++-
>  include/sysemu/numa.h         |   1 +
>  include/sysemu/sysemu.h       |   2 -
>  backends/hostmem-file.c       |   8 ---
>  backends/hostmem-memfd.c      |   1 -
>  backends/hostmem-ram.c        |   2 -
>  backends/hostmem.c            |  53 +++++++++++-----
>  exec.c                        |  66 +++-----------------
>  hw/alpha/dp264.c              |   3 +-
>  hw/alpha/typhoon.c            |   8 +--
>  hw/arm/aspeed.c               |  18 +++---
>  hw/arm/collie.c               |  17 ++++--
>  hw/arm/cubieboard.c           |  25 +++-----
>  hw/arm/digic_boards.c         |  40 ++++++------
>  hw/arm/highbank.c             |  10 ++-
>  hw/arm/imx25_pdk.c            |  13 ++--
>  hw/arm/integratorcp.c         |   9 ++-
>  hw/arm/kzm.c                  |  18 +++---
>  hw/arm/mcimx6ul-evk.c         |  25 +++-----
>  hw/arm/mcimx7d-sabre.c        |  25 +++-----
>  hw/arm/mps2-tz.c              |  15 +++--
>  hw/arm/mps2.c                 |  15 +++--
>  hw/arm/musicpal.c             |  18 ++++--
>  hw/arm/nseries.c              |  32 ++++++----
>  hw/arm/omap_sx1.c             |  20 ++++--
>  hw/arm/palm.c                 |  20 ++++--
>  hw/arm/raspi.c                |  34 ++++-------
>  hw/arm/sabrelite.c            |  23 +++----
>  hw/arm/sbsa-ref.c             |   7 +--
>  hw/arm/versatilepb.c          |   7 +--
>  hw/arm/vexpress.c             |  14 ++---
>  hw/arm/virt.c                 |   7 +--
>  hw/arm/xilinx_zynq.c          |  20 +++---
>  hw/arm/xlnx-versal-virt.c     |   7 +--
>  hw/arm/xlnx-zcu102.c          |   7 +--
>  hw/core/machine.c             |  30 +++++++++
>  hw/core/null-machine.c        |   8 +--
>  hw/core/numa.c                | 101 +++++++++----------------------
>  hw/cris/axis_dev88.c          |   8 +--
>  hw/hppa/machine.c             |  19 +++---
>  hw/i386/microvm.c             |  12 ++--
>  hw/i386/pc.c                  |  19 +++---
>  hw/lm32/lm32_boards.c         |  39 ++++++++----
>  hw/lm32/milkymist.c           |  21 ++++---
>  hw/m68k/an5206.c              |   5 +-
>  hw/m68k/mcf5208.c             |   5 +-
>  hw/m68k/next-cube.c           |   5 +-

Could you add hw/m68k/q800.c ?

Thanks,
Laurent