[BUG qemu 4.0] segfault when unplugging virtio-blk-pci device

2019-12-31 Thread Eryu Guan
Hi, I'm using qemu 4.0 and hit segfault when tearing down kata sandbox, I think it's because io completion hits use-after-free when device is already gone. Is this a known bug that has been fixed? (I went through the git log but didn't find anything obvious). gdb backtrace is: Core was generated

Re: [BUG qemu 4.0] segfault when unplugging virtio-blk-pci device

2019-12-31 Thread Igor Mammedov
On Tue, 31 Dec 2019 18:34:34 +0800 Eryu Guan wrote: > Hi, > > I'm using qemu 4.0 and hit segfault when tearing down kata sandbox, I > think it's because io completion hits use-after-free when device is > already gone. Is this a known bug that has been fixed? (I went through > the git log but did

Re: [PATCH 1/6] tests/boot_linux_console: Add initrd test for the CubieBoard

2019-12-31 Thread Philippe Mathieu-Daudé
On 12/30/19 9:52 PM, Wainer dos Santos Moschetta wrote: On 12/30/19 9:09 AM, Philippe Mathieu-Daudé wrote: This test boots a Linux kernel on a CubieBoard and verify the serial output is working. The kernel image and DeviceTree blob are built by the Armbian project (based on Debian): https://doc

[PATCH 05/86] machine: alias -mem-path and -mem-prealloc into memory-foo backend

2019-12-31 Thread Igor Mammedov
Allow a machine to opt in for hostmem backend based initial RAM even if user used old -mem-path/prealloc options by providing MachineClass::default_ram_id Follow up patches will incrementally convert machines to new API, by dropping memory_region_allocate_system_memory() and setting default_ram_i

[PATCH 00/86] refactor main RAM allocation to use hostmem backend

2019-12-31 Thread Igor Mammedov
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 compli

[PATCH 02/86] numa: properly check if numa is supported

2019-12-31 Thread Igor Mammedov
Commit aa57020774b, by mistake used MachineClass::numa_mem_supported to check if NUMA is supported by machine and also as unrelated change set it to true for sbsa-ref board. Luckily change didn't break machines that support NUMA, as the field is set to true for them. But the field is not intended

[PATCH 03/86] numa: remove deprecated -mem-path fallback to anonymous RAM

2019-12-31 Thread Igor Mammedov
it was deprecated since 4.0 by commit cb79224b7 (deprecate -mem-path fallback to anonymous RAM) Deprecation period ran ont and it's time to remove it so it won't get in a way of switching to using hostmem backend for RAM. Signed-off-by: Igor Mammedov --- hw/core/numa.c | 18 +-

[PATCH 04/86] machine: introduce ram-memdev property

2019-12-31 Thread Igor Mammedov
Property will contain link to memory backend that will be used for backing initial RAM. Follow up commit will alias -mem-path and -mem-prealloc CLI options into memory backend options to make memory handling consistent (using only hostmem backend family for guest RAM allocation). Signed-off-by: Ig

[PATCH 07/86] initialize MachineState::ram in NUMA case

2019-12-31 Thread Igor Mammedov
In case of NUMA there are 2 cases to consider: 1. '-numa node,memdev', the only one that will be available for 5.0 and newer machine types. In this case reuse current behavior, with only difference memdevs are put into MachineState::ram container + a temporary glue to keep memory_

[PATCH 01/86] numa: remove not needed check

2019-12-31 Thread Igor Mammedov
Currently parse_numa_node() is always called from already numa enabled context. Drop unnecessary check if numa is supported. Signed-off-by: Igor Mammedov Reviewed-by: Eduardo Habkost --- hw/core/numa.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/core/numa.c b/hw

[PATCH 11/86] hw:aspeed: drop warning and bogus ram_size fixup

2019-12-31 Thread Igor Mammedov
It was useless to try fixup ram_size and print warning on guest access to config register to begin with. Now previous patch made sure that SDMC can not be realized with invalid RAM size, so there is no case where warning and not used ram_size fixup could be triggered. So remove now dead code. Si

[PATCH 10/86] arm:aspeed: actually check RAM size

2019-12-31 Thread Igor Mammedov
It's supposed that SOC will check if "-m" provided RAM size is valid by setting "ram-size" property and then board would read back valid (possibly corrected value) to allocate/map RAM MemoryRegion with valid size. Well it isn't doing so, since check is called too late indirectly from aspeed_sdmc_

[PATCH 09/86] arm:aspeed: convert valid RAM sizes to data

2019-12-31 Thread Igor Mammedov
various foo_rambits() hardcode mapping of RAM sizes to RAM feature bits, which is hard to reuse and repeats over and over. Convert maps into GLib's hash tables and perform mapping using common mapping function. Follow up patch will reuse tables for actually checking ram-size property. Signed-off

[PATCH 06/86] machine: introduce convenience MachineState::ram

2019-12-31 Thread Igor Mammedov
the new field will be used by boards to get access to main RAM memory region and will help to save boiler plate in boards which often add a field or variable just for this purpose. Memory region will be equivalent to what currently used memory_region_allocate_system_memory() is returning apart fro

[PATCH 21/86] arm:kzm: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 08/86] alpha:dp264: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 19/86] arm:integratorcp: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 12/86] arm:aspeed: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 20/86] arm:kzm: drop RAM size fixup

