refactor main RAM allocation to use hostmem backend
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest79 patches 3 repliesIn review
- v579 patches 103 repliesSuperseded
- v480 patches 19 repliesSuperseded
Earlier versions · 4
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 posting 2/2 | 80 patches | 49 replies | Applied | |
| v3 posting 1/2 | 2 of 80 patches | 0 replies | Superseded | |
| v2 | 86 patches | 97 replies | Superseded | |
| v1 | 86 patches | 45 replies | Superseded |
Changes in v6 from the cover letter
- put back arm_boot_info::ram_size initialization removed by mistake in 'arm/collie: use memdev for RAM' and 'arm/palm: use memdev for RAM' patches
- 'arm/xilinx_zynq: drop RAM size fixup', use GiB instead of hex numbers to make code/error message more readable
- do not mention 'follow up patches' in commit message of 'tests:numa-test: use explicit memdev to specify node RAM' to avoid confusion.
- pick up new Reviewed-by-s
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/79 | numa: remove deprecated -mem-path fallback to anonymous RAMhw/ qemu-deprecated.texi | +1 | 0 replies | |
| 2/79 | machine: introduce memory-backend propertyhw/ include/ | +26 | 0 replies | |
| 3/79 | machine: alias -mem-path and -mem-prealloc into memory-foo backendbackends/ backends/ include/ +2 more | +49 | 0 replies | |
| 4/79 | machine: introduce convenience MachineState::ramhw/ hw/ include/ | +36 | 0 replies | |
| 5/79 | initialize MachineState::ram in NUMA casehw/ include/ vl.c | +32 | 0 replies | |
| 6/79 | vl.c: move -m parsing after memory backends has been processedvl.c | +14 | 0 replies | |
| 7/79 | vl.c: ensure that ram_size matches size of machine.memory-backendvl.c | +15 | 0 replies | |
| 8/79 | alpha/dp264: use memdev for RAMhw/ hw/ hw/ | +5 | 0 replies | |
| 9/79 | arm/aspeed: actually check RAM sizehw/ hw/ include/ | +70 | 0 replies | |
| 10/79 | arm/aspeed: use memdev for RAMhw/ | +2 | 0 replies | |
| 11/79 | arm/collie: use memdev for RAMhw/ | +12 | 0 replies | |
| 12/79 | arm/cubieboard: use memdev for RAMhw/ | +8 | 0 replies | |
| 13/79 | arm/digic_boards: use memdev for RAMhw/ | +21 | 0 replies | |
| 14/79 | arm/highbank: use memdev for RAMhw/ | +4 | 0 replies | |
| 15/79 | arm/imx25_pdk: drop RAM size fixuphw/ | +6 | 0 replies | |
| 16/79 | arm/imx25_pdk: use memdev for RAMhw/ | +4 | 0 replies | |
| 17/79 | arm/integratorcp: use memdev for RAMhw/ | +4 | 0 replies | |
| 18/79 | arm/kzm: drop RAM size fixuphw/ | +5 | 0 replies | |
| 19/79 | arm/kzm: use memdev for RAMhw/ | +4 | 0 replies | |
| 20/79 | arm/mcimx6ul-evk: use memdev for RAMhw/ | +9 | 0 replies | |
| 21/79 | arm/mcimx7d-sabre: use memdev for RAMhw/ | +9 | 0 replies | |
| 22/79 | arm/mps2-tz: use memdev for RAMhw/ | +11 | 0 replies | |
| 23/79 | arm/mps2: use memdev for RAMhw/ | +11 | 0 replies | |
| 24/79 | arm/musicpal: use memdev for RAMhw/ | +13 | 0 replies | |
| 25/79 | arm/nseries: use memdev for RAMhw/ | +19 | 0 replies | |
| 26/79 | arm/omap_sx1: use memdev for RAMhw/ | +15 | 0 replies | |
| 27/79 | arm/palm: use memdev for RAMhw/ | +14 | 0 replies | |
| 28/79 | arm/sabrelite: use memdev for RAMhw/ | +8 | 0 replies | |
| 29/79 | arm/raspi: use memdev for RAMhw/ | +4 | 0 replies | |
| 30/79 | arm/sbsa-ref: use memdev for RAMhw/ | +3 | 0 replies | |
| 31/79 | arm/versatilepb: use memdev for RAMhw/ | +3 | 0 replies | |
| 32/79 | arm/vexpress: use memdev for RAMhw/ | +5 | 0 replies | |
| 33/79 | arm/virt: use memdev for RAMhw/ | +3 | 0 replies | |
| 34/79 | arm/xilinx_zynq: drop RAM size fixuphw/ | +8 | 0 replies | |
| 35/79 | arm/xilinx_zynq: use memdev for RAMhw/ | +2 | 0 replies | |
| 36/79 | arm/xlnx-versal-virt: use memdev for RAMhw/ | +2 | 0 replies | |
| 37/79 | arm/xlnx-zcu102: use memdev for RAMhw/ | +2 | 0 replies | |
| 38/79 | s390x/s390-virtio-ccw: use memdev for RAMhw/ | +3 | 0 replies | |
| 39/79 | null-machine: use memdev for RAMhw/ | +3 | 0 replies | |
| 40/79 | cris/axis_dev88: use memdev for RAMhw/ | +2 | 0 replies | |
| 41/79 | hppa: use memdev for RAMhw/ | +3 | 0 replies | |
| 42/79 | x86/microvm: use memdev for RAMhw/ | +5 | 0 replies | |
| 43/79 | x86/pc: use memdev for RAMhw/ | +9 | 0 replies | |
| 44/79 | lm32/lm32_boards: use memdev for RAMhw/ | +26 | 0 replies | |
| 45/79 | lm32/milkymist: use memdev for RAMhw/ | +14 | 0 replies | |
| 46/79 | m68k/an5206: use memdev for RAMhw/ | +2 | 0 replies | |
| 47/79 | m68k/q800: use memdev for RAMhw/ | +2 | 0 replies | |
| 48/79 | m68k/mcf5208: use memdev for RAMhw/ | +2 | 0 replies | |
| 49/79 | m68k/next-cube: use memdev for RAMhw/ | +2 | 0 replies | |
| 50/79 | mips/boston: use memdev for RAMhw/ | +5 | 0 replies | |
| 51/79 | mips/mips_fulong2e: drop RAM size fixuphw/ | +8 | 0 replies | |
| 52/79 | mips/mips_fulong2e: use memdev for RAMhw/ | +2 | 0 replies | |
| 53/79 | mips/mips_jazz: use memdev for RAMhw/ | +3 | 0 replies | |
| 54/79 | mips/mips_jazz: add max ram size checkhw/ | +5 | 0 replies | |
| 55/79 | mips/mips_malta: use memdev for RAMhw/ | +4 | 0 replies | |
| 56/79 | mips/mips_mipssim: use memdev for RAMhw/ | +3 | 0 replies | |
| 57/79 | mips/mips_r4k: use memdev for RAMhw/ | +4 | 0 replies | |
| 58/79 | ppc/e500: drop RAM size fixuphw/ | +9 | 0 replies | |
| 59/79 | ppc/e500: use memdev for RAMhw/ hw/ hw/ | +3 | 0 replies | |
| 60/79 | ppc/mac_newworld: use memdev for RAMhw/ | +3 | 0 replies | |
| 61/79 | ppc/mac_oldworld: use memdev for RAMhw/ | +2 | 0 replies | |
| 62/79 | ppc/pnv: use memdev for RAMhw/ | +2 | 0 replies | |
| 63/79 | ppc/ppc405_boards: add RAM size checkshw/ | +26 | 0 replies | |
| 64/79 | ppc/ppc405_boards: use memdev for RAMhw/ | +6 | 0 replies | |
| 65/79 | ppc/{ppc440_bamboo, sam460ex}: drop RAM size fixuphw/ hw/ hw/ +1 more | +42 | 0 replies | |
| 66/79 | ppc/{ppc440_bamboo, sam460ex}: use memdev for RAMhw/ hw/ hw/ +1 more | +17 | 0 replies | |
| 67/79 | ppc/spapr: use memdev for RAMhw/ | +3 | 0 replies | |
| 68/79 | ppc/virtex_ml507: use memdev for RAMhw/ | +5 | 0 replies | |
| 69/79 | sparc/leon3: use memdev for RAMhw/ | +3 | 0 replies | |
| 70/79 | sparc/sun4m: use memdev for RAMhw/ | +37 | 0 replies | |
| 71/79 | sparc/niagara: use memdev for RAMhw/ | +2 | 0 replies | |
| 72/79 | remove no longer used memory_region_allocate_system_memory()hw/ include/ | +0 | 0 replies | |
| 73/79 | exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()exec.c | +4 | 0 replies | |
| 74/79 | exec: drop bogus mem_path from qemu_ram_alloc_from_fd()exec.c | +2 | 0 replies | |
| 75/79 | make mem_path local variableinclude/ vl.c | +1 | 0 replies | |
| 76/79 | hostmem: introduce "prealloc-threads" propertybackends/ include/ vl.c | +51 | 0 replies | |
| 77/79 | hostmem: fix strict bind policybackends/ backends/ backends/ +4 more | +4 | 0 replies | |
| 78/79 | tests/numa-test: make top level args dynamic and g_autofree(cli) cleanupstests/ | +54 | 0 replies | |
| 79/79 | tests:numa-test: use explicit memdev to specify node RAMtests/ | +18 | 0 replies |
Reviews trailers per patch
72 of 79 patches have a Reviewed-by or Acked-by.
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 17 reviewers.
Cover letter [PATCH v6 00/79] refactor main RAM allocation to use hostmem backend
v6:
- put back arm_boot_info::ram_size initialization removed by mistake in 'arm/collie: use memdev for RAM' and 'arm/palm: use memdev for RAM' patches
- 'arm/xilinx_zynq: drop RAM size fixup', use GiB instead of hex numbers to make code/error message more readable
- do not mention 'follow up patches' in commit message of 'tests:numa-test: use explicit memdev to specify node RAM' to avoid confusion.
- pick up new Reviewed-by-s
v5:
- pick up new Reviewed-by-s
- drop "ppc/prep: use memdev for RAM" since machine was removed
- add patch "mips/mips_jazz: add max ram size check"
- extend comment for "default_ram_id" to clarify that's setting it serves as optin flag for -m support. [03/79]
- rebase "arm/raspi: use memdev for RAM" once more
v4:
- pick up new Reviewed-by-s
- Fix access to uninitialized pagesize/hpsize in
"[PATCH REPOST v3 74/80] exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()"
- Make explicitly provided memory-backend work by using string property instead of link so it would be possible to delay access to the backend to the time when backends are initialized.
- added new patches to make explicit backend work nice with -m and do sanity check on ram_size
'vl.c: move -m parsing after memory backends has been processed' 'vl.c: ensure that ram_size matches size of machine.memory-backend"
all this ram_size business needs cleanup too, but that's out of the scope of this series.
- include m68k/q800 board into conversion
- drop patches that were merged through other trees
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 fixupv2:
- 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_v6
previous rev:
https://github.com/imammedo/qemu convert_main_ram_to_memdev_v5
Igor Mammedov (79):
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
vl.c: move -m parsing after memory backends has been processed vl.c: ensure that ram_size matches size of machine.memory-backend 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/sabrelite: use memdev for RAM
arm/raspi: 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/q800: use memdev for RAM
m68k/mcf5208: use memdev for RAM
m68k/next-cube: use memdev for RAM
mips/boston: 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_jazz: add max ram size check
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/spapr: use memdev for RAM
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
hw/alpha/alpha_sys.h | 2 +- include/hw/boards.h | 54 ++++++------- 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 | 64 ++-------------- hw/alpha/dp264.c | 3 +- hw/alpha/typhoon.c | 8 +- hw/arm/aspeed.c | 18 ++--- hw/arm/collie.c | 16 +++- hw/arm/cubieboard.c | 25 ++---- hw/arm/digic_boards.c | 40 +++++----- hw/arm/highbank.c | 10 +-- hw/arm/imx25_pdk.c | 19 ++--- 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 | 19 +++-- hw/arm/raspi.c | 10 +-- 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 | 48 ++++++++++++ hw/core/null-machine.c | 8 +- hw/core/numa.c | 101 +++++++------------------ hw/cris/axis_dev88.c | 8 +- hw/hppa/machine.c | 10 +-- 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/m68k/q800.c | 6 +- hw/mips/boston.c | 11 ++- hw/mips/mips_fulong2e.c | 15 ++-- hw/mips/mips_jazz.c | 12 ++- 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 | 67 ++++++++--------- hw/ppc/sam460ex.c | 6 +- hw/ppc/spapr.c | 8 +- hw/ppc/virtex_ml507.c | 12 ++- hw/s390x/s390-virtio-ccw.c | 7 +- hw/sparc/leon3.c | 6 +- hw/sparc/sun4m.c | 74 +++++++++--------- hw/sparc64/niagara.c | 7 +- qemu-deprecated.texi | 9 --- tests/qtest/numa-test.c | 138 ++++++++++++++++++---------------- vl.c | 78 +++++++++++++++---- 78 files changed, 829 insertions(+), 775 deletions(-)
Signature · 1 line
2.18.1