2019-12-31 Thread Igor Mammedov
If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to force user fix CLI, instead of accepting non-

[PATCH 15/86] arm:digic_boards: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 18/86] arm:imx25_pdk: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 22/86] arm:mcimx6ul-evk: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 16/86] arm:highbank: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 14/86] arm:cubieboard: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 33/86] arm:versatilepb: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 25/86] arm:mps2: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 24/86] arm:mps2-tz: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 37/86] arm:xilinx_zynq: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 23/86] arm:mcimx7d-sabre: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 28/86] arm:omap_sx1: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 26/86] arm:musicpal: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 30/86] arm:raspi: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 39/86] arm:xlnx-zcu102: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 27/86] arm:nseries: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 29/86] arm:palm: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 13/86] arm:collie: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 35/86] arm:virt: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and then map memory region provided by MachineState::ram

[PATCH 34/86] arm:vexpress: use memdev for RAM

2019-12-31 Thread Igor Mammedov
replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializing RAM memory region. Signed-off-by: Igor Mammedov --- hw/

[PATCH 53/86] mips:mips_fulong2e: drop RAM size fixup

2019-12-31 Thread Igor Mammedov
If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to force user fix CLI, instead of accepting non-

[PATCH 32/86] arm:sbsa-ref: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 41/86] null-machine: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 36/86] arm:xilinx_zynq: drop RAM size fixup

2019-12-31 Thread Igor Mammedov
If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to force user fix CLI, instead of accepting non-

[PATCH 52/86] mips:boston-cube: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 31/86] arm:sabrelite: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 40/86] s390x:s390-virtio-ccw: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 46/86] x86:pc: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 55/86] mips:mips_jazz: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 51/86] m68k:next-cube: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 43/86] hppa: drop RAM size fixup

2019-12-31 Thread Igor Mammedov
If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to force user fix CLI, instead of accepting non-

[PATCH 42/86] cris:axis_dev88: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 54/86] mips:mips_fulong2e: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 56/86] mips:mips_malta: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 45/86] x86:microvm: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 50/86] m68k:mcf5208: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 58/86] mips:mips_r4k: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 62/86] ppc:mac_oldworld: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 48/86] lm32:milkymist: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 47/86] lm32:lm32_boards: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 69/86] ppc:spapr: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 59/86] ppc:e500: drop RAM size fixup

2019-12-31 Thread Igor Mammedov
If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to force user fix CLI, instead of accepting non-

[PATCH 44/86] hppa: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 57/86] mips:mips_mipssim: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 67/86] ppc:ppc440_bamboo/sam460ex: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 65/86] ppc:ppc405_boards: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 49/86] m68k:an5206: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 73/86] sparc:sun4m: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 64/86] ppc:ppc405_boards: add RAM size checks

2019-12-31 Thread Igor Mammedov
If user provided non-sense RAM size, board will ignore it and continue running with fixed RAM size. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix CLI. Make it error message and exit to force user fix CLI, instead of accepting non-sense CLI values. PS

[PATCH 71/86] ppc:virtex_ml507: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 76/86] post conversion default_ram_id cleanup

2019-12-31 Thread Igor Mammedov
With default_ram_id is always defined, simplify 'if' conditions in vl.c and numa.c while at it set MachineClass::default_ram_id = "ram" and clean up several boards that use "ram" id Signed-off-by: Igor Mammedov --- hw/alpha/dp264.c | 1 - hw/arm/aspeed.c| 1 - hw/arm/digic_board

[PATCH 61/86] ppc:mac_newworld: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 74/86] sparc:niagara: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 72/86] sparc:leon3: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 78/86] exec: drop bogus mem_path from qemu_ram_alloc_from_fd()

2019-12-31 Thread Igor Mammedov
Function will report error that will mention global mem_path, which was valid the only if legacy -mem-path was used and only in case of main RAM. However it doesn't work with hostmem backends (for example: " qemu: -object memory-backend-file,id=ram0,size=128M,mem-path=foo: backing store (nul

[PATCH 60/86] ppc:e500: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 77/86] exec: cleanup qemu_minrampagesize()/qemu_maxrampagesize()

2019-12-31 Thread Igor Mammedov
Since all RAM is backed by hostmem backends, drop global -mem-path invariant and simplify code. Signed-off-by: Igor Mammedov --- exec.c | 51 +-- 1 file changed, 5 insertions(+), 46 deletions(-) diff --git a/exec.c b/exec.c index d4b769d..7b6e376

[PATCH 80/86] hostmem: introduce "prealloc-threads" property

2019-12-31 Thread Igor Mammedov
the property will allow user to specify number of threads to use in pre-allocation stage. It also will allow to reduce implicit hostmem dependency on current_machine. On object creation it will default to 1, but via machine compat property it will be updated to MachineState::smp::cpus to keep curre

[PATCH 75/86] remove no longer used memory_region_allocate_system_memory()

2019-12-31 Thread Igor Mammedov
all boards were switched to using memdev backend for main RAM, so we can drop no longer used memory_region_allocate_system_memory() Signed-off-by: Igor Mammedov --- include/hw/boards.h | 32 hw/core/numa.c | 34 -- 2 files cha

[PATCH 63/86] ppc:pnv: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 79/86] make mem_path local variable

2019-12-31 Thread Igor Mammedov
It's no longer used anywhere beside main(), so make it local variable that is used for CLI compat purposes to keep -mem-path option working. Under hood QEMU will use it to create memory-backend-file,mem-path=... backend and use its MemoryRegion as main RAM. Signed-off-by: Igor Mammedov --- in

[PATCH 82/86] numa: forbid '-numa node, mem' for 5.0 and newer machine types

2019-12-31 Thread Igor Mammedov
Deprecation period is ran out and it's a time to flip the switch introduced by cd5ff8333a. Disable legacy option for new machine types and amend documentation. Signed-off-by: Igor Mammedov --- hw/arm/virt.c| 2 +- hw/core/numa.c | 6 ++ hw/i386/pc.c | 1 - hw/i386/pc

[PATCH 68/86] ppc:prep: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 81/86] hostmem: fix strict bind policy

2019-12-31 Thread Igor Mammedov
When option -mem-prealloc is used with one or more memory-backend objects, created backends may not obey configured bind policy or creation may fail after kernel attempts to move pages according to bind policy. Reason is in file_ram_alloc(), which will pre-allocate any descriptor based RAM if globa

[PATCH 83/86] tests:numa-test: make top level args dynamic and g_autofree(cli) cleanups

2019-12-31 Thread Igor Mammedov
Use GString to pass argument to make_cli() so that it would be easy to dynamically change test case arguments from main(). The follow up patch will use it to change RAM size options depending on target. While at it cleanup 'cli' freeing, using g_autofree annotation. Signed-off-by: Igor Mammedov

[PATCH 70/86] ppc:virtex_ml507: remove unused arguments

2019-12-31 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- hw/ppc/virtex_ml507.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c index 6862552..651d8db 100644 --- a/hw/ppc/virtex_ml507.c +++ b/hw/ppc/virtex_ml507.c @@ -89,10 +89,7 @@ static void mmub

[PATCH 38/86] arm:xlnx-versal-virt: use memdev for RAM

2019-12-31 Thread Igor Mammedov
memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using MachineState::ram instead of manually initializi

[PATCH 85/86] numa: make exit() usage consistent

2019-12-31 Thread Igor Mammedov
Signed-off-by: Igor Mammedov --- hw/core/numa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/numa.c b/hw/core/numa.c index beb6d2e..96776ff 100644 --- a/hw/core/numa.c +++ b/hw/core/numa.c @@ -421,7 +421,7 @@ void numa_complete_configuration(MachineState *ms)

[PATCH 66/86] ppc:ppc440_bamboo/sam460ex: drop RAM size fixup

2019-12-31 Thread Igor Mammedov
If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to force user fix CLI, instead of accepting non-

Re: [PATCH] display/gtk: get proper refreshrate

2019-12-31 Thread Philippe Mathieu-Daudé
Hi Nikola, Cc'ing the qemu-devel list. On 12/31/19 1:38 AM, Nikola Pavlica wrote: On Mon, 2019-12-30 at 23:59 +0100, Philippe Mathieu-Daudé wrote: Hi Nikola, Thanks for your patch! On 12/30/19 6:28 PM, Nikola Pavlica wrote: From 70c95b18fa056b2dd0ecc202ab517bc775b986da Mon Sep 17 00:00:00

[PATCH 86/86] numa: remove deprecated implicit RAM distribution between nodes

2019-12-31 Thread Igor Mammedov
Feature has been deprecated since 4.1 (4bb4a273), remove it. As result if RAM distribution wasn't specified explicitly, the machine won't start and CLI should be changed to explicitly assign RAM to nodes using options: -node node,memdev (5.0 and newer machine types) -node node,mem (4.2 an

[PATCH 84/86] tests:numa-test: use explicit memdev to specify node RAM

2019-12-31 Thread Igor Mammedov
Follow up patches will remove automatic RAM distribution between nodes and will make default machine types require "memdev" option instead of legacy "mem" option. Make tests to follow new rules and add an additional test for legacy "mem" option on old machine type, to make sure it won't regress in

[PATCH] vfio/pci: Don't remove irqchip notifier if not registered

2019-12-31 Thread Peter Xu
The kvm irqchip notifier is only registered if the device supports INTx, however it's unconditionally removed. If the assigned device does not support INTx, this will cause QEMU to crash when unplugging the device from the system. Change it to conditionally remove the notifier only if the notify

[PATCH 17/86] arm:imx25_pdk: drop RAM size fixup

2019-12-31 Thread Igor Mammedov
If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to force user fix CLI, instead of accepting non-

Re: [PATCH 41/86] null-machine: use memdev for RAM

2019-12-31 Thread Philippe Mathieu-Daudé
On 12/31/19 2:03 PM, Igor Mammedov wrote: memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using Mac

Re: [PATCH 43/86] hppa: drop RAM size fixup

2019-12-31 Thread Philippe Mathieu-Daudé
On 12/31/19 2:03 PM, Igor Mammedov wrote: If user provided non-sense RAM size, board will complain and continue running with max RAM size supported. Also RAM is going to be allocated by generic code, so it won't be possible for board to fix things up for user. Make it error message and exit to f

Re: [PATCH 44/86] hppa: use memdev for RAM

2019-12-31 Thread Philippe Mathieu-Daudé
On 12/31/19 2:03 PM, Igor Mammedov wrote: memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using Mac

Re: [PATCH 00/86] refactor main RAM allocation to use hostmem backend

2019-12-31 Thread Philippe Mathieu-Daudé
Hi Igor, On 12/31/19 2:02 PM, Igor Mammedov wrote: 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 alloca

Re: [PATCH 72/86] sparc:leon3: use memdev for RAM

2019-12-31 Thread Philippe Mathieu-Daudé
On 12/31/19 2:03 PM, Igor Mammedov wrote: memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using Mac

Re: [PATCH 74/86] sparc:niagara: use memdev for RAM

2019-12-31 Thread Philippe Mathieu-Daudé
On 12/31/19 2:03 PM, Igor Mammedov wrote: memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using Mac

Re: [PATCH 76/86] post conversion default_ram_id cleanup

2019-12-31 Thread Philippe Mathieu-Daudé
On 12/31/19 2:04 PM, Igor Mammedov wrote: With default_ram_id is always defined, simplify 'if' conditions in vl.c and numa.c while at it set MachineClass::default_ram_id = "ram" and clean up several boards that use "ram" id Signed-off-by: Igor Mammedov Reviewed-by: Philippe Mathieu-Daudé

Re: [PATCH 38/86] arm:xlnx-versal-virt: use memdev for RAM

2019-12-31 Thread Philippe Mathieu-Daudé
On 12/31/19 2:03 PM, Igor Mammedov wrote: memory_region_allocate_system_memory() API is going away, so replace it with memdev allocated MemoryRegion. The later is initialized by generic code, so board only needs to opt in to memdev scheme by providing MachineClass::default_ram_id and using Mac

  1   2   >